commit ae928ae2397a58a75584aaa0037a3dc383473756 (HEAD, refs/remotes/origin/master) Author: Lars Ingebrigtsen Date: Thu Feb 11 16:59:06 2016 +1100 Remove som XEmacs compat code from message.el * lisp/gnus/message.el: Remove some XEmacs compat code. diff --git a/lisp/gnus/mailcap.el b/lisp/gnus/mailcap.el index 85d0411..62d8b9b 100644 --- a/lisp/gnus/mailcap.el +++ b/lisp/gnus/mailcap.el @@ -53,12 +53,6 @@ table) "A syntax table for parsing SGML attributes.") -(eval-and-compile - (when (featurep 'xemacs) - (condition-case nil - (require 'lpr) - (error nil)))) - (defvar mailcap-print-command (mapconcat 'identity (cons (if (boundp 'lpr-command) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 3ed359b..fee7937 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -40,9 +40,7 @@ ;; This is apparently necessary even though things are autoloaded. ;; Because we dynamically bind mail-abbrev-mode-regexp, we'd better ;; require mailabbrev here. -(if (featurep 'xemacs) - (require 'mail-abbrevs) - (require 'mailabbrev)) +(require 'mailabbrev) (require 'mail-parse) (require 'mml) (require 'rfc822) @@ -1249,11 +1247,7 @@ called and its result is inserted." (if (and (boundp 'mail-archive-file-name) (stringp mail-archive-file-name)) (format "FCC: %s\n" mail-archive-file-name)) - ;; Use the value of `mail-default-headers' if available. - ;; Note: as for XEmacs 21.4 and 21.5, it is unavailable - ;; unless sendmail.el is loaded. - (if (boundp 'mail-default-headers) - mail-default-headers)) + mail-default-headers) "*A string of header lines to be inserted in outgoing mails." :version "23.2" :group 'message-headers commit 7d17d4ba235d44c38e528d4fb7c75071c62ca736 Author: Lars Ingebrigtsen Date: Thu Feb 11 16:57:13 2016 +1100 Remove XEmacs compat code from ietf-drums.el * lisp/gnus/ietf-drums.el (ietf-drums-syntax-table): Drop XEmacs compat. diff --git a/lisp/gnus/ietf-drums.el b/lisp/gnus/ietf-drums.el index 8008e32..429eead 100644 --- a/lisp/gnus/ietf-drums.el +++ b/lisp/gnus/ietf-drums.el @@ -74,11 +74,6 @@ backslash and doublequote.") (modify-syntax-entry ?* "_" table) (modify-syntax-entry ?\; "_" table) (modify-syntax-entry ?\' "_" table) - (if (featurep 'xemacs) - (let ((i 128)) - (while (< i 256) - (modify-syntax-entry i "w" table) - (setq i (1+ i))))) table)) (defun ietf-drums-token-to-list (token) commit f5a801ca4558ecf74d7637535978b548167edf18 Author: Lars Ingebrigtsen Date: Thu Feb 11 16:56:28 2016 +1100 Remove XEmacs compat code from gravatar.el * lisp/gnus/gravatar.el: Remove XEmacs compat code from gravatar.el. diff --git a/lisp/gnus/gravatar.el b/lisp/gnus/gravatar.el index 8694003..81503b7 100644 --- a/lisp/gnus/gravatar.el +++ b/lisp/gnus/gravatar.el @@ -26,6 +26,7 @@ (require 'url) (require 'url-cache) +(require 'image) (defgroup gravatar nil "Gravatar." @@ -91,20 +92,12 @@ (when (search-forward "\n\n" nil t) (buffer-substring (point) (point-max)))))) -(eval-and-compile - (cond ((featurep 'xemacs) - (require 'gnus-xmas) - (defalias 'gravatar-create-image 'gnus-xmas-create-image)) - (t - (require 'image) - (defalias 'gravatar-create-image 'create-image)))) - (defun gravatar-data->image () "Get data of current buffer and return an image. If no image available, return 'error." (let ((data (gravatar-get-data))) (if data - (gravatar-create-image data nil t) + (create-image data nil t) 'error))) (autoload 'help-function-arglist "help-fns") commit 00cc327b9d7f2b90b10ec45f111dcc670dbbb102 Author: Lars Ingebrigtsen Date: Thu Feb 11 16:55:30 2016 +1100 Remove more XEmacs compat code from Gnus * lisp/gnus/gnus-util.el (gnus-bound-and-true-p): Remove. (gnus-timer--function): Remove. * lisp/gnus/gnus-uu.el (gnus-uu-save-article): Remove XEmacs 19.2 compat. * lisp/gnus/gnus-win.el: Remove XEmacs compat code. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 9b1215b..99d107e 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -4562,7 +4562,7 @@ commands: (defun gnus-article-stop-animations () (dolist (timer (and (boundp 'timer-list) timer-list)) - (when (eq (gnus-timer--function timer) 'image-animate-timeout) + (when (eq (timer--function timer) 'image-animate-timeout) (cancel-timer timer)))) (defun gnus-stop-downloads () diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 52b2df4..eee80fd 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1819,16 +1819,6 @@ to case differences." (string-equal (downcase str1) (downcase prefix)) (string-equal str1 prefix)))))) -;; Simple check: can be a macro but this way, although slow, it's really clear. -;; We don't use `bound-and-true-p' because it's not in XEmacs. -(defun gnus-bound-and-true-p (sym) - (and (boundp sym) (symbol-value sym))) - -(if (fboundp 'timer--function) - (defalias 'gnus-timer--function 'timer--function) - (defun gnus-timer--function (timer) - (elt timer 5))) - (defun gnus-test-list (list predicate) "To each element of LIST apply PREDICATE. Return nil if LIST is no list or is empty or some test returns nil; diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index 416567e..1a249e9 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -876,10 +876,7 @@ When called interactively, prompt for REGEXP." (with-current-buffer buffer (save-restriction (let ((inhibit-read-only t)) - (set-text-properties (point-min) (point-max) nil) - ;; These two are necessary for XEmacs 19.12 fascism. - (put-text-property (point-min) (point-max) 'invisible nil) - (put-text-property (point-min) (point-max) 'intangible nil)) + (set-text-properties (point-min) (point-max) nil)) (when (and message-forward-as-mime message-forward-show-mml gnus-uu-digest-buffer) diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el index 2c448aa..c17ccd6 100644 --- a/lisp/gnus/gnus-win.el +++ b/lisp/gnus/gnus-win.el @@ -273,9 +273,7 @@ See the Gnus manual for an explanation of the syntax used.") (cond ((eq buf (window-buffer (selected-window))) (set-buffer buf)) - ((eq t (window-dedicated-p - ;; XEmacs version of `window-dedicated-p' requires it. - (selected-window))) + ((eq t (window-dedicated-p)) ;; If the window is hard-dedicated, we have a problem because ;; we just can't do what we're asked. But signaling an error, ;; like `switch-to-buffer' would do, is not an option because @@ -417,15 +415,11 @@ See the Gnus manual for an explanation of the syntax used.") (gnus-delete-windows-in-gnusey-frames)) ;; Just remove some windows. (gnus-remove-some-windows) - (if (featurep 'xemacs) - (switch-to-buffer nntp-server-buffer) - (set-buffer nntp-server-buffer))) + (set-buffer nntp-server-buffer)) (select-frame frame))) (let (gnus-window-frame-focus) - (if (featurep 'xemacs) - (switch-to-buffer nntp-server-buffer) - (set-buffer nntp-server-buffer)) + (set-buffer nntp-server-buffer) (gnus-configure-frame split) (run-hooks 'gnus-configure-windows-hook) (when gnus-window-frame-focus @@ -510,9 +504,7 @@ should have point." lowest-buf buf)))) (when lowest-buf (pop-to-buffer lowest-buf) - (if (featurep 'xemacs) - (switch-to-buffer nntp-server-buffer) - (set-buffer nntp-server-buffer))) + (set-buffer nntp-server-buffer)) (mapcar (lambda (b) (delete-windows-on b t)) (delq lowest-buf bufs))))) @@ -520,9 +512,6 @@ should have point." (cond ((fboundp 'frames-on-display-list) (defalias 'gnus-frames-on-display-list 'frames-on-display-list)) - ((and (featurep 'xemacs) (fboundp 'frame-device)) - (defun gnus-frames-on-display-list () - (apply 'filtered-frame-list 'identity (list (frame-device nil))))) (t (defalias 'gnus-frames-on-display-list 'frame-list)))) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 661f483..fe86749 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -2503,16 +2503,11 @@ Disabling the agent may result in noticeable loss of performance." (function-item gnus-slave-no-server))) (defcustom gnus-other-frame-parameters nil - "Frame parameters used by `gnus-other-frame' to create a Gnus frame. -This should be an alist for Emacs, or a plist for XEmacs." + "Frame parameters used by `gnus-other-frame' to create a Gnus frame." :group 'gnus-start - :type (if (featurep 'xemacs) - '(repeat (list :inline t :format "%v" - (symbol :tag "Property") - (sexp :tag "Value"))) - '(repeat (cons :format "%v" - (symbol :tag "Parameter") - (sexp :tag "Value"))))) + :type '(repeat (cons :format "%v" + (symbol :tag "Parameter") + (sexp :tag "Value")))) (defcustom gnus-user-agent '(emacs gnus type) "Which information should be exposed in the User-Agent header. diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index eb436f5..783d1b9 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -1787,7 +1787,7 @@ article came from is also searched." (list (list (gnus-method-to-server (gnus-find-method-for-group gnus-newsgroup-name))))) (registry-group (and - (gnus-bound-and-true-p 'gnus-registry-enabled) + (bound-and-true-p gnus-registry-enabled) (car (gnus-registry-get-id-key (mail-header-id header) 'group)))) (registry-server @@ -1859,7 +1859,7 @@ article came from is also searched." (when (eq (car (gnus-find-method-for-group gnus-newsgroup-name)) 'nnir) (setq gnus-summary-line-format (or nnir-summary-line-format gnus-summary-line-format)) - (when (gnus-bound-and-true-p 'gnus-registry-enabled) + (when (bound-and-true-p gnus-registry-enabled) (remove-hook 'gnus-summary-article-delete-hook 'gnus-registry-action t) (remove-hook 'gnus-summary-article-move-hook 'gnus-registry-action t) (remove-hook 'gnus-summary-article-expire-hook 'gnus-registry-action t) diff --git a/lisp/gnus/nnmairix.el b/lisp/gnus/nnmairix.el index d5fa4fa..20aecd9 100644 --- a/lisp/gnus/nnmairix.el +++ b/lisp/gnus/nnmairix.el @@ -1635,7 +1635,7 @@ search in raw mode." (defun nnmairix-determine-original-group-from-registry (mid) "Try to determine original group for message-id MID from the registry." - (when (gnus-bound-and-true-p 'gnus-registry-enabled) + (when (bound-and-true-p gnus-registry-enabled) (unless (string-match "^<" mid) (set mid (concat "<" mid))) (unless (string-match ">$" mid) commit efbaf95619cad8b9dc911c0393a004f225d44cec Author: Lars Ingebrigtsen Date: Thu Feb 11 16:45:02 2016 +1100 Remove more XEmacs compat functions from gnus-util.el * lisp/gnus/gnus-util.el (gnus-put-display-table): Remove. (gnus-get-display-table): Remove. (gnus-format-message): Remove. diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index ae5cfc6..11f93a2 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -837,7 +837,7 @@ be a select method." (not (eq gnus-agent-synchronize-flags 'ask))) (and (eq gnus-agent-synchronize-flags 'ask) (gnus-y-or-n-p - (gnus-format-message + (format-message "Synchronize flags on server `%s'? " (cadr method)))))) (gnus-agent-synchronize-flags-server method))) diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index c4f6823..9b1215b 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2744,7 +2744,7 @@ summary buffer." (cond ((file-directory-p file) (when (or (not (eq how 'file)) (gnus-y-or-n-p - (gnus-format-message + (format-message "Delete temporary HTML file(s) in directory `%s'? " (file-name-as-directory file)))) (gnus-delete-directory file))) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 190acf1..eec7b1c 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -2927,7 +2927,7 @@ and NEW-NAME will be prompted for." (gnus-info-params info)) (t info)) ;; The proper documentation. - (gnus-format-message + (format-message "Editing the %s for `%s'." (cond ((eq part 'method) "select method") @@ -3255,7 +3255,7 @@ mail messages or news articles in files that have numeric names." (error "%s is not an nnimap group" group)) (unless (setq acl (nnimap-acl-get mailbox (cadr method))) (error "Server does not support ACL's")) - (gnus-edit-form acl (gnus-format-message "\ + (gnus-edit-form acl (format-message "\ Editing the access control list for `%s'. An access control list is a list of (identifier . rights) elements. diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el index d0798d3..38cfa44 100644 --- a/lisp/gnus/gnus-int.el +++ b/lisp/gnus/gnus-int.el @@ -164,7 +164,7 @@ If CONFIRM is non-nil, the user will be asked for an NNTP server." (gnus-open-server gnus-select-method) gnus-batch-mode (gnus-y-or-n-p - (gnus-format-message + (format-message "%s (%s) open error: `%s'. Continue? " (car gnus-select-method) (cadr gnus-select-method) (gnus-status-message gnus-select-method))) diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 8669ff4..825c95c 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -2388,8 +2388,8 @@ If FORCE is non-nil, the .newsrc file is read." (funcall func convert-to))) (gnus-dribble-enter - (gnus-format-message ";Converted gnus from version `%s' to `%s'." - gnus-newsrc-file-version gnus-version))))))) + (format-message ";Converted gnus from version `%s' to `%s'." + gnus-newsrc-file-version gnus-version))))))) (defun gnus-convert-mark-converter-prompt (converter no-prompt) "Indicate whether CONVERTER requires gnus-convert-old-newsrc to diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 5eb89b7..683eca1 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -3435,13 +3435,13 @@ display only a single character." (i 32)) ;; Nix out all the control chars... (while (>= (setq i (1- i)) 0) - (gnus-put-display-table i [??] table)) + (aset table i [??])) ;; ... but not newline and cr, of course. (cr is necessary for the ;; selective display). - (gnus-put-display-table ?\n nil table) - (gnus-put-display-table ?\r nil table) + (aset table ?\n nil) + (aset table ?\r nil) ;; We keep TAB as well. - (gnus-put-display-table ?\t nil table) + (aset table ?\t nil) ;; We nix out any glyphs 127 through 255, or 127 through 159 in ;; Emacs 23 (unicode), that are not set already. (let ((i (if (ignore-errors (= (make-char 'latin-iso8859-1 160) 160)) @@ -3449,8 +3449,8 @@ display only a single character." 256))) (while (>= (setq i (1- i)) 127) ;; Only modify if the entry is nil. - (unless (gnus-get-display-table i table) - (gnus-put-display-table i [??] table)))) + (unless (aref table i) + (aset table i [??])))) (setq buffer-display-table table))) (defun gnus-summary-set-article-display-arrow (pos) diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el index 1245b96..b471c2a 100644 --- a/lisp/gnus/gnus-topic.el +++ b/lisp/gnus/gnus-topic.el @@ -1611,8 +1611,8 @@ If performed on a topic, edit the topic parameters instead." (let ((topic (gnus-group-topic-name))) (gnus-edit-form (gnus-topic-parameters topic) - (gnus-format-message "Editing the topic parameters for `%s'." - (or group topic)) + (format-message "Editing the topic parameters for `%s'." + (or group topic)) `(lambda (form) (gnus-topic-set-parameters ,topic form))))))) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 49a0061..52b2df4 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1726,27 +1726,6 @@ empty directories from OLD-PATH." (defalias 'gnus-read-shell-command (if (fboundp 'read-shell-command) 'read-shell-command 'read-string)) -(defmacro gnus-put-display-table (range value display-table) - "Set the value for char RANGE to VALUE in DISPLAY-TABLE. " - (if (featurep 'xemacs) - (progn - `(if (fboundp 'put-display-table) - (put-display-table ,range ,value ,display-table) - (if (sequencep ,display-table) - (aset ,display-table ,range ,value) - (put-char-table ,range ,value ,display-table)))) - `(aset ,display-table ,range ,value))) - -(defmacro gnus-get-display-table (character display-table) - "Find value for CHARACTER in DISPLAY-TABLE. " - (if (featurep 'xemacs) - `(if (fboundp 'get-display-table) - (get-display-table ,character ,display-table) - (if (sequencep ,display-table) - (aref ,display-table ,character) - (get-char-table ,character ,display-table))) - `(aref ,display-table ,character))) - (declare-function image-size "image.c" (spec &optional pixels frame)) (defun gnus-rescale-image (image size) @@ -1840,11 +1819,6 @@ to case differences." (string-equal (downcase str1) (downcase prefix)) (string-equal str1 prefix)))))) -(defalias 'gnus-format-message - (if (fboundp 'format-message) 'format-message - ;; for Emacs < 25, and XEmacs, don't worry about quote translation. - 'format)) - ;; Simple check: can be a macro but this way, although slow, it's really clear. ;; We don't use `bound-and-true-p' because it's not in XEmacs. (defun gnus-bound-and-true-p (sym) diff --git a/lisp/gnus/legacy-gnus-agent.el b/lisp/gnus/legacy-gnus-agent.el index 7293e33..a8c61fa 100644 --- a/lisp/gnus/legacy-gnus-agent.el +++ b/lisp/gnus/legacy-gnus-agent.el @@ -148,17 +148,17 @@ converted to the compressed format." (gnus-pp gnus-agent-expire-days) (insert - (gnus-format-message + (format-message "\nIn order to use version `%s' of gnus, you will need to set\n" converting-to)) (insert "gnus-agent-expire-days to an integer. If you still wish to set different\n") (insert "expiration days to individual groups, you must instead set the\n") - (insert (gnus-format-message + (insert (format-message "`agent-days-until-old' group and/or topic parameter.\n")) (insert "\n") (insert "If you would like, gnus can iterate over every group comparing its name to the\n") (insert "regular expressions that you currently have in gnus-agent-expire-days. When\n") - (insert (gnus-format-message + (insert (format-message "gnus finds a match, it will update that group's `agent-days-until-old' group\n")) (insert "parameter to the value associated with the regular expression.\n") (insert "\n") diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el index f9c89f5..6930616 100644 --- a/lisp/gnus/mail-source.el +++ b/lisp/gnus/mail-source.el @@ -612,7 +612,7 @@ If CONFIRM is non-nil, ask for confirmation before removing a file." (when (and (> (- currday fileday) diff) (if confirm (y-or-n-p - (gnus-format-message "\ + (format-message "\ Delete old (> %s day(s)) incoming mail file `%s'? " diff bfile)) (gnus-message 8 "\ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 609c42d..3ed359b 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -2188,7 +2188,7 @@ contains a valid encoded word. Decode again? " (unless cs-coding (setq cs-coding (mm-read-coding-system - (gnus-format-message "\ + (format-message "\ Decoded Subject \"%s\" contains an encoded word. The charset `%s' is unknown or invalid. Hit RET to replace non-decodable characters with \"%s\" or enter replacement @@ -4459,7 +4459,7 @@ This function could be useful in `message-setup-hook'." (dolist (bog (message-bogus-recipient-p addr)) (and bog (not (y-or-n-p - (gnus-format-message + (format-message "Address `%s'%s might be bogus. Continue? " bog ;; If the encoded version of the email address @@ -8482,7 +8482,7 @@ Header and body are separated by `mail-header-separator'." (when force (sit-for message-send-form-letter-delay)) (if (or force - (y-or-n-p (gnus-format-message "Send message to `%s'? " to))) + (y-or-n-p (format-message "Send message to `%s'? " to))) (progn (setq sent (1+ sent)) (message-send-and-exit)) diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 4df653c..810560a 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -860,7 +860,7 @@ external if displayed external." (concat "using external program \"" (format method filename) "\"") - (gnus-format-message + (format-message "by calling `%s' on the contents)" method)) "? ")))))) (if external diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el index 4197b2a..a5b06b2 100644 --- a/lisp/gnus/mm-uu.el +++ b/lisp/gnus/mm-uu.el @@ -523,7 +523,7 @@ apply the face `mm-uu-extract'." (when (and mml2015-use (null (mml2015-clear-verify-function))) (mm-set-handle-multipart-parameter mm-security-handle 'gnus-details - (gnus-format-message + (format-message "Clear verification not supported by `%s'.\n" mml2015-use))) (mml2015-extract-cleartext-signature)) (list (mm-make-handle buf mm-uu-text-plain-type))))) diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el index 248e636..407963f 100644 --- a/lisp/gnus/mml-smime.el +++ b/lisp/gnus/mml-smime.el @@ -216,7 +216,7 @@ Whether the passphrase is cached at all is controlled by ""))))) (if (setq cert (smime-cert-by-dns who)) (setq result (list 'certfile (buffer-name cert))) - (setq bad (gnus-format-message "`%s' not found. " who)))) + (setq bad (format-message "`%s' not found. " who)))) (quit)) result)) @@ -235,7 +235,7 @@ Whether the passphrase is cached at all is controlled by ""))))) (if (setq cert (smime-cert-by-ldap who)) (setq result (list 'certfile (buffer-name cert))) - (setq bad (gnus-format-message "`%s' not found. " who)))) + (setq bad (format-message "`%s' not found. " who)))) (quit)) result)) diff --git a/lisp/gnus/spam-report.el b/lisp/gnus/spam-report.el index 7ebff19..722186e 100644 --- a/lisp/gnus/spam-report.el +++ b/lisp/gnus/spam-report.el @@ -307,7 +307,7 @@ symbol `ask', query before flushing the queue file." (if (or (eq keep nil) (and (eq keep 'ask) (y-or-n-p - (gnus-format-message + (format-message "Flush requests from `%s'? " (current-buffer))))) (progn (gnus-message 7 "Flushing request file `%s'" commit fd8d344fc9164accd2d69683f8aee32b2a87b647 Author: Lars Ingebrigtsen Date: Thu Feb 11 16:39:23 2016 +1100 Remove more XEmacs compat functions from Gnus * lisp/gnus/gnus-util.el (gnus-next-char-property-change): Remove. (gnus-previous-char-property-change): Remove. (gnus-graphic-display-p): Remove. (gnus-select-frame-set-input-focus): Remove. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 12f90bf..c4f6823 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -5540,7 +5540,7 @@ If INTERACTIVE, call FUNCTION interactively." window (setq window (selected-window)) ;; Article may be displayed in the other frame. - (gnus-select-frame-set-input-focus + (select-frame-set-input-focus (prog1 frame (setq frame (selected-frame)))))) @@ -5568,7 +5568,7 @@ If INTERACTIVE, call FUNCTION interactively." (get-text-property (point) 'gnus-data)))) (set-marker overlay-arrow-position nil) (unless gnus-auto-select-part - (gnus-select-frame-set-input-focus frame) + (select-frame-set-input-focus frame) (select-window window)))) t)) (if gnus-inhibit-mime-unbuttonizing @@ -6760,7 +6760,7 @@ not have a face in `gnus-article-boring-faces'." (article 1.0))))))) (gnus-configure-windows 'article)) (setq win (get-buffer-window summary-buffer 'visible))) - (gnus-select-frame-set-input-focus (window-frame win)) + (select-frame-set-input-focus (window-frame win)) (select-window win)))) (setq in-buffer (current-buffer)) ;; We disable the pick minor mode commands. diff --git a/lisp/gnus/gnus-draft.el b/lisp/gnus/gnus-draft.el index 7a52266..f5299be 100644 --- a/lisp/gnus/gnus-draft.el +++ b/lisp/gnus/gnus-draft.el @@ -317,7 +317,7 @@ If DONT-POP is nil, display the buffer after setting it up." (let* ((window (get-buffer-window buff t)) (frame (and window (window-frame window)))) (if frame - (gnus-select-frame-set-input-focus frame) + (select-frame-set-input-focus frame) (pop-to-buffer buff t))) (error "The draft %s is under edit" file))))) diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index 23b8836..f427610 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el @@ -444,7 +444,7 @@ Return a string with image data." (defun gnus-html-put-image (data url &optional alt-text) "Put an image with DATA from URL and optional ALT-TEXT." - (when (gnus-graphic-display-p) + (when (display-graphic-p) (let* ((start (text-property-any (point-min) (point-max) 'image-url url)) (end (when start diff --git a/lisp/gnus/gnus-notifications.el b/lisp/gnus/gnus-notifications.el index 5a116cc..d0b0202 100644 --- a/lisp/gnus/gnus-notifications.el +++ b/lisp/gnus/gnus-notifications.el @@ -81,7 +81,7 @@ not get notifications." (article (nth 2 group-article))) (cond ((string= key "read") (gnus-fetch-group group (list article)) - (gnus-select-frame-set-input-focus (selected-frame))) + (select-frame-set-input-focus (selected-frame))) ((string= key "mark-read") (gnus-update-read-articles group diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 68f5e5e..5eb89b7 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -6836,7 +6836,7 @@ Like forward-line, but skip over (and don't count) invisible lines." ;; If the following character is currently invisible, ;; skip all characters with that same `invisible' property value. (while (invisible-p (point)) - (goto-char (gnus-next-char-property-change (point)))) + (goto-char (next-char-property-change (point)))) (forward-line 1) (if (eobp) (setq done t) @@ -6846,7 +6846,7 @@ Like forward-line, but skip over (and don't count) invisible lines." (if (bobp) (setq done t) (setq n (1+ n)) (while (and (not (bobp)) (invisible-p (1- (point)))) - (goto-char (gnus-previous-char-property-change (point)))))))) + (goto-char (previous-char-property-change (point)))))))) (defun gnus-summary-recenter () "Center point in the summary window. diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 5545afd..49a0061 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -850,18 +850,6 @@ Otherwise, return the value." (overlay-get overlay 'face)) (overlays-at pos)))))) -;; Note: the optional 2nd argument has a different meaning between -;; Emacs and XEmacs. -;; (next-char-property-change POSITION &optional LIMIT) -;; (next-extent-change POS &optional OBJECT) -(defalias 'gnus-next-char-property-change - (if (fboundp 'next-extent-change) - 'next-extent-change 'next-char-property-change)) - -(defalias 'gnus-previous-char-property-change - (if (fboundp 'previous-extent-change) - 'previous-extent-change 'previous-char-property-change)) - ;;; Protected and atomic operations. dmoore@ucsd.edu 21.11.1996 ;; The primary idea here is to try to protect internal data structures ;; from becoming corrupted when the user hits C-g, or if a hook or @@ -939,16 +927,8 @@ with potentially long computations." ;;; Functions for saving to babyl/mail files. -(eval-when-compile - (if (featurep 'xemacs) - ;; Don't load tm and apel XEmacs packages that provide some - ;; Emacs emulating functions and variables. - (let ((features features)) - (provide 'tm-view) - (unless (fboundp 'set-alist) (defalias 'set-alist 'ignore)) - (require 'rmail)) ;; It requires tm-view that loads apel. - (require 'rmail)) - (autoload 'rmail-update-summary "rmailsum")) +(require 'rmail) +(autoload 'rmail-update-summary "rmailsum") (defvar mm-text-coding-system) @@ -1387,10 +1367,6 @@ is run." "Byte-compile FORM if `gnus-use-byte-compile' is non-nil." (if gnus-use-byte-compile (progn - (condition-case nil - ;; Work around a bug in XEmacs 21.4 - (require 'byte-optimize) - (error)) (require 'bytecomp) (defalias 'gnus-byte-compile (lambda (form) @@ -1493,16 +1469,7 @@ SPEC is a predicate specifier that contains stuff like `or', `and', initial-input history def) "Call standard `completing-read-function'." (let ((completion-styles gnus-completion-styles)) - (completing-read prompt - (if (featurep 'xemacs) - ;; Old XEmacs (at least 21.4) expect an alist, - ;; in which the car of each element is a string, - ;; for collection. - (mapcar - (lambda (elem) - (list (format "%s" (or (car-safe elem) elem)))) - collection) - collection) + (completing-read prompt collection nil require-match initial-input history def))) (autoload 'ido-completing-read "ido") @@ -1543,11 +1510,6 @@ SPEC is a predicate specifier that contains stuff like `or', `and', (or iswitchb-mode (remove-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup))))) -(defun gnus-graphic-display-p () - (if (featurep 'xemacs) - (device-on-window-system-p) - (display-graphic-p))) - (put 'gnus-parse-without-error 'lisp-indent-function 0) (put 'gnus-parse-without-error 'edebug-form-spec '(body)) @@ -1628,31 +1590,18 @@ CHOICE is a list of the choice char and help message at IDX." (kill-buffer buf)) tchar)) -(if (featurep 'emacs) - (defalias 'gnus-select-frame-set-input-focus 'select-frame-set-input-focus) - (if (fboundp 'select-frame-set-input-focus) - (defalias 'gnus-select-frame-set-input-focus 'select-frame-set-input-focus) - ;; XEmacs 21.4, SXEmacs - (defun gnus-select-frame-set-input-focus (frame) - "Select FRAME, raise it, and set input focus, if possible." - (raise-frame frame) - (select-frame frame) - (focus-frame frame)))) - (defun gnus-frame-or-window-display-name (object) "Given a frame or window, return the associated display name. Return nil otherwise." - (if (featurep 'xemacs) - (device-connection (dfw-device object)) - (if (or (framep object) - (and (windowp object) - (setq object (window-frame object)))) - (let ((display (frame-parameter object 'display))) - (if (and (stringp display) - ;; Exclude invalid display names. - (string-match "\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" - display)) - display))))) + (if (or (framep object) + (and (windowp object) + (setq object (window-frame object)))) + (let ((display (frame-parameter object 'display))) + (if (and (stringp display) + ;; Exclude invalid display names. + (string-match "\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" + display)) + display)))) (defvar tool-bar-mode) @@ -1661,9 +1610,7 @@ Return nil otherwise." (when (and (boundp 'tool-bar-mode) tool-bar-mode) (let* ((args nil) - (func (cond ((featurep 'xemacs) - 'ignore) - ((fboundp 'tool-bar-update) + (func (cond ((fboundp 'tool-bar-update) 'tool-bar-update) ((fboundp 'force-window-update) 'force-window-update) @@ -1723,10 +1670,6 @@ predicate on the elements." (push (pop list1) res))) (nconc (nreverse res) list1 list2)))) -(defvar xemacs-codename) -(defvar sxemacs-codename) -(defvar emacs-program-version) - (defun gnus-emacs-version () "Stringified Emacs version." (let* ((lst (if (listp gnus-user-agent) @@ -1737,37 +1680,15 @@ predicate on the elements." ((memq 'type lst) (symbol-name system-type)) (t nil))) - codename emacsname) - (cond ((featurep 'sxemacs) - (setq emacsname "SXEmacs" - codename sxemacs-codename)) - ((featurep 'xemacs) - (setq emacsname "XEmacs" - codename xemacs-codename)) - (t - (setq emacsname "Emacs"))) + codename) (cond ((not (memq 'emacs lst)) nil) ((string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version) - ;; Emacs: (concat "Emacs/" (match-string 1 emacs-version) (if system-v (concat " (" system-v ")") ""))) - ((or (featurep 'sxemacs) (featurep 'xemacs)) - ;; XEmacs or SXEmacs: - (concat emacsname "/" emacs-program-version - (let (plst) - (when (memq 'codename lst) - (push codename plst)) - (when system-v - (push system-v plst)) - (unless (featurep 'mule) - (push "no MULE" plst)) - (when (> (length plst) 0) - (concat - " (" (mapconcat 'identity (reverse plst) ", ") ")"))))) (t emacs-version)))) (defun gnus-rename-file (old-path new-path &optional trim) diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el index b1498fd..2c448aa 100644 --- a/lisp/gnus/gnus-win.el +++ b/lisp/gnus/gnus-win.el @@ -429,7 +429,7 @@ See the Gnus manual for an explanation of the syntax used.") (gnus-configure-frame split) (run-hooks 'gnus-configure-windows-hook) (when gnus-window-frame-focus - (gnus-select-frame-set-input-focus + (select-frame-set-input-focus (window-frame gnus-window-frame-focus))))))))) (defun gnus-delete-windows-in-gnusey-frames () diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 3d6b44c85..661f483 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -4382,12 +4382,12 @@ current display is used." (with-current-buffer (window-buffer window) (string-match "\\`gnus-" (symbol-name major-mode)))) - (gnus-select-frame-set-input-focus + (select-frame-set-input-focus (setq gnus-other-frame-object (window-frame window))) (select-window window) (throw 'found t))) 'ignore t))) - (gnus-select-frame-set-input-focus + (select-frame-set-input-focus (setq gnus-other-frame-object (if display (make-frame-on-display display gnus-other-frame-parameters) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 6621e5a..609c42d 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -1943,7 +1943,6 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'." (autoload 'gnus-output-to-mail "gnus-util") (autoload 'gnus-output-to-rmail "gnus-util") (autoload 'gnus-request-post "gnus-int") -(autoload 'gnus-select-frame-set-input-focus "gnus-util") (autoload 'gnus-server-string "gnus") (autoload 'idna-to-ascii "idna") (autoload 'message-setup-toolbar "messagexmas") @@ -6486,7 +6485,7 @@ moved to the beginning " (if window ;; Raise the frame already displaying the message buffer. (progn - (gnus-select-frame-set-input-focus (window-frame window)) + (select-frame-set-input-focus (window-frame window)) (select-window window)) (funcall (or switch-function #'pop-to-buffer) buffer) (set-buffer buffer)) diff --git a/lisp/gnus/smiley.el b/lisp/gnus/smiley.el index 403447f..0a9af9e 100644 --- a/lisp/gnus/smiley.el +++ b/lisp/gnus/smiley.el @@ -179,7 +179,7 @@ regexp to replace with IMAGE. IMAGE is the name of an image file in "Replace in the region `smiley-regexp-alist' matches with corresponding images. A list of images is returned." (interactive "r") - (when (gnus-graphic-display-p) + (when (display-graphic-p) (unless smiley-cached-regexp-alist (smiley-update-cache)) (save-excursion commit e91b75de10881c1bb8b0f4cc14f35c68563dc356 Author: Lars Ingebrigtsen Date: Thu Feb 11 16:24:02 2016 +1100 Remove more XEmacs compat code from gnus-util * lisp/gnus/gnus-util.el (gnus-make-local-hook): Remove (and all its usages). (gnus-invisible-p): Remove. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 80ffaea..68f5e5e 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -6835,7 +6835,7 @@ Like forward-line, but skip over (and don't count) invisible lines." (while (and (> n 0) (not done)) ;; If the following character is currently invisible, ;; skip all characters with that same `invisible' property value. - (while (gnus-invisible-p (point)) + (while (invisible-p (point)) (goto-char (gnus-next-char-property-change (point)))) (forward-line 1) (if (eobp) @@ -6845,7 +6845,7 @@ Like forward-line, but skip over (and don't count) invisible lines." (forward-line -1) (if (bobp) (setq done t) (setq n (1+ n)) - (while (and (not (bobp)) (gnus-invisible-p (1- (point)))) + (while (and (not (bobp)) (invisible-p (1- (point)))) (goto-char (gnus-previous-char-property-change (point)))))))) (defun gnus-summary-recenter () diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 6b49fc2..5545afd 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -306,13 +306,6 @@ Symbols are also allowed; their print names are used instead." (defmacro gnus-define-keys (keymap &rest plist) "Define all keys in PLIST in KEYMAP." - ;; Convert the key [?\S-\ ] to [(shift space)] for XEmacs. - (when (featurep 'xemacs) - (let ((bindings plist)) - (while bindings - (when (equal (car bindings) [?\S-\ ]) - (setcar bindings [(shift space)])) - (setq bindings (cddr bindings))))) `(gnus-define-keys-1 (quote ,keymap) (quote ,plist))) (defmacro gnus-define-keys-safe (keymap &rest plist) @@ -445,10 +438,10 @@ jabbering all the time." (defcustom gnus-add-timestamp-to-message nil "Non-nil means add timestamps to messages that Gnus issues. -If it is `log', add timestamps to only the messages that go into the -\"*Messages*\" buffer (in XEmacs, it is the \" *Message-Log*\" buffer). -If it is neither nil nor `log', add timestamps not only to log messages -but also to the ones displayed in the echo area." +If it is `log', add timestamps to only the messages that go into +the \"*Messages*\" buffer. If it is neither nil nor `log', add +timestamps not only to log messages but also to the ones +displayed in the echo area." :version "23.1" ;; No Gnus :group 'gnus-various :type '(choice :format "%{%t%}:\n %[Value Menu%] %v" @@ -461,56 +454,37 @@ but also to the ones displayed in the echo area." (eval-when-compile (defmacro gnus-message-with-timestamp-1 (format-string args) (let ((timestamp '(format-time-string "%Y%m%dT%H%M%S.%3N> " time))) - (if (featurep 'xemacs) - `(let (str time) - (if (or (and (null ,format-string) (null ,args)) - (progn - (setq str (apply 'format ,format-string ,args)) - (zerop (length str)))) - (prog1 - (and ,format-string str) - (clear-message nil)) - (cond ((eq gnus-add-timestamp-to-message 'log) - (setq time (current-time)) - (display-message 'no-log str) - (log-message 'message (concat ,timestamp str))) - (gnus-add-timestamp-to-message - (setq time (current-time)) - (display-message 'message (concat ,timestamp str))) - (t - (display-message 'message str)))) - str) - `(let (str time) - (cond ((eq gnus-add-timestamp-to-message 'log) - (setq str (let (message-log-max) - (apply 'message ,format-string ,args))) - (when (and message-log-max - (> message-log-max 0) - (/= (length str) 0)) - (setq time (current-time)) - (with-current-buffer (if (fboundp 'messages-buffer) - (messages-buffer) - (get-buffer-create "*Messages*")) - (goto-char (point-max)) - (let ((inhibit-read-only t)) - (insert ,timestamp str "\n") - (forward-line (- message-log-max)) - (delete-region (point-min) (point))) - (goto-char (point-max)))) - str) - (gnus-add-timestamp-to-message - (if (or (and (null ,format-string) (null ,args)) - (progn - (setq str (apply 'format ,format-string ,args)) - (zerop (length str)))) - (prog1 - (and ,format-string str) - (message nil)) - (setq time (current-time)) - (message "%s" (concat ,timestamp str)) - str)) - (t - (apply 'message ,format-string ,args)))))))) + `(let (str time) + (cond ((eq gnus-add-timestamp-to-message 'log) + (setq str (let (message-log-max) + (apply 'message ,format-string ,args))) + (when (and message-log-max + (> message-log-max 0) + (/= (length str) 0)) + (setq time (current-time)) + (with-current-buffer (if (fboundp 'messages-buffer) + (messages-buffer) + (get-buffer-create "*Messages*")) + (goto-char (point-max)) + (let ((inhibit-read-only t)) + (insert ,timestamp str "\n") + (forward-line (- message-log-max)) + (delete-region (point-min) (point))) + (goto-char (point-max)))) + str) + (gnus-add-timestamp-to-message + (if (or (and (null ,format-string) (null ,args)) + (progn + (setq str (apply 'format ,format-string ,args)) + (zerop (length str)))) + (prog1 + (and ,format-string str) + (message nil)) + (setq time (current-time)) + (message "%s" (concat ,timestamp str)) + str)) + (t + (apply 'message ,format-string ,args))))))) (defvar gnus-action-message-log nil) @@ -626,7 +600,6 @@ If N, return the Nth ancestor instead." (defun gnus-read-event-char (&optional prompt) "Get the next event." (let ((event (read-event prompt))) - ;; should be gnus-characterp, but this can't be called in XEmacs anyway (cons (and (numberp event) event) event))) (defun gnus-copy-file (file &optional to) @@ -870,27 +843,12 @@ Otherwise, return the value." (defmacro gnus-faces-at (position) "Return a list of faces at POSITION." - (if (featurep 'xemacs) - `(let ((pos ,position)) - (mapcar-extents 'extent-face - nil (current-buffer) pos pos nil 'face)) - `(let ((pos ,position)) - (delq nil (cons (get-text-property pos 'face) - (mapcar - (lambda (overlay) - (overlay-get overlay 'face)) - (overlays-at pos))))))) - -(if (fboundp 'invisible-p) - (defalias 'gnus-invisible-p 'invisible-p) - ;; for Emacs < 22.2, and XEmacs. - (defun gnus-invisible-p (pos) - "Return non-nil if the character after POS is currently invisible." - (let ((prop (get-char-property pos 'invisible))) - (if (eq buffer-invisibility-spec t) - prop - (or (memq prop buffer-invisibility-spec) - (assq prop buffer-invisibility-spec)))))) + `(let ((pos ,position)) + (delq nil (cons (get-text-property pos 'face) + (mapcar + (lambda (overlay) + (overlay-get overlay 'face)) + (overlays-at pos)))))) ;; Note: the optional 2nd argument has a different meaning between ;; Emacs and XEmacs. commit d4680232fbf3b28a6b37356241456a7c102b2273 Author: Lars Ingebrigtsen Date: Thu Feb 11 16:15:43 2016 +1100 Remove gnus-make-local-hook * lisp/gnus/gnus-util.el (gnus-make-local-hook): Remove (and all its usages). diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index f16a4c6..12f90bf 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -5010,7 +5010,6 @@ and `gnus-mime-delete-part', and not provided at run-time normally." (let ((mbl1 mml-buffer-list)) (setq mml-buffer-list mbl) (set (make-local-variable 'mml-buffer-list) mbl1)) - (gnus-make-local-hook 'kill-buffer-hook) (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t))) `(lambda (no-highlight) (let ((mail-parse-charset (or gnus-article-charset diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 5bf0f7c..527735f 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -495,8 +495,6 @@ Thank you for your help in stamping out bugs. (let ((mbl1 mml-buffer-list)) (setq mml-buffer-list mbl) ;; Global value (set (make-local-variable 'mml-buffer-list) mbl1);; Local value - (gnus-make-local-hook 'kill-buffer-hook) - (gnus-make-local-hook 'change-major-mode-hook) (add-hook 'change-major-mode-hook 'mml-destroy-buffers nil t) (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)) (mml-destroy-buffers) @@ -593,11 +591,9 @@ instead." (defun gnus-inews-add-send-actions (winconf buffer article &optional config yanked winconf-name) - (gnus-make-local-hook 'message-sent-hook) (add-hook 'message-sent-hook (if gnus-agent 'gnus-agent-possibly-do-gcc 'gnus-inews-do-gcc) nil t) (when gnus-agent - (gnus-make-local-hook 'message-header-hook) (add-hook 'message-header-hook 'gnus-agent-possibly-save-gcc nil t)) (setq message-post-method `(lambda (&optional arg) @@ -1953,7 +1949,6 @@ this is a reply." (setq name (assq 'name results) address (assq 'address results)) (setq results (delq name (delq address results))) - (gnus-make-local-hook 'message-setup-hook) (setq results (sort results (lambda (x y) (string-lessp (car x) (car y))))) (dolist (result results) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index a8a4c3f..80ffaea 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -3091,7 +3091,6 @@ The following commands are available: (make-local-variable 'gnus-summary-dummy-line-format) (make-local-variable 'gnus-summary-dummy-line-format-spec) (make-local-variable 'gnus-summary-mark-positions) - (gnus-make-local-hook 'pre-command-hook) (add-hook 'pre-command-hook 'gnus-set-global-variables nil t) (gnus-run-mode-hooks 'gnus-summary-mode-hook) (turn-on-gnus-mailing-list-mode) @@ -10542,7 +10541,6 @@ groups." (let ((mbl1 mml-buffer-list)) (setq mml-buffer-list mbl) (set (make-local-variable 'mml-buffer-list) mbl1)) - (gnus-make-local-hook 'kill-buffer-hook) (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)))) `(lambda (no-highlight) (let ((mail-parse-charset ',gnus-newsgroup-charset) diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el index c5a1777..1245b96 100644 --- a/lisp/gnus/gnus-topic.el +++ b/lisp/gnus/gnus-topic.el @@ -1150,7 +1150,6 @@ articles in the topic and its subtopics." 'gnus-group-sort-topic) (setq gnus-group-change-level-function 'gnus-topic-change-level) (setq gnus-goto-missing-group-function 'gnus-topic-goto-missing-group) - (gnus-make-local-hook 'gnus-check-bogus-groups-hook) (add-hook 'gnus-check-bogus-groups-hook 'gnus-topic-clean-alist nil 'local) (setq gnus-topology-checked-p nil) diff --git a/lisp/gnus/gnus-undo.el b/lisp/gnus/gnus-undo.el index 8206b52..ad27e89 100644 --- a/lisp/gnus/gnus-undo.el +++ b/lisp/gnus/gnus-undo.el @@ -108,7 +108,6 @@ ;; Set up the menu. (when (gnus-visual-p 'undo-menu 'menu) (gnus-undo-make-menu-bar)) - (gnus-make-local-hook 'post-command-hook) (add-hook 'post-command-hook 'gnus-undo-boundary nil t))) ;;; Interface functions. diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 950bb7f..6b49fc2 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -129,14 +129,6 @@ This is a compatibility function for different Emacsen." (funcall (if (stringp buffer) 'get-buffer 'buffer-name) buffer)))) -;; The LOCAL arg to `add-hook' is interpreted differently in Emacs and -;; XEmacs. In Emacs we don't need to call `make-local-hook' first. -;; It's harmless, though, so the main purpose of this alias is to shut -;; up the byte compiler. -(defalias 'gnus-make-local-hook (if (featurep 'xemacs) - 'make-local-hook - 'ignore)) - (defun gnus-delete-first (elt list) "Delete by side effect the first occurrence of ELT as a member of LIST." (if (equal (car list) elt) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 11c1012..6621e5a 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -1939,7 +1939,6 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'." (autoload 'gnus-group-name-charset "gnus-group") (autoload 'gnus-group-name-decode "gnus-group") (autoload 'gnus-groups-from-server "gnus") -(autoload 'gnus-make-local-hook "gnus-util") (autoload 'gnus-open-server "gnus-int") (autoload 'gnus-output-to-mail "gnus-util") (autoload 'gnus-output-to-rmail "gnus-util") @@ -3037,7 +3036,6 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." (set (make-local-variable 'tool-bar-map) (message-make-tool-bar)))) (easy-menu-add message-mode-menu message-mode-map) (easy-menu-add message-mode-field-menu message-mode-map) - (gnus-make-local-hook 'after-change-functions) ;; Mmmm... Forbidden properties... (add-hook 'after-change-functions 'message-strip-forbidden-properties nil 'local) diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index c748e8e..ac84fbf 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -35,7 +35,6 @@ (autoload 'message-make-message-id "message") (declare-function gnus-setup-posting-charset "gnus-msg" (group)) -(autoload 'gnus-make-local-hook "gnus-util") (autoload 'gnus-completing-read "gnus-util") (autoload 'message-fetch-field "message") (autoload 'message-mark-active-p "message") @@ -1590,7 +1589,6 @@ or the `pop-to-buffer' function." (gnus-article-prepare-display)))) ;; Disable article-mode-map. (use-local-map nil) - (gnus-make-local-hook 'kill-buffer-hook) (add-hook 'kill-buffer-hook (lambda () (mm-destroy-parts gnus-article-mime-handles)) nil t) diff --git a/lisp/gnus/nndraft.el b/lisp/gnus/nndraft.el index 5f57dd2..f6c62c8 100644 --- a/lisp/gnus/nndraft.el +++ b/lisp/gnus/nndraft.el @@ -206,9 +206,7 @@ are generated if and only if they are also in `message-draft-headers'.") (let ((hook (if (boundp 'write-contents-functions) 'write-contents-functions 'write-contents-hooks))) - (gnus-make-local-hook hook) (add-hook hook 'nndraft-generate-headers nil t)) - (gnus-make-local-hook 'after-save-hook) (add-hook 'after-save-hook 'nndraft-update-unread-articles nil t) (message-add-action '(nndraft-update-unread-articles) 'exit 'postpone 'kill) commit 21cfd14d54370cddc1160d30bc47e17c5ac3a162 Author: Lars Ingebrigtsen Date: Thu Feb 11 16:13:08 2016 +1100 gnus-replace-in-string -> replace-regexp-in-string * lisp/gnus/gnus-util.el (gnus-replace-in-string): Declare obsolete. Transform all usages of it into replace-regexp-in-string. * lisp/gnus/mailcap.el (mailcap-replace-in-string): Remove. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 5a27bf8..f16a4c6 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -7522,7 +7522,7 @@ address, `ask' if unsure and `invalid' if the string is invalid." (list gnus-button-mid-or-mail-heuristic-alist) (result 0) rate regexp lpartlen elem) (setq lpartlen - (length (gnus-replace-in-string mid-or-mail "^\\(.*\\)@.*$" "\\1"))) + (length (replace-regexp-in-string mid-or-mail "^\\(.*\\)@.*$" "\\1"))) (gnus-message 8 "`%s', length of local part=`%s'." mid-or-mail lpartlen) ;; Certain special cases... (when (string-match @@ -7593,7 +7593,7 @@ address, `ask' if unsure and `invalid' if the string is invalid." (setq guessed ;; get rid of surrounding angles... (funcall pref - (gnus-replace-in-string mid-or-mail "^<\\|>$" ""))) + (replace-regexp-in-string mid-or-mail "^<\\|>$" ""))) (if (or (eq 'mid guessed) (eq 'mail guessed)) (setq pref guessed) (setq pref 'ask))) @@ -7625,13 +7625,13 @@ as a symbol to FUN." "Call `describe-function' when pushing the corresponding URL button." (describe-function (intern - (gnus-replace-in-string url gnus-button-handle-describe-prefix "")))) + (replace-regexp-in-string url gnus-button-handle-describe-prefix "")))) (defun gnus-button-handle-describe-variable (url) "Call `describe-variable' when pushing the corresponding URL button." (describe-variable (intern - (gnus-replace-in-string url gnus-button-handle-describe-prefix "")))) + (replace-regexp-in-string url gnus-button-handle-describe-prefix "")))) (defun gnus-button-handle-symbol (url) "Display help on variable or function. @@ -7645,7 +7645,7 @@ Calls `describe-variable' or `describe-function'." (defun gnus-button-handle-describe-key (url) "Call `describe-key' when pushing the corresponding URL button." (let* ((key-string - (gnus-replace-in-string url gnus-button-handle-describe-prefix "")) + (replace-regexp-in-string url gnus-button-handle-describe-prefix "")) (keys (ignore-errors (eval `(kbd ,key-string))))) (if keys (describe-key keys) @@ -7653,30 +7653,31 @@ Calls `describe-variable' or `describe-function'." (defun gnus-button-handle-apropos (url) "Call `apropos' when pushing the corresponding URL button." - (apropos (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))) + (apropos (replace-regexp-in-string + url gnus-button-handle-describe-prefix ""))) (defun gnus-button-handle-apropos-command (url) "Call `apropos' when pushing the corresponding URL button." (apropos-command - (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))) + (replace-regexp-in-string url gnus-button-handle-describe-prefix ""))) (defun gnus-button-handle-apropos-variable (url) "Call `apropos' when pushing the corresponding URL button." (funcall (if (fboundp 'apropos-variable) 'apropos-variable 'apropos) - (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))) + (replace-regexp-in-string url gnus-button-handle-describe-prefix ""))) (defun gnus-button-handle-apropos-documentation (url) "Call `apropos' when pushing the corresponding URL button." (funcall (if (fboundp 'apropos-documentation) 'apropos-documentation 'apropos) - (gnus-replace-in-string url gnus-button-handle-describe-prefix ""))) + (replace-regexp-in-string url gnus-button-handle-describe-prefix ""))) (defun gnus-button-handle-library (url) "Call `locate-library' when pushing the corresponding URL button." (gnus-message 9 "url=`%s'" url) (let* ((lib (locate-library url)) - (file (gnus-replace-in-string (or lib "") "\\.elc" ".el"))) + (file (replace-regexp-in-string (or lib "") "\\.elc" ".el"))) (if (not lib) (gnus-message 1 "Cannot locale library `%s'." url) (find-file-read-only file)))) @@ -8274,7 +8275,7 @@ url is put as the `gnus-button-url' overlay property on the button." "Fetch a man page." (gnus-message 9 "`%s' `%s'" gnus-button-man-handler url) (when (eq gnus-button-man-handler 'woman) - (setq url (gnus-replace-in-string url "([1-9][X1a-z]*).*\\'" ""))) + (setq url (replace-regexp-in-string url "([1-9][X1a-z]*).*\\'" ""))) (gnus-message 9 "`%s' `%s'" gnus-button-man-handler url) (funcall gnus-button-man-handler url)) @@ -8289,8 +8290,8 @@ url is put as the `gnus-button-url' overlay property on the button." ")" (gnus-url-unhex-string (match-string 2 url))))) ((string-match "([^)\"]+)[^\"]+" url) (setq url - (gnus-replace-in-string - (gnus-replace-in-string url "[\n\t ]+" " ") "\"" "")) + (replace-regexp-in-string + (replace-regexp-in-string url "[\n\t ]+" " ") "\"" "")) (gnus-info-find-node url)) (t (error "Can't parse %s" url)))) @@ -8428,7 +8429,7 @@ url is put as the `gnus-button-url' overlay property on the button." (if (fboundp func) (funcall func) (message-position-on-field (caar args))) - (insert (gnus-replace-in-string + (insert (replace-regexp-in-string (mapconcat 'identity (reverse (cdar args)) ", ") "\r\n" "\n" t)) (setq args (cdr args))) diff --git a/lisp/gnus/gnus-bookmark.el b/lisp/gnus/gnus-bookmark.el index a16ac53..cb3de92 100644 --- a/lisp/gnus/gnus-bookmark.el +++ b/lisp/gnus/gnus-bookmark.el @@ -226,7 +226,7 @@ So the cdr of each bookmark is an alist too.") "-" (car subject) "-" (cadr subject))) (default-name-1 ;; Strip "[]" chars from the bookmark name: - (gnus-replace-in-string default-name-0 "[]_[]" "")) + (replace-regexp-in-string default-name-0 "[]_[]" "")) (name (read-from-minibuffer (format "Set bookmark (%s): " default-name-1) nil nil nil nil diff --git a/lisp/gnus/gnus-gravatar.el b/lisp/gnus/gnus-gravatar.el index 77fce25..28caed2 100644 --- a/lisp/gnus/gnus-gravatar.el +++ b/lisp/gnus/gnus-gravatar.el @@ -94,7 +94,7 @@ Set image category to CATEGORY." (mail-address (cadr address))) (when (if real-name (re-search-forward - (concat (gnus-replace-in-string + (concat (replace-regexp-in-string (regexp-quote real-name) "[\t ]+" "[\t\n ]+") "\\|" (regexp-quote mail-address)) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 838e747..190acf1 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -2218,7 +2218,7 @@ if it is not a list." (setq group (mm-encode-coding-string group (gnus-group-name-charset nil group)))) - (gnus-replace-in-string group "\n" ""))) + (replace-regexp-in-string group "\n" ""))) ;;;###autoload (defun gnus-fetch-group (group &optional articles) @@ -2476,8 +2476,8 @@ the bug number, and browsing the URL must return mbox output." (while (re-search-forward "^To: " nil t) (end-of-line) (insert (format ", %s@%s" (car ids) - (gnus-replace-in-string - (gnus-replace-in-string mbox-url "^http://" "") + (replace-regexp-in-string + (replace-regexp-in-string mbox-url "^http://" "") "/.*$" "")))))) (gnus-group-read-ephemeral-group (format "nndoc+ephemeral:bug#%s" diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 8f0dbfd..5bf0f7c 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1138,7 +1138,7 @@ See the variable `gnus-user-agent'." (gnus-v (when (memq 'gnus gnus-user-agent) (concat "Gnus/" - (gnus-replace-in-string + (replace-regexp-in-string (format "%1.8f" (gnus-continuum-version gnus-version)) "0+\\'" "") " (" gnus-version ")"))) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index b85a403..a8a4c3f 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9086,7 +9086,7 @@ non-numeric or nil fetch the number specified by the (gnus-warp-to-article) (when (and (stringp message-id) (not (zerop (length message-id)))) - (setq message-id (gnus-replace-in-string message-id " " "")) + (setq message-id (replace-regexp-in-string message-id " " "")) ;; Construct the correct Message-ID if necessary. ;; Suggested by tale@pawl.rpi.edu. (unless (string-match "^<" message-id) @@ -9564,10 +9564,10 @@ article. If BACKWARD (the prefix) is non-nil, search backward instead." (defun gnus-summary-print-truncate-and-quote (string &optional len) "Truncate to LEN and quote all \"(\"'s in STRING." - (gnus-replace-in-string (if (and len (> (length string) len)) - (substring string 0 len) - string) - "[()]" "\\\\\\&")) + (replace-regexp-in-string (if (and len (> (length string) len)) + (substring string 0 len) + string) + "[()]" "\\\\\\&")) (defun gnus-summary-print-article (&optional filename n) "Generate and print a PostScript image of the process-marked (mail) articles. diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index a883de9..950bb7f 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -78,23 +78,14 @@ (autoload 'nnheader-replace-chars-in-string "nnheader") (autoload 'mail-header-remove-comments "mail-parse") -(eval-and-compile - (cond - ;; Prefer `replace-regexp-in-string' (present in Emacs, XEmacs 21.5, - ;; SXEmacs 22.1.4) over `replace-in-string'. The latter leads to inf-loops - ;; on empty matches: - ;; (replace-in-string "foo" "/*$" "/") - ;; (replace-in-string "xe" "\\(x\\)?" "") - ((fboundp 'replace-regexp-in-string) - (defun gnus-replace-in-string (string regexp newtext &optional literal) - "Replace all matches for REGEXP with NEWTEXT in STRING. +(defun gnus-replace-in-string (string regexp newtext &optional literal) + "Replace all matches for REGEXP with NEWTEXT in STRING. If LITERAL is non-nil, insert NEWTEXT literally. Return a new string containing the replacements. This is a compatibility function for different Emacsen." - (replace-regexp-in-string regexp newtext string nil literal))) - ((fboundp 'replace-in-string) - (defalias 'gnus-replace-in-string 'replace-in-string)))) + (declare (obsolete replace-regexp-in-string "25.2")) + (replace-regexp-in-string regexp newtext string nil literal)) (defun gnus-boundp (variable) "Return non-nil if VARIABLE is bound and non-nil." @@ -431,7 +422,7 @@ Cache the result as a text property stored in DATE." (defun gnus-mode-string-quote (string) "Quote all \"%\"'s in STRING." - (gnus-replace-in-string string "%" "%%")) + (replace-regexp-in-string string "%" "%%")) ;; Make a hash table (default and minimum size is 256). ;; Optional argument HASHSIZE specifies the table size. diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el index f4a9e19..f9c89f5 100644 --- a/lisp/gnus/mail-source.el +++ b/lisp/gnus/mail-source.el @@ -603,7 +603,7 @@ If CONFIRM is non-nil, ask for confirmation before removing a file." currday (+ currday (* low2days (nth 1 (current-time))))) (while files (let* ((ffile (car files)) - (bfile (gnus-replace-in-string + (bfile (replace-regexp-in-string ffile "\\`.*/\\([^/]+\\)\\'" "\\1")) (filetime (nth 5 (file-attributes ffile))) (fileday (* (car filetime) high2days)) diff --git a/lisp/gnus/mailcap.el b/lisp/gnus/mailcap.el index bf7ba08..85d0411 100644 --- a/lisp/gnus/mailcap.el +++ b/lisp/gnus/mailcap.el @@ -39,19 +39,6 @@ (autoload 'mm-delete-duplicates "mm-util") 'mm-delete-duplicates)) -;; `mailcap-replace-in-string' is an alias like `gnus-replace-in-string'. -(eval-and-compile - (cond - ((fboundp 'replace-regexp-in-string) - (defun mailcap-replace-in-string (string regexp newtext &optional literal) - "Replace all matches for REGEXP with NEWTEXT in STRING. -If LITERAL is non-nil, insert NEWTEXT literally. Return a new -string containing the replacements. -This is a compatibility function for different Emacsen." - (replace-regexp-in-string regexp newtext string nil literal))) - ((fboundp 'replace-in-string) - (defalias 'mailcap-replace-in-string 'replace-in-string)))) - (defgroup mailcap nil "Definition of viewers for MIME types." :version "21.1" @@ -1047,16 +1034,18 @@ If FORCE, re-parse even if already parsed." (commands ;; Command strings from `viewer' field of the MIME info (mailcap-delete-duplicates - (delq nil (mapcar (lambda (mime-info) - (let ((command (cdr (assoc 'viewer mime-info)))) - (if (stringp command) - (mailcap-replace-in-string - ;; Replace mailcap's `%s' placeholder - ;; with dired's `?' placeholder - (mailcap-replace-in-string - ;; Remove the final filename placeholder - command "[ \t\n]*\\('\\)?%s\\1?[ \t\n]*\\'" "" t) - "%s" "?" t)))) + (delq nil (mapcar + (lambda (mime-info) + (let ((command (cdr (assoc 'viewer mime-info)))) + (if (stringp command) + (replace-regexp-in-string + ;; Replace mailcap's `%s' placeholder + ;; with dired's `?' placeholder + (replace-regexp-in-string + ;; Remove the final filename placeholder + command "[ \t\n]*\\('\\)?%s\\1?[ \t\n]*\\'" "" + nil t) + "%s" "?" nil t)))) common-mime-info))))) commands)) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 3c31056..11c1012 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -8373,8 +8373,8 @@ From headers in the original article." (let ((value (message-field-value header))) (dolist (string (mail-header-parse-addresses value 'raw)) (setq string - (gnus-replace-in-string - (gnus-replace-in-string string "^ +\\| +$" "") "\n" "")) + (replace-regexp-in-string + (replace-regexp-in-string string "^ +\\| +$" "") "\n" "")) (ecomplete-add-item 'mail (car (mail-header-parse-address string)) string)))) (ecomplete-save)) diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 06159bc..4df653c 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -28,7 +28,6 @@ (eval-when-compile (require 'cl)) (autoload 'gnus-map-function "gnus-util") -(autoload 'gnus-replace-in-string "gnus-util") (autoload 'gnus-read-shell-command "gnus-util") (autoload 'mm-inline-partial "mm-partial") @@ -1360,12 +1359,12 @@ string if you do not like underscores." (defun mm-file-name-delete-control (filename) "Delete control characters from FILENAME." - (gnus-replace-in-string filename "[\x00-\x1f\x7f]" "")) + (replace-regexp-in-string filename "[\x00-\x1f\x7f]" "")) (defun mm-file-name-delete-gotchas (filename) "Delete shell gotchas from FILENAME." - (setq filename (gnus-replace-in-string filename "[<>|]" "")) - (gnus-replace-in-string filename "^[.-]+" "")) + (setq filename (replace-regexp-in-string filename "[<>|]" "")) + (replace-regexp-in-string filename "^[.-]+" "")) (defun mm-save-part (handle &optional prompt) "Write HANDLE to a file. diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 560ba8a..eb436f5 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -928,17 +928,17 @@ ready to be added to the list of search results." ;; Set group to dirnam without any leading dots or slashes, ;; and with all subsequent slashes replaced by dots - (let ((group (gnus-replace-in-string - (gnus-replace-in-string dirnam "^[./\\]" "" t) - "[/\\]" "." t))) - - (vector (gnus-group-full-name group server) - (if (string-match "\\`nnmaildir:" (gnus-group-server server)) - (nnmaildir-base-name-to-article-number - (substring article 0 (string-match ":" article)) - group nil) - (string-to-number article)) - (string-to-number score))))) + (let ((group (replace-regexp-in-string + (replace-regexp-in-string dirnam "^[./\\]" "" nil t) + "[/\\]" "." nil t))) + + (vector (gnus-group-full-name group server) + (if (string-match "\\`nnmaildir:" (gnus-group-server server)) + (nnmaildir-base-name-to-article-number + (substring article 0 (string-match ":" article)) + group nil) + (string-to-number article)) + (string-to-number score))))) ;;; Search Engine Interfaces: @@ -1340,9 +1340,10 @@ Tested with swish-e-2.0.1 on Windows NT 4.0." ;; eliminate all ".", "/", "\" from beginning. Always matches. (string-match "^[./\\]*\\(.*\\)$" dirnam) ;; "/" -> "." - (setq group (gnus-replace-in-string (match-string 1 dirnam) "/" ".")) + (setq group (replace-regexp-in-string + (match-string 1 dirnam) "/" ".")) ;; Windows "\\" -> "." - (setq group (gnus-replace-in-string group "\\\\" ".")) + (setq group (replace-regexp-in-string group "\\\\" ".")) (push (vector (gnus-group-full-name group server) (string-to-number artno) @@ -1414,7 +1415,7 @@ Tested with swish-e-2.0.1 on Windows NT 4.0." (when (string-match prefix dirnam) (setq dirnam (replace-match "" t t dirnam))) (push (vector (gnus-group-full-name - (gnus-replace-in-string dirnam "/" ".") server) + (replace-regexp-in-string dirnam "/" ".") server) (string-to-number artno) (string-to-number score)) artlist)) @@ -1612,9 +1613,8 @@ actually)." group (if (file-directory-p (setq group - (gnus-replace-in-string - group - "\\." "/" t))) + (replace-regexp-in-string + group "\\." "/" nil t))) group)))))) (unless group (error "Cannot locate directory for group")) diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el index 70a3dd9..4b15443 100644 --- a/lisp/gnus/nnmaildir.el +++ b/lisp/gnus/nnmaildir.el @@ -656,13 +656,13 @@ by nnmaildir-request-article.") (if (zerop n) 1 (1- (lsh 1 (1+ (logb n)))))) (defun nnmaildir--system-name () - (gnus-replace-in-string - (gnus-replace-in-string - (gnus-replace-in-string + (replace-regexp-in-string + (replace-regexp-in-string + (replace-regexp-in-string (system-name) - "\\\\" "\\134" 'literal) - "/" "\\057" 'literal) - ":" "\\072" 'literal)) + "\\\\" "\\134" nil 'literal) + "/" "\\057" nil 'literal) + ":" "\\072" nil 'literal)) (defun nnmaildir-request-type (_group &optional _article) 'mail) @@ -955,8 +955,8 @@ by nnmaildir-request-article.") pgname (nnmaildir--pgname nnmaildir--cur-server pgname) group (symbol-value group) ro (nnmaildir--param pgname 'read-only)) - (insert (gnus-replace-in-string - (nnmaildir--grp-name group) " " "\\ " t) + (insert (replace-regexp-in-string + (nnmaildir--grp-name group) " " "\\ " nil t) " ") (princ (nnmaildir--group-maxnum nnmaildir--cur-server group) nntp-server-buffer) @@ -985,7 +985,7 @@ by nnmaildir-request-article.") (princ (nnmaildir--group-maxnum nnmaildir--cur-server group) nntp-server-buffer) (insert " " - (gnus-replace-in-string gname " " "\\ " t) + (replace-regexp-in-string gname " " "\\ " nil t) "\n"))))) 'group) @@ -1116,7 +1116,7 @@ by nnmaildir-request-article.") (insert " ") (princ (nnmaildir--group-maxnum nnmaildir--cur-server group) nntp-server-buffer) - (insert " " (gnus-replace-in-string gname " " "\\ " t) "\n") + (insert " " (replace-regexp-in-string gname " " "\\ " nil t) "\n") t)))) (defun nnmaildir-request-create-group (gname &optional server _args) @@ -1278,7 +1278,7 @@ by nnmaildir-request-article.") (insert "\t" (nnmaildir--nov-get-beg nov) "\t" (nnmaildir--art-msgid article) "\t" (nnmaildir--nov-get-mid nov) "\tXref: nnmaildir " - (gnus-replace-in-string gname " " "\\ " t) ":") + (replace-regexp-in-string gname " " "\\ " nil t) ":") (princ num nntp-server-buffer) (insert "\t" (nnmaildir--nov-get-end nov) "\n")))) (catch 'return diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el index 3350933..28dcd9a 100644 --- a/lisp/gnus/nnml.el +++ b/lisp/gnus/nnml.el @@ -1077,7 +1077,7 @@ Use the nov database for the current group if available." ;; 1/ Move the article to a new file: (let* ((oldfile (nnml-article-to-file old-number)) (newfile - (gnus-replace-in-string + (replace-regexp-in-string oldfile ;; nnml-use-compressed-files might be any string, but ;; probably it's sufficient to take into account only diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el index bef8203..857c58a 100644 --- a/lisp/gnus/nnrss.el +++ b/lisp/gnus/nnrss.el @@ -111,7 +111,7 @@ for decoding when the cdr that the data specify is not available.") ;;; Interface functions (defsubst nnrss-format-string (string) - (gnus-replace-in-string string " *\n *" " ")) + (replace-regexp-in-string string " *\n *" " ")) (defun nnrss-decode-group-name (group) (if (and group (mm-coding-system-p 'utf-8)) @@ -292,7 +292,7 @@ for decoding when the cdr that the data specify is not available.") (let ((rfc2047-encoding-type 'mime) rfc2047-encode-max-chars) (rfc2047-encode-string - (gnus-replace-in-string group "[\t\n ]+" "_"))))) + (replace-regexp-in-string group "[\t\n ]+" "_"))))) (when nnrss-content-function (funcall nnrss-content-function e group article)))) (cond @@ -805,8 +805,8 @@ It is useful when `(setq nnrss-use-local t)'." (nnrss-node-just-text node) node)) (cleaned-text (if text - (gnus-replace-in-string - (gnus-replace-in-string + (replace-regexp-in-string + (replace-regexp-in-string text "^[\000-\037\177]+\\|^ +\\| +$" "") "\r\n" "\n")))) (if (string-equal "" cleaned-text) diff --git a/lisp/gnus/spam-report.el b/lisp/gnus/spam-report.el index 0086dd1..7ebff19 100644 --- a/lisp/gnus/spam-report.el +++ b/lisp/gnus/spam-report.el @@ -162,9 +162,9 @@ submitted at once. Internal variable.") rpt-host (concat "/" - (gnus-replace-in-string - (gnus-replace-in-string - (gnus-replace-in-string + (replace-regexp-in-string + (replace-regexp-in-string + (replace-regexp-in-string (mail-header-xref (gnus-summary-article-header article)) "/raw" ":silent") "^.*article.gmane.org/" "") @@ -207,7 +207,7 @@ submitted at once. Internal variable.") (when host (when (string-equal "permalink.gmane.org" host) (setq host rpt-host) - (setq report (gnus-replace-in-string + (setq report (replace-regexp-in-string report "/\\([0-9]+\\)$" ":\\1"))) (setq url (format "http://%s%s" host report))) (if (not (and host report url)) @@ -227,7 +227,7 @@ the function specified by `spam-report-url-ping-function'." (defcustom spam-report-user-mail-address (and (stringp user-mail-address) - (gnus-replace-in-string user-mail-address "@" "")) + (replace-regexp-in-string user-mail-address "@" "")) "Mail address of this user used for spam reports to Gmane. This is initialized based on `user-mail-address'." :type '(choice string diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el index ab0584f..39181ea 100644 --- a/lisp/gnus/spam.el +++ b/lisp/gnus/spam.el @@ -1199,7 +1199,7 @@ Note this has to be fast." (if header-content (cond ((eq header 'X-Spam-Status) - (string-to-number (gnus-replace-in-string + (string-to-number (replace-regexp-in-string header-content spam-spamassassin-score-regexp "\\1"))) @@ -1207,8 +1207,8 @@ Note this has to be fast." ((string-match "( pR: \\([0-9.-]+\\)" header-content) (- (string-to-number (match-string 1 header-content)))) ((eq header 'X-Bogosity) - (string-to-number (gnus-replace-in-string - (gnus-replace-in-string + (string-to-number (replace-regexp-in-string + (replace-regexp-in-string header-content ".*spamicity=" "") ",.*" ""))) commit 16b7e605f32862c592ffd1134079b91e3ee4ef91 Author: Lars Ingebrigtsen Date: Thu Feb 11 15:52:11 2016 +1100 Remove Gnus XEmacs compat * lisp/gnus/gnus-start.el (gnus-dribble-enter): Remove comment about code that doesn't work in XEmacs. * lisp/gnus/gnus-sum.el: Remove XEmacs compat. * lisp/gnus/gnus-topic.el: Remove XEmacs compat. diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 692c834..8669ff4 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -865,11 +865,6 @@ If REGEXP is given, lines that match it will be deleted." ;; Make sure that each dribble entry is a single line, so that ;; the "remove" code above works. (insert (replace-regexp-in-string "\n" "\\\\n" string) "\n") - ;; This has been commented by Josh Huber - ;; It causes problems with both XEmacs and Emacs 21, and doesn't - ;; seem to be of much value. (FIXME: remove this after we make sure - ;; it's not needed). - ;; (set-window-point (get-buffer-window (current-buffer)) (point-max)) (bury-buffer gnus-dribble-buffer) (with-current-buffer gnus-group-buffer (gnus-group-set-mode-line)) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index d47e6d02..b85a403 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -24,11 +24,7 @@ ;;; Code: -(eval-when-compile - (require 'cl)) -(eval-when-compile - (when (featurep 'xemacs) - (require 'easy-mmode))) ; for `define-minor-mode' +(eval-when-compile (require 'cl)) (defvar tool-bar-mode) (defvar gnus-tmp-header) @@ -948,13 +944,6 @@ This hook is run before any variables are set in the summary buffer." :group 'gnus-summary-various :type 'hook) -;; Extracted from gnus-xmas-redefine in order to preserve user settings -(when (featurep 'xemacs) - (add-hook 'gnus-summary-mode-hook 'gnus-xmas-summary-menu-add) - (add-hook 'gnus-summary-mode-hook 'gnus-xmas-setup-summary-toolbar) - (add-hook 'gnus-summary-mode-hook - 'gnus-xmas-switch-horizontal-scrollbar-off)) - (defcustom gnus-summary-menu-hook nil "*Hook run after the creation of the summary mode menu." :group 'gnus-summary-visual @@ -2404,8 +2393,7 @@ increase the score of each group you read." ["Verify and Decrypt" gnus-summary-force-verify-and-decrypt t] ["Encrypt body" gnus-article-encrypt-body :active (not (gnus-group-read-only-p)) - ,@(if (featurep 'xemacs) nil - '(:help "Encrypt the message body on disk"))] + :help "Encrypt the message body on disk"] ["Extract all parts..." gnus-summary-save-parts t] ("Multipart" ["Repair multipart" gnus-summary-repair-multipart t] @@ -2414,8 +2402,7 @@ increase the score of each group you read." ["View part as type..." gnus-article-view-part-as-type t] ["Encrypt body" gnus-article-encrypt-body :active (not (gnus-group-read-only-p)) - ,@(if (featurep 'xemacs) nil - '(:help "Encrypt the message body on disk"))] + :help "Encrypt the message body on disk"] ["View part externally" gnus-article-view-part-externally t] ["View HTML parts in browser" gnus-article-browse-html-article t] ["View part with charset..." gnus-article-view-part-as-charset t] @@ -2482,8 +2469,7 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) ["Quoted-Printable" gnus-article-de-quoted-unreadable t] ["Base64" gnus-article-de-base64-unreadable t] ["Rot 13" gnus-summary-caesar-message - ,@(if (featurep 'xemacs) '(t) - '(:help "\"Caesar rotate\" article by 13"))] + :help "\"Caesar rotate\" article by 13"] ["De-IDNA" gnus-summary-idna-message t] ["Morse decode" gnus-summary-morse-message t] ["Unix pipe..." gnus-summary-pipe-message t] @@ -2508,11 +2494,9 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) ) ("Output" ["Save in default format..." gnus-summary-save-article - ,@(if (featurep 'xemacs) '(t) - '(:help "Save article using default method"))] + :help "Save article using default method"] ["Save in file..." gnus-summary-save-article-file - ,@(if (featurep 'xemacs) '(t) - '(:help "Save article in file"))] + :help "Save article in file"] ["Save in Unix mail format..." gnus-summary-save-article-mail t] ["Save in MH folder..." gnus-summary-save-article-folder t] ["Save in VM folder..." gnus-summary-save-article-vm t] @@ -2521,11 +2505,9 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) ["Pipe through a filter..." gnus-summary-pipe-output t] ["Print with Muttprint..." gnus-summary-muttprint t] ["Print" gnus-summary-print-article - ,@(if (featurep 'xemacs) '(t) - '(:help "Generate and print a PostScript image"))]) + :help "Generate and print a PostScript image"]) ("Copy, move,... (Backend)" - ,@(if (featurep 'xemacs) nil - '(:help "Copying, moving, expiring articles...")) + :help "Copying, moving, expiring articles..." ["Respool article..." gnus-summary-respool-article t] ["Move article..." gnus-summary-move-article (gnus-check-backend-function @@ -2552,9 +2534,7 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) (gnus-check-backend-function 'request-expire-articles gnus-newsgroup-name)]) ("Extract" - ["Uudecode" gnus-uu-decode-uu - ,@(if (featurep 'xemacs) '(t) - '(:help "Decode uuencoded article(s)"))] + ["Uudecode" gnus-uu-decode-uu :help "Decode uuencoded article(s)"] ["Uudecode and save" gnus-uu-decode-uu-and-save t] ["Unshar" gnus-uu-decode-unshar t] ["Unshar and save" gnus-uu-decode-unshar-and-save t] @@ -2617,28 +2597,22 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) gnus-summary-post-menu gnus-summary-mode-map "" `("Post" ["Send a message (mail or news)" gnus-summary-post-news - ,@(if (featurep 'xemacs) '(t) - '(:help "Compose a new message (mail or news)"))] + :help "Compose a new message (mail or news)"] ["Followup" gnus-summary-followup - ,@(if (featurep 'xemacs) '(t) - '(:help "Post followup to this article"))] + :help "Post followup to this article"] ["Followup and yank" gnus-summary-followup-with-original - ,@(if (featurep 'xemacs) '(t) - '(:help "Post followup to this article, quoting its contents"))] + :help "Post followup to this article, quoting its contents"] ["Supersede article" gnus-summary-supersede-article t] ["Cancel article" gnus-summary-cancel-article - ,@(if (featurep 'xemacs) '(t) - '(:help "Cancel an article you posted"))] + :help "Cancel an article you posted"] ["Reply" gnus-summary-reply t] ["Reply and yank" gnus-summary-reply-with-original t] ["Wide reply" gnus-summary-wide-reply t] ["Wide reply and yank" gnus-summary-wide-reply-with-original - ,@(if (featurep 'xemacs) '(t) - '(:help "Mail a reply, quoting this article"))] + :help "Mail a reply, quoting this article"] ["Very wide reply" gnus-summary-very-wide-reply t] ["Very wide reply and yank" gnus-summary-very-wide-reply-with-original - ,@(if (featurep 'xemacs) '(t) - '(:help "Mail a very wide reply, quoting this article"))] + :help "Mail a very wide reply, quoting this article"] ["Mail forward" gnus-summary-mail-forward t] ["Post forward" gnus-summary-post-forward t] ["Digest and mail" gnus-uu-digest-mail-forward t] @@ -2649,38 +2623,25 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) ["Send a mail" gnus-summary-mail-other-window t] ["Create a local message" gnus-summary-news-other-window t] ["Uuencode and post" gnus-uu-post-news - ,@(if (featurep 'xemacs) '(t) - '(:help "Post a uuencoded article"))] + :help "Post a uuencoded article"] ["Followup via news" gnus-summary-followup-to-mail t] ["Followup via news and yank" gnus-summary-followup-to-mail-with-original t] ["Strip signature on reply" (lambda () (interactive) - (if (not (memq message-cite-function - '(message-cite-original-without-signature - message-cite-original))) - ;; Stupid workaround for XEmacs not honoring :visible. - (message "Can't toggle this value of `message-cite-function'") - (setq message-cite-function - (if (eq message-cite-function - 'message-cite-original-without-signature) - 'message-cite-original - 'message-cite-original-without-signature)))) - ;; XEmacs barfs on :visible. - ,@(if (featurep 'xemacs) nil - '(:visible (memq message-cite-function - '(message-cite-original-without-signature - message-cite-original)))) + (setq message-cite-function + (if (eq message-cite-function + 'message-cite-original-without-signature) + 'message-cite-original + 'message-cite-original-without-signature))) + :visible (memq message-cite-function + '(message-cite-original-without-signature + message-cite-original)) :style toggle :selected (eq message-cite-function 'message-cite-original-without-signature) - ,@(if (featurep 'xemacs) nil - '(:help "Strip signature from cited article when replying."))] - ;;("Draft" - ;;["Send" gnus-summary-send-draft t] - ;;["Send bounced" gnus-resend-bounced-mail t]) - )) + :help "Strip signature from cited article when replying."])) (cond ((not (keymapp gnus-summary-post-menu)) @@ -2701,8 +2662,7 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) gnus-summary-kill-same-subject-and-select t] ["Mark same subject" gnus-summary-kill-same-subject t] ["Catchup" gnus-summary-catchup - ,@(if (featurep 'xemacs) '(t) - '(:help "Mark unread articles in this group as read"))] + :help "Mark unread articles in this group as read"] ["Catchup all" gnus-summary-catchup-all t] ["Catchup to here" gnus-summary-catchup-to-here t] ["Catchup from here" gnus-summary-catchup-from-here t] @@ -2763,11 +2723,9 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) ("Registry Marks") ("Scroll article" ["Page forward" gnus-summary-next-page - ,@(if (featurep 'xemacs) '(t) - '(:help "Show next page of article"))] + :help "Show next page of article"] ["Page backward" gnus-summary-prev-page - ,@(if (featurep 'xemacs) '(t) - '(:help "Show previous page of article"))] + :help "Show previous page of article"] ["Line forward" gnus-summary-scroll-up t]) ("Move" ["Next unread article" gnus-summary-next-unread-article t] @@ -2827,14 +2785,12 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) ["Send a bug report" gnus-bug t] ("Exit" ["Catchup and exit" gnus-summary-catchup-and-exit - ,@(if (featurep 'xemacs) '(t) - '(:help "Mark unread articles in this group as read, then exit"))] + :help "Mark unread articles in this group as read, then exit"] ["Catchup all and exit" gnus-summary-catchup-all-and-exit t] ["Catchup and goto next" gnus-summary-catchup-and-goto-next-group t] ["Catchup and goto prev" gnus-summary-catchup-and-goto-prev-group t] ["Exit group" gnus-summary-exit - ,@(if (featurep 'xemacs) '(t) - '(:help "Exit current group, return to group selection mode"))] + :help "Exit current group, return to group selection mode"] ["Exit group without updating" gnus-summary-exit-no-update t] ["Exit and goto next group" gnus-summary-next-group t] ["Exit and goto prev group" gnus-summary-prev-group t] @@ -2983,8 +2939,7 @@ See `gmm-tool-bar-from-list' for the format of the list." (defun gnus-summary-make-tool-bar (&optional force) "Make a summary mode tool bar from `gnus-summary-tool-bar'. When FORCE, rebuild the tool bar." - (when (and (not (featurep 'xemacs)) - (boundp 'tool-bar-mode) + (when (and (boundp 'tool-bar-mode) tool-bar-mode (or (not gnus-summary-tool-bar-map) force)) (let* ((load-path @@ -3124,12 +3079,10 @@ The following commands are available: (setq mode-name "Summary") (use-local-map gnus-summary-mode-map) (buffer-disable-undo) - (setq buffer-read-only t ;Disable modification - show-trailing-whitespace nil) - (setq truncate-lines t) - ;; Force paragraph direction to be left-to-right. Don't make it - ;; bound globally in old Emacsen and XEmacsen. - (set (make-local-variable 'bidi-paragraph-direction) 'left-to-right) + (setq buffer-read-only t + show-trailing-whitespace nil + truncate-lines t + bidi-paragraph-direction 'left-to-right) (add-to-invisibility-spec '(gnus-sum . t)) (gnus-summary-set-display-table) (gnus-set-default-directory) @@ -7817,9 +7770,7 @@ If BACKWARD, the previous article is selected instead of the next." (t (unless (gnus-ephemeral-group-p gnus-newsgroup-name) (gnus-summary-jump-to-group gnus-newsgroup-name)) - (let ((cmd (if (featurep 'xemacs) - last-command-char - last-command-event)) + (let ((cmd last-command-event) (point (with-current-buffer gnus-group-buffer (point))) @@ -9438,7 +9389,6 @@ Optional argument BACKWARD means do search for backward. (gnus-article-prepare-hook nil) (gnus-mark-article-hook nil) ;Inhibit marking as read. (gnus-use-article-prefetch nil) - (gnus-xmas-force-redisplay nil) ;Inhibit XEmacs redisplay. (gnus-use-trees nil) ;Inhibit updating tree buffer. (gnus-visual nil) (gnus-keep-backlog nil) @@ -11721,9 +11671,7 @@ Returns nil if no thread was there to be shown." (beg (progn (beginning-of-line) (if (bobp) (point) (1- (point))))) (eoi (when end (if (fboundp 'next-single-char-property-change) - ;; Note: XEmacs version of n-s-c-p-c may return nil - (or (next-single-char-property-change end 'invisible) - (point-max)) + (next-single-char-property-change end 'invisible) (while (progn (end-of-line 2) (and (not (eobp)) @@ -12304,7 +12252,6 @@ save those articles instead." (defun gnus-read-move-group-name (prompt default articles prefix) "Read a group name." (let* ((split-name (gnus-get-split-value gnus-move-split-methods)) - (minibuffer-confirm-incomplete nil) ; XEmacs (prom (format "%s %s to" prompt diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el index 3255aa9..c5a1777 100644 --- a/lisp/gnus/gnus-topic.el +++ b/lisp/gnus/gnus-topic.el @@ -44,9 +44,6 @@ :type 'hook :group 'gnus-topic) -(when (featurep 'xemacs) - (add-hook 'gnus-topic-mode-hook 'gnus-xmas-topic-menu-add)) - (defcustom gnus-topic-line-format "%i[ %(%{%n%}%) -- %A ]%v\n" "Format of topic lines. It works along the same lines as a normal formatting string, diff --git a/lisp/gnus/gnus-undo.el b/lisp/gnus/gnus-undo.el index b3afcd7..8206b52 100644 --- a/lisp/gnus/gnus-undo.el +++ b/lisp/gnus/gnus-undo.el @@ -44,9 +44,6 @@ ;;; Code: (eval-when-compile (require 'cl)) -(eval-when-compile - (when (featurep 'xemacs) - (require 'easy-mmode))) ; for `define-minor-mode' (require 'gnus-util) (require 'gnus) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 99565a2..a883de9 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -44,15 +44,12 @@ :type `(radio (function-item :doc "Use Emacs standard `completing-read' function." gnus-emacs-completing-read) - ;; iswitchb.el is very old and ido.el is unavailable - ;; in XEmacs, so we exclude those function items. - ,@(unless (featurep 'xemacs) - '((function-item - :doc "Use `ido-completing-read' function." - gnus-ido-completing-read) - (function-item - :doc "Use iswitchb based completing-read function." - gnus-iswitchb-completing-read))))) + (function-item + :doc "Use `ido-completing-read' function." + gnus-ido-completing-read) + (function-item + :doc "Use iswitchb based completing-read function." + gnus-iswitchb-completing-read))) (defcustom gnus-completion-styles (if (and (boundp 'completion-styles-alist) commit 68a1669f57f551f714c156d3ad68a058094b3a52 Author: Lars Ingebrigtsen Date: Thu Feb 11 15:41:10 2016 +1100 Remove compat functions in gnus-spec.el * lisp/gnus/gnus-spec.el (gnus-string-width-function): Remove. (gnus-substring-function): Remove. (gnus-use-correct-string-widths): Remove. (gnus-make-format-preserve-properties): Remove. (gnus-xmas-format): Remove. * lisp/gnus/gnus-srvr.el (gnus-server-mode): Remove XEmacs compat. diff --git a/lisp/gnus/gnus-spec.el b/lisp/gnus/gnus-spec.el index 7c1fdf2..36f6f43 100644 --- a/lisp/gnus/gnus-spec.el +++ b/lisp/gnus/gnus-spec.el @@ -29,19 +29,6 @@ (require 'gnus) -(defcustom gnus-use-correct-string-widths nil - "*If non-nil, use correct functions for dealing with wide characters." - :version "22.1" - :group 'gnus-format - :type 'boolean) - -(defcustom gnus-make-format-preserve-properties nil - "*If non-nil, use a replacement `format' function which preserves -text properties. This is only needed on XEmacs, as Emacs does this anyway." - :version "22.1" - :group 'gnus-format - :type 'boolean) - ;;; Internal variables. (defvar gnus-summary-mark-positions nil) @@ -315,62 +302,42 @@ Return a list of updated types." (setq wend seek) (substring string wstart (1- wend)))) -(defun gnus-string-width-function () - (cond - (gnus-use-correct-string-widths - 'gnus-correct-length) - ((fboundp 'string-width) - 'string-width) - (t - 'length))) - -(defun gnus-substring-function () - (cond - (gnus-use-correct-string-widths - 'gnus-correct-substring) - ((fboundp 'string-width) - 'gnus-correct-substring) - (t - 'substring))) - (defun gnus-tilde-max-form (el max-width) "Return a form that limits EL to MAX-WIDTH." - (let ((max (abs max-width)) - (length-fun (gnus-string-width-function)) - (substring-fun (gnus-substring-function))) + (let ((max (abs max-width))) (if (symbolp el) - `(if (> (,length-fun ,el) ,max) + `(if (> (string-width ,el) ,max) ,(if (< max-width 0) - `(,substring-fun ,el (- (,length-fun ,el) ,max)) + `(gnus-correct-substring ,el (- (string-width ,el) ,max)) `(if (gnus-lrm-string-p ,el) - (concat (,substring-fun ,el 0 ,max) ,gnus-lrm-string) - (,substring-fun ,el 0 ,max))) + (concat (gnus-correct-substring ,el 0 ,max) + ,gnus-lrm-string) + (gnus-correct-substring ,el 0 ,max))) ,el) `(let ((val (eval ,el))) - (if (> (,length-fun val) ,max) + (if (> (string-width val) ,max) ,(if (< max-width 0) - `(,substring-fun val (- (,length-fun val) ,max)) + `(gnus-correct-substring val (- (string-width val) ,max)) `(if (gnus-lrm-string-p val) - (concat (,substring-fun val 0 ,max) ,gnus-lrm-string) - (,substring-fun val 0 ,max))) + (concat (gnus-correct-substring val 0 ,max) + ,gnus-lrm-string) + (gnus-correct-substring val 0 ,max))) val))))) (defun gnus-tilde-cut-form (el cut-width) "Return a form that cuts CUT-WIDTH off of EL." - (let ((cut (abs cut-width)) - (length-fun (gnus-string-width-function)) - (substring-fun (gnus-substring-function))) + (let ((cut (abs cut-width))) (if (symbolp el) - `(if (> (,length-fun ,el) ,cut) + `(if (> (string-width ,el) ,cut) ,(if (< cut-width 0) - `(,substring-fun ,el 0 (- (,length-fun ,el) ,cut)) - `(,substring-fun ,el ,cut)) + `(gnus-correct-substring ,el 0 (- (string-width ,el) ,cut)) + `(gnus-correct-substring ,el ,cut)) ,el) `(let ((val (eval ,el))) - (if (> (,length-fun val) ,cut) + (if (> (string-width val) ,cut) ,(if (< cut-width 0) - `(,substring-fun val 0 (- (,length-fun val) ,cut)) - `(,substring-fun val ,cut)) + `(gnus-correct-substring val 0 (- (string-width val) ,cut)) + `(gnus-correct-substring val ,cut)) val))))) (defun gnus-tilde-ignore-form (el ignore-value) @@ -387,17 +354,16 @@ Return a list of updated types." characters correctly. This is because `format' may pad to columns or to characters when given a pad value." (let ((pad (abs pad-width)) - (side (< 0 pad-width)) - (length-fun (gnus-string-width-function))) + (side (< 0 pad-width))) (if (symbolp el) - `(let ((need (- ,pad (,length-fun ,el)))) + `(let ((need (- ,pad (string-width ,el)))) (if (> need 0) (concat ,(when side '(make-string need ?\ )) ,el ,(when (not side) '(make-string need ?\ ))) ,el)) `(let* ((val (eval ,el)) - (need (- ,pad (,length-fun val)))) + (need (- ,pad (string-width val)))) (if (> need 0) (concat ,(when side '(make-string need ?\ )) val @@ -485,42 +451,6 @@ characters when given a pad value." (nth 1 sform))))) form))) - -(defun gnus-xmas-format (fstring &rest args) - "A version of `format' which preserves text properties. - -Required for XEmacs, where the built in `format' function strips all text -properties from both the format string and any inserted strings. - -Only supports the format sequence %s, and %% for inserting -literal % characters. A pad width and an optional - (to right pad) -are supported for %s." - (let ((re "%%\\|%\\(-\\)?\\([1-9][0-9]*\\)?s") - (n (length args))) - (with-temp-buffer - (insert fstring) - (goto-char (point-min)) - (while (re-search-forward re nil t) - (goto-char (match-end 0)) - (cond - ((string= (match-string 0) "%%") - (delete-char -1)) - (t - (if (null args) - (signal 'wrong-number-of-arguments - (list #'gnus-xmas-format n fstring))) - (let* ((minlen (string-to-number (or (match-string 2) ""))) - (arg (car args)) - (str (if (stringp arg) arg (format "%s" arg))) - (lpad (null (match-string 1))) - (padlen (max 0 (- minlen (length str))))) - (replace-match "") - (if lpad (insert-char ?\ padlen)) - (insert str) - (unless lpad (insert-char ?\ padlen)) - (setq args (cdr args)))))) - (buffer-string)))) - (defun gnus-parse-simple-format (format spec-alist &optional insert) ;; This function parses the FORMAT string with the help of the ;; SPEC-ALIST and returns a list that can be eval'ed to return a @@ -627,14 +557,10 @@ are supported for %s." (setq elem '("*" ?s)))) (setq elem-type (cadr elem)) ;; Insert the new format elements. - (when (and pad-width - (not (and (featurep 'xemacs) - gnus-use-correct-string-widths))) + (when pad-width (insert (number-to-string pad-width))) ;; Create the form to be evalled. - (if (or max-width cut-width ignore-value - (and (featurep 'xemacs) - gnus-use-correct-string-widths)) + (if (or max-width cut-width ignore-value) (progn (insert ?s) (let ((el (car elem))) @@ -689,13 +615,6 @@ are supported for %s." ;; A single string spec in the end of the spec. ((string-match "\\`\\([^%]+\\)%[sc]\\'" fstring) (list (match-string 1 fstring) (car flist))) - ;; Only string (and %) specs (XEmacs only!) - ((and (featurep 'xemacs) - gnus-make-format-preserve-properties - (string-match - "\\`\\([^%]*\\(%%\\|%-?\\([1-9][0-9]*\\)?s\\)\\)*[^%]*\\'" - fstring)) - (list (cons 'gnus-xmas-format (cons fstring (nreverse flist))))) ;; A more complex spec. (t (list (cons 'format (cons fstring (nreverse flist))))))) diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el index 9f56989..a53cabd 100644 --- a/lisp/gnus/gnus-srvr.el +++ b/lisp/gnus/gnus-srvr.el @@ -280,10 +280,8 @@ The following commands are available: (buffer-disable-undo) (setq truncate-lines t) (setq buffer-read-only t) - (if (featurep 'xemacs) - (put 'gnus-server-mode 'font-lock-defaults '(gnus-server-font-lock-keywords t)) - (set (make-local-variable 'font-lock-defaults) - '(gnus-server-font-lock-keywords t))) + (set (make-local-variable 'font-lock-defaults) + '(gnus-server-font-lock-keywords t)) (gnus-run-mode-hooks 'gnus-server-mode-hook)) (defun gnus-server-insert-server-line (name method) commit 1ff3e583f58be4c2b56000baa83ab3a738011ab3 Author: Lars Ingebrigtsen Date: Thu Feb 11 15:27:45 2016 +1100 Remove Gnus XEmacs compat functions * lisp/gnus/gnus-registry.el: Remove XEmacs compat. * lisp/gnus/gnus-salt.el: Remove XEmacs compat. * lisp/gnus/gnus-score.el (gnus-decay-score): Remove XEmacs compat. diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index f49eb0d..c636c7e 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el @@ -87,12 +87,6 @@ (require 'easymenu) (require 'registry) -;; Silence XEmacs byte compiler, which will otherwise complain about -;; call to `eieio-persistent-read'. -(when (featurep 'xemacs) - (byte-compiler-options - (warnings (- callargs)))) - (defvar gnus-adaptive-word-syntax-table) (defvar gnus-registry-dirty t diff --git a/lisp/gnus/gnus-salt.el b/lisp/gnus/gnus-salt.el index 3509217..b7af969 100644 --- a/lisp/gnus/gnus-salt.el +++ b/lisp/gnus/gnus-salt.el @@ -25,9 +25,6 @@ ;;; Code: (eval-when-compile (require 'cl)) -(eval-when-compile - (when (featurep 'xemacs) - (require 'easy-mmode))) ; for `define-minor-mode' (require 'gnus) (require 'gnus-sum) @@ -47,9 +44,6 @@ :type 'hook :group 'gnus-summary-pick) -(when (featurep 'xemacs) - (add-hook 'gnus-pick-mode-hook 'gnus-xmas-pick-menu-add)) - (defcustom gnus-mark-unpicked-articles-as-read nil "*If non-nil, mark all unpicked articles as read." :type 'boolean @@ -100,11 +94,6 @@ It accepts the same format specs that `gnus-summary-line-format' does." ["Start reading" gnus-pick-start-reading t] ["Switch pick mode off" gnus-pick-mode gnus-pick-mode])))) -(eval-when-compile - (when (featurep 'xemacs) - (defvar gnus-pick-mode-on-hook) - (defvar gnus-pick-mode-off-hook))) - (define-minor-mode gnus-pick-mode "Minor mode for providing a pick-and-read interface in Gnus summary buffers. @@ -339,11 +328,6 @@ This must be bound to a button-down mouse event." '("Pick" ["Switch binary mode off" gnus-binary-mode t])))) -(eval-when-compile - (when (featurep 'xemacs) - (defvar gnus-binary-mode-on-hook) - (defvar gnus-binary-mode-off-hook))) - (define-minor-mode gnus-binary-mode "Minor mode for providing a binary group interface in Gnus summary buffers." :lighter " Binary" :keymap gnus-binary-mode-map @@ -419,11 +403,6 @@ Two predefined functions are available: :type 'hook :group 'gnus-summary-tree) -(when (featurep 'xemacs) - (add-hook 'gnus-tree-mode-hook 'gnus-xmas-tree-menu-add) - (add-hook 'gnus-tree-mode-hook 'gnus-xmas-switch-horizontal-scrollbar-off)) - - ;;; Internal variables. (defvar gnus-tmp-name) diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index b486a05..82a8049 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -3050,19 +3050,12 @@ If ADAPT, return the home adaptive file instead." (defun gnus-decay-score (score) "Decay SCORE according to `gnus-score-decay-constant' and `gnus-score-decay-scale'." - (let ((n (- score - (* (if (< score 0) -1 1) - (min (abs score) - (max gnus-score-decay-constant - (* (abs score) - gnus-score-decay-scale))))))) - (if (and (featurep 'xemacs) - ;; XEmacs's floor can handle only the floating point - ;; number below the half of the maximum integer. - (> (abs n) (lsh -1 -2))) - (string-to-number - (car (split-string (number-to-string n) "\\."))) - (floor n)))) + (floor (- score + (* (if (< score 0) -1 1) + (min (abs score) + (max gnus-score-decay-constant + (* (abs score) + gnus-score-decay-scale))))))) (defun gnus-decay-scores (alist day) "Decay non-permanent scores in ALIST." diff --git a/lisp/gnus/gnus-spec.el b/lisp/gnus/gnus-spec.el index 8e8b5d4..7c1fdf2 100644 --- a/lisp/gnus/gnus-spec.el +++ b/lisp/gnus/gnus-spec.el @@ -29,13 +29,13 @@ (require 'gnus) -(defcustom gnus-use-correct-string-widths (featurep 'xemacs) +(defcustom gnus-use-correct-string-widths nil "*If non-nil, use correct functions for dealing with wide characters." :version "22.1" :group 'gnus-format :type 'boolean) -(defcustom gnus-make-format-preserve-properties (featurep 'xemacs) +(defcustom gnus-make-format-preserve-properties nil "*If non-nil, use a replacement `format' function which preserves text properties. This is only needed on XEmacs, as Emacs does this anyway." :version "22.1" commit 35953890c59f3d7fc6abe4a5f4aefc4c0d005ad4 Author: Lars Ingebrigtsen Date: Thu Feb 11 15:22:45 2016 +1100 Remove Gnus XEmacs compatibility * lisp/gnus/gnus-demon.el (gnus-demon-idle-since): Remove XEmacs compat. * lisp/gnus/gnus-dired.el: Remove XEmacs compat. * lisp/gnus/gnus-draft.el: Remove XEmacs compat. * lisp/gnus/gnus-gravatar.el (gnus-gravatar-insert): Remove XEmacs compat. * lisp/gnus/gnus-group.el: Remove XEmacs compat. * lisp/gnus/gnus-html.el: Remove XEmacs compat. * lisp/gnus/gnus-ml.el: Remove XEmacs compat. * lisp/gnus/gnus-picon.el (gnus-picon-style): Remove XEmacs comment. diff --git a/lisp/gnus/gnus-demon.el b/lisp/gnus/gnus-demon.el index eb7d0f8..1d4b021 100644 --- a/lisp/gnus/gnus-demon.el +++ b/lisp/gnus/gnus-demon.el @@ -93,10 +93,7 @@ Emacs has been idle for IDLE `gnus-demon-timestep's." (defun gnus-demon-idle-since () "Return the number of seconds since when Emacs is idle." - (if (featurep 'xemacs) - (itimer-time-difference (current-time) last-command-event-time) - (float-time (or (current-idle-time) - '(0 0 0))))) + (float-time (or (current-idle-time) '(0 0 0)))) (defun gnus-demon-run-callback (func &optional idle time special) "Run FUNC if Emacs has been idle for longer than IDLE seconds. diff --git a/lisp/gnus/gnus-dired.el b/lisp/gnus/gnus-dired.el index 3bbd4de..f7eae94 100644 --- a/lisp/gnus/gnus-dired.el +++ b/lisp/gnus/gnus-dired.el @@ -38,9 +38,6 @@ ;;; Code: -(eval-when-compile - (when (featurep 'xemacs) - (require 'easy-mmode))) ; for `define-minor-mode' (require 'dired) (autoload 'mml-attach-file "mml") (autoload 'mm-default-file-encoding "mm-decode");; Shift this to `mailcap.el'? @@ -86,12 +83,6 @@ See `mail-user-agent' for more information." gnus-user-agent) (function :tag "Other"))) -(eval-when-compile - (when (featurep 'xemacs) - (defvar gnus-dired-mode-hook) - (defvar gnus-dired-mode-on-hook) - (defvar gnus-dired-mode-off-hook))) - (define-minor-mode gnus-dired-mode "Minor mode for intersections of gnus and dired. @@ -134,9 +125,7 @@ filenames." (mapcar ;; don't attach directories (lambda (f) (if (file-directory-p f) nil f)) - (nreverse - (let ((arg nil)) ;; Silence XEmacs 21.5 when compiling. - (dired-map-over-marks (dired-get-filename) arg))))))) + (nreverse (dired-map-over-marks (dired-get-filename) nil)))))) (let ((destination nil) (files-str nil) (bufs nil)) diff --git a/lisp/gnus/gnus-draft.el b/lisp/gnus/gnus-draft.el index b5b17ba..7a52266 100644 --- a/lisp/gnus/gnus-draft.el +++ b/lisp/gnus/gnus-draft.el @@ -31,9 +31,6 @@ (require 'nndraft) (require 'gnus-agent) (eval-when-compile (require 'cl)) -(eval-when-compile - (when (featurep 'xemacs) - (require 'easy-mmode))) ; for `define-minor-mode' ;;; Draft minor mode diff --git a/lisp/gnus/gnus-gravatar.el b/lisp/gnus/gnus-gravatar.el index de7203d..77fce25 100644 --- a/lisp/gnus/gnus-gravatar.el +++ b/lisp/gnus/gnus-gravatar.el @@ -110,8 +110,7 @@ Set image category to CATEGORY." ;; another mail with the same someaddress. (unless (memq 'gnus-gravatar (text-properties-at (point))) (let ((point (point))) - (unless (featurep 'xemacs) - (setq gravatar (append gravatar gnus-gravatar-properties))) + (setq gravatar (append gravatar gnus-gravatar-properties)) (gnus-put-image gravatar (buffer-substring (point) (1+ point)) category) (put-text-property point (point) 'gnus-gravatar address) (gnus-add-wash-type category) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index f66d9ce..838e747 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -223,11 +223,6 @@ with some simple extensions: :group 'gnus-group-visual :type 'string) -;; Extracted from gnus-xmas-redefine in order to preserve user settings -(when (featurep 'xemacs) - (add-hook 'gnus-group-mode-hook 'gnus-xmas-group-menu-add) - (add-hook 'gnus-group-mode-hook 'gnus-xmas-setup-group-toolbar)) - (defcustom gnus-group-menu-hook nil "Hook run after the creation of the group mode menu." :group 'gnus-group-various @@ -534,10 +529,7 @@ simple manner.") (?O gnus-tmp-moderated-string ?s) (?p gnus-tmp-process-marked ?c) (?s gnus-tmp-news-server ?s) - (?n ,(if (featurep 'xemacs) - '(symbol-name gnus-tmp-news-method) - 'gnus-tmp-news-method) - ?s) + (?n gnus-tmp-news-method ?s) (?P gnus-group-indentation ?s) (?E gnus-tmp-group-icon ?s) (?B gnus-tmp-summary-live ?c) @@ -797,32 +789,26 @@ simple manner.") ["Catch up" gnus-group-catchup-current :included (not (gnus-topic-mode-p)) :active (gnus-group-group-name) - ,@(if (featurep 'xemacs) nil - '(:help "Mark unread articles in the current group as read"))] + :help "Mark unread articles in the current group as read"] ["Catch up " gnus-topic-catchup-articles :included (gnus-topic-mode-p) - ,@(if (featurep 'xemacs) nil - '(:help "Mark unread articles in the current group or topic as read"))] + :help "Mark unread articles in the current group or topic as read"] ["Catch up all articles" gnus-group-catchup-current-all (gnus-group-group-name)] ["Check for new articles" gnus-group-get-new-news-this-group :included (not (gnus-topic-mode-p)) :active (gnus-group-group-name) - ,@(if (featurep 'xemacs) nil - '(:help "Check for new messages in current group"))] + :help "Check for new messages in current group"] ["Check for new articles " gnus-topic-get-new-news-this-topic :included (gnus-topic-mode-p) - ,@(if (featurep 'xemacs) nil - '(:help "Check for new messages in current group or topic"))] + :help "Check for new messages in current group or topic"] ["Toggle subscription" gnus-group-unsubscribe-current-group (gnus-group-group-name)] ["Kill" gnus-group-kill-group :active (gnus-group-group-name) - ,@(if (featurep 'xemacs) nil - '(:help "Kill (remove) current group"))] + :help "Kill (remove) current group"] ["Yank" gnus-group-yank-group gnus-list-of-killed-groups] ["Describe" gnus-group-describe-group :active (gnus-group-group-name) - ,@(if (featurep 'xemacs) nil - '(:help "Display description of the current group"))] + :help "Display description of the current group"] ;; Actually one should check, if any of the marked groups gives t for ;; (gnus-check-backend-function 'request-expire-articles ...) ["Expire articles" gnus-group-expire-articles @@ -959,13 +945,9 @@ simple manner.") ["Send a message (mail or news)" gnus-group-post-news t] ["Create a local message" gnus-group-news t] ["Check for new news" gnus-group-get-new-news - ,@(if (featurep 'xemacs) '(t) - '(:help "Get newly arrived articles")) - ] + :help "Get newly arrived articles"] ["Send queued messages" gnus-delay-send-queue - ,@(if (featurep 'xemacs) '(t) - '(:help "Send all messages that are scheduled to be sent now")) - ] + :help "Send all messages that are scheduled to be sent now"] ["Activate all groups" gnus-activate-all-groups t] ["Restart Gnus" gnus-group-restart t] ["Read init file" gnus-group-read-init-file t] @@ -980,9 +962,7 @@ simple manner.") ["Flush score cache" gnus-score-flush-cache t] ["Toggle topics" gnus-topic-mode t] ["Send a bug report" gnus-bug t] - ["Exit from Gnus" gnus-group-exit - ,@(if (featurep 'xemacs) '(t) - '(:help "Quit reading news"))] + ["Exit from Gnus" gnus-group-exit :help "Quit reading news"] ["Exit without saving" gnus-group-quit t])) (gnus-run-hooks 'gnus-group-menu-hook))) @@ -1100,8 +1080,7 @@ See `gmm-tool-bar-from-list' for the format of the list." (defun gnus-group-make-tool-bar (&optional force) "Make a group mode tool bar from `gnus-group-tool-bar'. When FORCE, rebuild the tool bar." - (when (and (not (featurep 'xemacs)) - (boundp 'tool-bar-mode) + (when (and (boundp 'tool-bar-mode) tool-bar-mode (display-graphic-p) (or (not gnus-group-tool-bar-map) force)) @@ -1510,8 +1489,7 @@ if it is a string, only list groups matching REGEXP." ;; Message-ID: (defcustom gnus-group-update-tool-bar - (and (not (featurep 'xemacs)) - (boundp 'tool-bar-mode) + (and (boundp 'tool-bar-mode) tool-bar-mode ;; Using `redraw-frame' (see `gnus-tool-bar-update') in Emacs might ;; be confusing, so maybe we shouldn't call it by default. @@ -4673,14 +4651,10 @@ This command may read the active file." (gnus-group-list-mode gnus-group-list-mode) ;; Save it. func) (push last-command-event unread-command-events) - (if (featurep 'xemacs) - (push (make-event 'key-press '(key ?A)) unread-command-events) - (push ?A unread-command-events)) + (push ?A unread-command-events) (let (gnus-pick-mode keys) - (setq keys (if (featurep 'xemacs) - (events-to-keys (read-key-sequence nil)) - (read-key-sequence nil))) - (setq func (lookup-key (current-local-map) keys))) + (setq keys (read-key-sequence nil) + func (lookup-key (current-local-map) keys))) (if (or (not func) (numberp func)) (ding) diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index 9413d4e..23b8836 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el @@ -39,7 +39,7 @@ (require 'xml) (require 'browse-url) (require 'mm-util) -(eval-and-compile (unless (featurep 'xemacs) (require 'help-fns))) +(require 'help-fns) (defcustom gnus-html-image-cache-ttl (days-to-time 7) "Time used to determine if we should use images from the cache." @@ -454,10 +454,7 @@ Return a string with image data." (let* ((image (ignore-errors (gnus-create-image data nil t))) - (size (and image - (if (featurep 'xemacs) - (cons (glyph-width image) (glyph-height image)) - (image-size image t))))) + (size (and image (image-size image t)))) (save-excursion (goto-char start) (let ((alt-text (or alt-text @@ -466,16 +463,8 @@ Return a string with image data." (if (and image ;; Kludge to avoid displaying 30x30 gif images, which ;; seems to be a signal of a broken image. - (not (and (if (featurep 'xemacs) - (glyphp image) - (listp image)) - (eq (if (featurep 'xemacs) - (let ((d (cdadar - (specifier-spec-list - (glyph-image image))))) - (and (vectorp d) - (aref d 0))) - (plist-get (cdr image) :type)) + (not (and (listp image) + (eq (plist-get (cdr image) :type) 'gif) (= (car size) 30) (= (cdr size) 30)))) diff --git a/lisp/gnus/gnus-ml.el b/lisp/gnus/gnus-ml.el index 8ff3616..97bbab4 100644 --- a/lisp/gnus/gnus-ml.el +++ b/lisp/gnus/gnus-ml.el @@ -29,9 +29,6 @@ (require 'gnus) (require 'gnus-msg) (eval-when-compile (require 'cl)) -(eval-when-compile - (when (featurep 'xemacs) - (require 'easy-mmode))) ; for `define-minor-mode' ;;; Mailing list minor mode @@ -84,12 +81,6 @@ If FORCE is non-nil, replace the old ones." (gnus-mailing-list-mode 1)) (gnus-message 1 "no list-post in this message.")))) -(eval-when-compile - (when (featurep 'xemacs) - (defvar gnus-mailing-list-mode-hook) - (defvar gnus-mailing-list-mode-on-hook) - (defvar gnus-mailing-list-mode-off-hook))) - ;;;###autoload (define-minor-mode gnus-mailing-list-mode "Minor mode for providing mailing-list commands. diff --git a/lisp/gnus/gnus-picon.el b/lisp/gnus/gnus-picon.el index bbbe0ed..1b0acd2 100644 --- a/lisp/gnus/gnus-picon.el +++ b/lisp/gnus/gnus-picon.el @@ -81,7 +81,6 @@ Some people may want to add \"unknown\" to this list." "How should picons be displayed. If `inline', the textual representation is replaced. If `right', picons are added right to the textual representation." - ;; FIXME: `right' needs improvement for XEmacs. :type '(choice (const inline) (const right)) :group 'gnus-picon) commit 395f2ad689825f83702cbadc16b9da83493a9929 Author: Lars Ingebrigtsen Date: Thu Feb 11 14:51:49 2016 +1100 Don't use image-map if it isn't defined * lisp/net/shr.el (shr-image-map): Only use image-map as a parent if it's defined (bug#22614). diff --git a/lisp/net/shr.el b/lisp/net/shr.el index b1f2f07..46aea79 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -189,11 +189,10 @@ and other things: (define-key map "\r" 'shr-browse-url) map)) -(defvar image-map nil) ;in case image.el is not pre-loaded - (defvar shr-image-map (let ((map (copy-keymap shr-map))) - (set-keymap-parent map image-map) + (when (boundp 'image-map) + (set-keymap-parent map image-map)) map)) ;; Public functions and commands. commit 980836d80e2447d8922f0f6cf287a12a6c914e8b Author: Lars Ingebrigtsen Date: Thu Feb 11 14:21:38 2016 +1100 Check for MagickAutoOrientImage * configure.ac: Check for MagickAutoOrientImage. * src/image.c (imagemagick_load_image): Don't use MagickAutoOrientImage unless it's available. diff --git a/configure.ac b/configure.ac index c3e2554..6834473 100644 --- a/configure.ac +++ b/configure.ac @@ -2414,7 +2414,7 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${HAVE_W32}" OLD_LIBS=$LIBS CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS" LIBS="$IMAGEMAGICK_LIBS $LIBS" - AC_CHECK_FUNCS(MagickExportImagePixels MagickMergeImageLayers) + AC_CHECK_FUNCS(MagickExportImagePixels MagickMergeImageLayers MagickAutoOrientImage) CFLAGS=$OLD_CFLAGS LIBS=$OLD_LIBS fi diff --git a/src/image.c b/src/image.c index e1b167d..f22394f 100644 --- a/src/image.c +++ b/src/image.c @@ -8560,6 +8560,7 @@ imagemagick_load_image (struct frame *f, struct image *img, return 0; } +#ifdef HAVE_MAGICKAUTOORIENTIMAGE /* If no :rotation is explicitly specified, apply the automatic rotation from EXIF. */ if (NILP (image_spec_value (img->spec, QCrotation, NULL))) @@ -8569,6 +8570,7 @@ imagemagick_load_image (struct frame *f, struct image *img, DestroyMagickWand (image_wand); return 0; } +#endif if (ino < 0 || ino >= MagickGetNumberImages (image_wand)) { commit 363e7097b65eaf8474ea40d9665c25ed71f6ae5c Author: Lars Ingebrigtsen Date: Wed Feb 10 15:45:37 2016 +1100 Document EXIF image rotation * doc/lispref/display.texi (ImageMagick Images): Mention EXIF rotation. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 26f3de4..608ce0e 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -5213,7 +5213,9 @@ when the image does not have an associated file name, to provide a hint to ImageMagick to help it detect the image type. @item :rotation @var{angle} -Specifies a rotation angle in degrees. +Specifies a rotation angle in degrees. If no rotation is explicitly +specified, and the @acronym{EXIF} headers specify a rotation, the +rotation from the @acronym{EXIF} headers are used instead. @item :index @var{frame} @c Doesn't work: http://debbugs.gnu.org/7978 diff --git a/etc/NEWS b/etc/NEWS index 957b0c2..37eb2bc 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -718,6 +718,10 @@ text in the region. The search engine to use for this is specified by the customizable variable `eww-search-prefix'. +++ +*** Images that have rotation specified in the EXIF headers are now +automatically rotated (if displayed as ImageMagick images). + ++++ *** Query-replace history is enhanced. When query-replace reads the FROM string from the minibuffer, typing `M-p' will now show previous replacements as "FROM SEP TO", where FROM commit 48b19a4494b1fbe2001d773a2a2c9ede5a557e00 Author: Dima Kogan Date: Wed Feb 10 15:40:03 2016 +1100 Support integer image rotation and respect EXIF rotations * src/image.c (imagemagick_load_image): Allow integer rotations in addition to floating point rotations (bug#22591). * src/image.c (imagemagick_load_image): Images that have an orientation given in EXIF and have no explicit :rotation tag are now pre-rotated. All information such as width/height is reported for the rotated image. diff --git a/src/image.c b/src/image.c index ea5d231..e1b167d 100644 --- a/src/image.c +++ b/src/image.c @@ -8560,6 +8560,16 @@ imagemagick_load_image (struct frame *f, struct image *img, return 0; } + /* If no :rotation is explicitly specified, apply the automatic + rotation from EXIF. */ + if (NILP (image_spec_value (img->spec, QCrotation, NULL))) + if (MagickAutoOrientImage (image_wand) == MagickFalse) + { + image_error ("Error applying automatic orientation in image `%s'", img->spec); + DestroyMagickWand (image_wand); + return 0; + } + if (ino < 0 || ino >= MagickGetNumberImages (image_wand)) { image_error ("Invalid image number `%s' in image `%s'", image, img->spec); @@ -8660,7 +8670,7 @@ imagemagick_load_image (struct frame *f, struct image *img, image_spec_value (img->spec, QCbackground, NULL); if (!STRINGP (specified_bg). */ value = image_spec_value (img->spec, QCrotation, NULL); - if (FLOATP (value)) + if (FLOATP (value) || INTEGERP (value)) { rotation = extract_float (value); status = MagickRotateImage (image_wand, bg_wand, rotation); commit e0775d7f7f13eed330d711f604da568453c7eb1d Author: Wolfgang Jenkner Date: Wed Feb 10 16:33:18 2016 +0100 * lisp/net/shr.el (image-map): Defvar it. (Bug#22614) diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 339f877..b1f2f07 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -189,6 +189,8 @@ and other things: (define-key map "\r" 'shr-browse-url) map)) +(defvar image-map nil) ;in case image.el is not pre-loaded + (defvar shr-image-map (let ((map (copy-keymap shr-map))) (set-keymap-parent map image-map)