Remove gmm compat functions
* lisp/gnus/gmm-utils.el (gmm-image-search-load-path): Remove. (gmm-write-region): Remove. (gmm-called-interactively-p): Remove.
This commit is contained in:
parent
c612461fa2
commit
ee506a23ed
8 changed files with 13 additions and 58 deletions
|
@ -193,21 +193,6 @@ This is a copy of the `lazy' widget in Emacs 22.1 provided for compatibility."
|
||||||
:tag "Other"
|
:tag "Other"
|
||||||
(symbol :tag "Icon item")))))
|
(symbol :tag "Icon item")))))
|
||||||
|
|
||||||
;; (defun gmm-color-cells (&optional display)
|
|
||||||
;; "Return the number of color cells supported by DISPLAY.
|
|
||||||
;; Compatibility function."
|
|
||||||
;; ;; `display-color-cells' doesn't return more than 256 even if color depth is
|
|
||||||
;; ;; > 8 in Emacs 21.
|
|
||||||
;; ;;
|
|
||||||
;; ;; Feel free to add proper XEmacs support.
|
|
||||||
;; (let* ((cells (and (fboundp 'display-color-cells)
|
|
||||||
;; (display-color-cells display)))
|
|
||||||
;; (plane (and (fboundp 'x-display-planes)
|
|
||||||
;; (ash 1 (x-display-planes))))
|
|
||||||
;; (none -1))
|
|
||||||
;; (max (if (integerp cells) cells none)
|
|
||||||
;; (if (integerp plane) plane none))))
|
|
||||||
|
|
||||||
(defcustom gmm-tool-bar-style
|
(defcustom gmm-tool-bar-style
|
||||||
(if (and (boundp 'tool-bar-mode)
|
(if (and (boundp 'tool-bar-mode)
|
||||||
tool-bar-mode
|
tool-bar-mode
|
||||||
|
@ -338,7 +323,7 @@ compatibility with versions of Emacs that lack the variable
|
||||||
(let ((img image)
|
(let ((img image)
|
||||||
(dir (or
|
(dir (or
|
||||||
;; Images in image-load-path.
|
;; Images in image-load-path.
|
||||||
(gmm-image-search-load-path image) ;; "gmm-" prefix!
|
(image-search-load-path image)
|
||||||
;; Images in load-path.
|
;; Images in load-path.
|
||||||
(locate-library image)))
|
(locate-library image)))
|
||||||
parent)
|
parent)
|
||||||
|
@ -405,30 +390,6 @@ If mode is nil, use `major-mode' of the current buffer."
|
||||||
(string-match "^\\(.+\\)-mode$" mode)
|
(string-match "^\\(.+\\)-mode$" mode)
|
||||||
(match-string 1 mode))))))
|
(match-string 1 mode))))))
|
||||||
|
|
||||||
(defun gmm-write-region (start end filename &optional append visit
|
|
||||||
lockname mustbenew)
|
|
||||||
"Compatibility function for `write-region'.
|
|
||||||
|
|
||||||
In XEmacs, the seventh argument of `write-region' specifies the
|
|
||||||
coding-system."
|
|
||||||
(if (and mustbenew (featurep 'xemacs))
|
|
||||||
(if (file-exists-p filename)
|
|
||||||
(signal 'file-already-exists (list "File exists" filename))
|
|
||||||
(write-region start end filename append visit lockname))
|
|
||||||
(write-region start end filename append visit lockname mustbenew)))
|
|
||||||
|
|
||||||
;; `interactive-p' is obsolete since Emacs 23.2.
|
|
||||||
(defmacro gmm-called-interactively-p (kind)
|
|
||||||
(condition-case nil
|
|
||||||
(progn
|
|
||||||
(eval '(called-interactively-p 'any))
|
|
||||||
;; Emacs >=23.2
|
|
||||||
`(called-interactively-p ,kind))
|
|
||||||
;; Emacs <23.2
|
|
||||||
(wrong-number-of-arguments '(called-interactively-p))
|
|
||||||
;; XEmacs
|
|
||||||
(void-function '(interactive-p))))
|
|
||||||
|
|
||||||
;; `labels' is obsolete since Emacs 24.3.
|
;; `labels' is obsolete since Emacs 24.3.
|
||||||
(defmacro gmm-labels (bindings &rest body)
|
(defmacro gmm-labels (bindings &rest body)
|
||||||
"Make temporary function bindings.
|
"Make temporary function bindings.
|
||||||
|
|
|
@ -2718,7 +2718,7 @@ If READ-CHARSET, ask for a coding system."
|
||||||
(while (re-search-forward
|
(while (re-search-forward
|
||||||
"\\(\\(https?\\|ftp\\)://\\S-+\\) *\n\\(\\S-+\\)" nil t)
|
"\\(\\(https?\\|ftp\\)://\\S-+\\) *\n\\(\\S-+\\)" nil t)
|
||||||
(replace-match "\\1\\3" t)))
|
(replace-match "\\1\\3" t)))
|
||||||
(when (gmm-called-interactively-p 'any)
|
(when (called-interactively-p 'any)
|
||||||
(gnus-treat-article nil))))
|
(gnus-treat-article nil))))
|
||||||
|
|
||||||
(defun article-wash-html ()
|
(defun article-wash-html ()
|
||||||
|
|
|
@ -367,7 +367,7 @@ The leftmost column displays a D if the bookmark is flagged for
|
||||||
deletion, or > if it is flagged for displaying."
|
deletion, or > if it is flagged for displaying."
|
||||||
(interactive)
|
(interactive)
|
||||||
(gnus-bookmark-maybe-load-default-file)
|
(gnus-bookmark-maybe-load-default-file)
|
||||||
(if (gmm-called-interactively-p 'any)
|
(if (called-interactively-p 'any)
|
||||||
(switch-to-buffer (get-buffer-create "*Gnus Bookmark List*"))
|
(switch-to-buffer (get-buffer-create "*Gnus Bookmark List*"))
|
||||||
(set-buffer (get-buffer-create "*Gnus Bookmark List*")))
|
(set-buffer (get-buffer-create "*Gnus Bookmark List*")))
|
||||||
(let ((inhibit-read-only t)
|
(let ((inhibit-read-only t)
|
||||||
|
|
|
@ -1036,7 +1036,7 @@ only the last one's marks are returned."
|
||||||
(let* ((article (last articles))
|
(let* ((article (last articles))
|
||||||
(id (gnus-registry-fetch-message-id-fast article))
|
(id (gnus-registry-fetch-message-id-fast article))
|
||||||
(marks (when id (gnus-registry-get-id-key id 'mark))))
|
(marks (when id (gnus-registry-get-id-key id 'mark))))
|
||||||
(when (gmm-called-interactively-p 'any)
|
(when (called-interactively-p 'any)
|
||||||
(gnus-message 1 "Marks are %S" marks))
|
(gnus-message 1 "Marks are %S" marks))
|
||||||
marks))
|
marks))
|
||||||
|
|
||||||
|
|
|
@ -1167,7 +1167,7 @@ articles in the topic and its subtopics."
|
||||||
(remove-hook 'gnus-check-bogus-groups-hook 'gnus-topic-clean-alist)
|
(remove-hook 'gnus-check-bogus-groups-hook 'gnus-topic-clean-alist)
|
||||||
(setq gnus-group-prepare-function 'gnus-group-prepare-flat)
|
(setq gnus-group-prepare-function 'gnus-group-prepare-flat)
|
||||||
(setq gnus-group-sort-alist-function 'gnus-group-sort-flat))
|
(setq gnus-group-sort-alist-function 'gnus-group-sort-flat))
|
||||||
(when (gmm-called-interactively-p 'any)
|
(when (called-interactively-p 'any)
|
||||||
(gnus-group-list-groups))))
|
(gnus-group-list-groups))))
|
||||||
|
|
||||||
(defun gnus-topic-select-group (&optional all)
|
(defun gnus-topic-select-group (&optional all)
|
||||||
|
|
|
@ -3201,7 +3201,7 @@ M-RET `message-newline-and-reformat' (break the line and reformat)."
|
||||||
(defun message-goto-body ()
|
(defun message-goto-body ()
|
||||||
"Move point to the beginning of the message body."
|
"Move point to the beginning of the message body."
|
||||||
(interactive)
|
(interactive)
|
||||||
(when (and (gmm-called-interactively-p 'any)
|
(when (and (called-interactively-p 'any)
|
||||||
(looking-at "[ \t]*\n"))
|
(looking-at "[ \t]*\n"))
|
||||||
(expand-abbrev))
|
(expand-abbrev))
|
||||||
(push-mark)
|
(push-mark)
|
||||||
|
|
|
@ -1371,8 +1371,6 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'."
|
||||||
inhibit-file-name-handlers)))
|
inhibit-file-name-handlers)))
|
||||||
(write-region start end filename append visit lockname)))
|
(write-region start end filename append visit lockname)))
|
||||||
|
|
||||||
(autoload 'gmm-write-region "gmm-utils")
|
|
||||||
|
|
||||||
;; It is not a MIME function, but some MIME functions use it.
|
;; It is not a MIME function, but some MIME functions use it.
|
||||||
(if (and (fboundp 'make-temp-file)
|
(if (and (fboundp 'make-temp-file)
|
||||||
(ignore-errors
|
(ignore-errors
|
||||||
|
@ -1417,11 +1415,7 @@ If SUFFIX is non-nil, add that at the end of the file name."
|
||||||
(setq file (concat file suffix)))
|
(setq file (concat file suffix)))
|
||||||
(if dir-flag
|
(if dir-flag
|
||||||
(make-directory file)
|
(make-directory file)
|
||||||
;; NOTE: This is unsafe if Emacs 20
|
(write-region "" nil file nil 'silent nil 'excl))
|
||||||
;; users and XEmacs users don't use
|
|
||||||
;; a secure temp directory.
|
|
||||||
(gmm-write-region "" nil file nil 'silent
|
|
||||||
nil 'excl))
|
|
||||||
nil)
|
nil)
|
||||||
(file-already-exists t)
|
(file-already-exists t)
|
||||||
;; The XEmacs version of `make-directory' issues
|
;; The XEmacs version of `make-directory' issues
|
||||||
|
|
|
@ -537,8 +537,8 @@ by nnmaildir-request-article.")
|
||||||
(prin1 (vector storage-version num msgid nov) (current-buffer))
|
(prin1 (vector storage-version num msgid nov) (current-buffer))
|
||||||
(setq file (concat novfile ":"))
|
(setq file (concat novfile ":"))
|
||||||
(nnmaildir--unlink file)
|
(nnmaildir--unlink file)
|
||||||
(gmm-write-region (point-min) (point-max) file nil 'no-message nil
|
(write-region (point-min) (point-max) file nil 'no-message nil
|
||||||
'excl))
|
'excl))
|
||||||
(rename-file file novfile 'replace)
|
(rename-file file novfile 'replace)
|
||||||
(setf (nnmaildir--art-msgid article) msgid)
|
(setf (nnmaildir--art-msgid article) msgid)
|
||||||
nov)))
|
nov)))
|
||||||
|
@ -1396,8 +1396,8 @@ by nnmaildir-request-article.")
|
||||||
(concat "File exists: " tmpfile))
|
(concat "File exists: " tmpfile))
|
||||||
(throw 'return nil))
|
(throw 'return nil))
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(gmm-write-region (point-min) (point-max) tmpfile nil 'no-message nil
|
(write-region (point-min) (point-max) tmpfile nil 'no-message nil
|
||||||
'excl))
|
'excl))
|
||||||
(unix-sync) ;; no fsync :(
|
(unix-sync) ;; no fsync :(
|
||||||
(rename-file tmpfile (concat (nnmaildir--cur dir) file suffix) 'replace)
|
(rename-file tmpfile (concat (nnmaildir--cur dir) file suffix) 'replace)
|
||||||
t)))
|
t)))
|
||||||
|
@ -1490,8 +1490,8 @@ by nnmaildir-request-article.")
|
||||||
(throw 'return nil))))
|
(throw 'return nil))))
|
||||||
(condition-case nil (add-name-to-file nnmaildir--file tmpfile)
|
(condition-case nil (add-name-to-file nnmaildir--file tmpfile)
|
||||||
(error
|
(error
|
||||||
(gmm-write-region (point-min) (point-max) tmpfile nil 'no-message nil
|
(write-region (point-min) (point-max) tmpfile nil 'no-message nil
|
||||||
'excl)
|
'excl)
|
||||||
(when (fboundp 'unix-sync)
|
(when (fboundp 'unix-sync)
|
||||||
(unix-sync)))) ;; no fsync :(
|
(unix-sync)))) ;; no fsync :(
|
||||||
(nnheader-cancel-timer 24h)
|
(nnheader-cancel-timer 24h)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue