commit ba1422e12f80ae1eb2aa9d0ce80c14e3ee4b3950 (HEAD, refs/remotes/origin/master) Author: Nicolas Petton Date: Sun Feb 14 10:28:26 2016 +0100 * doc/lispref/sequences.texi: Add documentation for seq-map-indexed diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index 9869fe4..002a9ce 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -572,6 +572,21 @@ element of @var{sequence}. The returned value is a list. @end example @end defun +@defun seq-map-indexed function sequence + This function returns the result of applying @var{function} to each +element of @var{sequence} and its index within @var{seq}. The +returned value is a list. + +@example +@group +(seq-map-indexed (lambda (elt idx) + (list idx elt)) + '(a b c)) +@result{} ((0 a) (b 1) (c 2)) +@end group +@end example +@end defun + @defun seq-mapn function &rest sequences This function returns the result of applying @var{function} to each element of @var{sequences}. The arity of @var{function} must match commit 30fe90fa3c8f814a30a5136089b995b0a26f5cd0 Author: Nicolas Petton Date: Sun Feb 14 10:25:10 2016 +0100 New function seq-map-indexed * lisp/emacs-lisp/seq.el (seq-map-indexed): New function. * test/lisp/emacs-lisp/seq-tests.el: Add tests for seq-map-indexed. diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 300fe5c..8b7b594 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -144,6 +144,18 @@ if positive or too small if negative)." sequence) (nreverse result))) +(defun seq-map-indexed (function sequence) + "Return the result of applying FUNCTION to each element of SEQUENCE. +Unlike `seq-map', FUNCTION takes two arguments: the element of +the sequence, and its index within the sequence." + (let ((index 0)) + (seq-map (lambda (elt) + (prog1 + (funcall function elt index) + (setq index (1+ index)))) + sequence))) + + ;; faster implementation for sequences (sequencep) (cl-defmethod seq-map (function (sequence sequence)) (mapcar function sequence)) diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el index a8ca48b..c9219b5 100644 --- a/test/lisp/emacs-lisp/seq-tests.el +++ b/test/lisp/emacs-lisp/seq-tests.el @@ -97,6 +97,16 @@ Evaluate BODY for each created sequence. (with-test-sequences (seq '()) (should (seq-empty-p (seq-take-while #'test-sequences-oddp seq))))) +(ert-deftest test-seq-map-indexed () + (should (equal (seq-map-indexed (lambda (elt i) + (list elt i)) + nil) + nil)) + (should (equal (seq-map-indexed (lambda (elt i) + (list elt i)) + '(a b c d)) + '((a 0) (b 1) (c 2) (d 3))))) + (ert-deftest test-seq-filter () (with-test-sequences (seq '(6 7 8 9 10)) (should (equal (seq-filter #'test-sequences-evenp seq) '(6 8 10))) commit d9bf0c1c6a6ce90aa2edbb911fb58b26975d423b Author: Lars Ingebrigtsen Date: Sun Feb 14 18:21:56 2016 +1100 * lisp/gnus/mm-util.el: Remove the mm-string-as-multibyte alias. diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 51fcd8b..89dc608c 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -1806,7 +1806,7 @@ If RECURSIVE, search recursively." nil t)) (not (eq charset 'ascii))) (decode-coding-string (buffer-string) charset) - (mm-string-as-multibyte (buffer-string))) + (string-as-multibyte (buffer-string))) (erase-buffer) (mm-enable-multibyte))) (goto-char (point-min)) diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index 234ad3d..c0f8742 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -29,39 +29,6 @@ (defvar mm-mime-mule-charset-alist) -;; Emulate functions that are not available in every (X)Emacs version. -;; The name of a function is prefixed with mm-, like `mm-char-int' for -;; `char-int' that is a native XEmacs function, not available in Emacs. -;; Gnus programs all should use mm- functions, not the original ones. -(eval-and-compile - (mapc - (lambda (elem) - (let ((nfunc (intern (format "mm-%s" (car elem))))) - (if (fboundp (car elem)) - (defalias nfunc (car elem)) - (defalias nfunc (cdr elem))))) - `( - ;; string-as-multibyte often doesn't really do what you think it does. - ;; Example: - ;; (aref (string-as-multibyte "\201") 0) -> 129 (aka ?\201) - ;; (aref (string-as-multibyte "\300") 0) -> 192 (aka ?\300) - ;; (aref (string-as-multibyte "\300\201") 0) -> 192 (aka ?\300) - ;; (aref (string-as-multibyte "\300\201") 1) -> 129 (aka ?\201) - ;; but - ;; (aref (string-as-multibyte "\201\300") 0) -> 2240 - ;; (aref (string-as-multibyte "\201\300") 1) -> - ;; Better use string-to-multibyte or encode-coding-string. - ;; If you really need string-as-multibyte somewhere it's usually - ;; because you're using the internal emacs-mule representation (maybe - ;; because you're using string-as-unibyte somewhere), which is - ;; generally a problem in itself. - ;; Here is an approximate equivalence table to help think about it: - ;; (string-as-multibyte s) ~= (decode-coding-string s 'emacs-mule) - ;; (string-to-multibyte s) ~= (decode-coding-string s 'binary) - ;; (string-make-multibyte s) ~= (decode-coding-string s locale-coding-system) - ;; `string-as-multibyte' is an Emacs function, not available in XEmacs. - (string-as-multibyte . identity)))) - (defun mm-ucs-to-char (codepoint) "Convert Unicode codepoint to character." (or (decode-char 'ucs codepoint) ?#)) diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index f9d6cd8..97cc87d 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -664,7 +664,7 @@ be \"related\" or \"alternate\"." (if (setq encoding (cdr (assq 'encoding cont))) (setq encoding (intern (downcase encoding)))) (setq encoding (mm-encode-buffer type encoding) - coded (mm-string-as-multibyte (buffer-string)))) + coded (string-as-multibyte (buffer-string)))) (mml-insert-mime-headers cont type charset encoding nil) (insert "\n" coded)))) ((eq (car cont) 'external) diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index 1af04fd..94589e1 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el @@ -1245,7 +1245,7 @@ Return the number of characters in the body." (insert (format "Xref: %s" (system-name))) (while group-alist (insert (if (mm-multibyte-p) - (mm-string-as-multibyte + (string-as-multibyte (format " %s:%d" (caar group-alist) (cdar group-alist))) (string-as-unibyte (format " %s:%d" (caar group-alist) (cdar group-alist))))) commit 91823195c55a0e1ef9c3f9e72338658fd5c5207e Author: Lars Ingebrigtsen Date: Sun Feb 14 17:47:33 2016 +1100 Fix problem with wrong encoding of non-ASCII message bodies * lisp/gnus/mml.el (mml-generate-mime-1): Disable multibyteness before encoding the data. diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index d9cf15f..f9d6cd8 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -631,6 +631,7 @@ be \"related\" or \"alternate\"." (let ((mm-coding-system-priorities (cons 'utf-8 mm-coding-system-priorities))) (setq charset (mm-encode-body)))) + (mm-disable-multibyte) (setq encoding (mm-body-encoding charset (cdr (assq 'encoding cont)))))) (setq coded (buffer-string))) commit 0ba42383e24f5ed5fd758ea0afac17fed1d9dc46 Author: Lars Ingebrigtsen Date: Sun Feb 14 17:19:24 2016 +1100 Remove codepage setup code from mm-util * lisp/gnus/mm-util.el (mm-codepage-setup): Remove. (mm-codepage-iso-8859-list): Remove. (mm-codepage-ibm-list, mm-setup-codepage-iso-8859) (mm-setup-codepage-ibm): Remove. (mm-charset-eval-alist): Remove the code pages from the default value. diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index a67bc30..234ad3d 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -27,11 +27,7 @@ (require 'mail-prsvr) (require 'timer) -(defvar mm-mime-mule-charset-alist ) -;; Note this is not presently used on Emacs >= 23, which is good, -;; since it means standalone message-mode (which requires mml and -;; hence mml-util) does not load gnus-util. -(autoload 'gnus-completing-read "gnus-util") +(defvar mm-mime-mule-charset-alist) ;; Emulate functions that are not available in every (X)Emacs version. ;; The name of a function is prefixed with mm-, like `mm-char-int' for @@ -125,169 +121,17 @@ (mm-coding-system-p 'iso-8859-1)) '((iso_8859-1 . iso-8859-1))) ) - "A mapping from unknown or invalid charset names to the real charset names. - -See `mm-codepage-iso-8859-list' and `mm-codepage-ibm-list'.") - -(defun mm-codepage-setup (number &optional alias) - "Create a coding system cpNUMBER. -The coding system is created using `codepage-setup'. If ALIAS is -non-nil, an alias is created and added to -`mm-charset-synonym-alist'. If ALIAS is a string, it's used as -the alias. Else windows-NUMBER is used." - (interactive - (let ((completion-ignore-case t) - (candidates (if (fboundp 'cp-supported-codepages) - (cp-supported-codepages) - ;; Removed in Emacs 23 (unicode), so signal an error: - (error "`codepage-setup' not present in this Emacs version")))) - (list (gnus-completing-read "Setup DOS Codepage" candidates - t nil nil "437")))) - (when alias - (setq alias (if (stringp alias) - (intern alias) - (intern (format "windows-%s" number))))) - (let* ((cp (intern (format "cp%s" number)))) - (unless (mm-coding-system-p cp) - (if (fboundp 'codepage-setup) ; silence compiler - (codepage-setup number) - (error "`codepage-setup' not present in this Emacs version"))) - (when (and alias - ;; Don't add alias if setup of cp failed. - (mm-coding-system-p cp)) - (add-to-list 'mm-charset-synonym-alist (cons alias cp))))) - -(defcustom mm-codepage-iso-8859-list - (list 1250 ;; Windows-1250 is a variant of Latin-2 heavily used by Microsoft - ;; Outlook users in Czech republic. Use this to allow reading of - ;; their e-mails. - '(1252 . 1) ;; Windows-1252 is a superset of iso-8859-1 (West - ;; Europe). See also `gnus-article-dumbquotes-map'. - '(1254 . 9) ;; Windows-1254 is a superset of iso-8859-9 (Turkish). - '(1255 . 8));; Windows-1255 is a superset of iso-8859-8 (Hebrew). - "A list of Windows codepage numbers and iso-8859 charset numbers. - -If an element is a number corresponding to a supported windows -codepage, appropriate entries to `mm-charset-synonym-alist' are -added by `mm-setup-codepage-iso-8859'. An element may also be a -cons cell where the car is a codepage number and the cdr is the -corresponding number of an iso-8859 charset." - :type '(list (set :inline t - (const 1250 :tag "Central and East European") - (const (1252 . 1) :tag "West European") - (const (1254 . 9) :tag "Turkish") - (const (1255 . 8) :tag "Hebrew")) - (repeat :inline t - :tag "Other options" - (choice - (integer :tag "Windows codepage number") - (cons (integer :tag "Windows codepage number") - (integer :tag "iso-8859 charset number"))))) - :version "22.1" ;; Gnus 5.10.9 - :group 'mime) - -(defcustom mm-codepage-ibm-list - (list 437 ;; (US etc.) - 860 ;; (Portugal) - 861 ;; (Iceland) - 862 ;; (Israel) - 863 ;; (Canadian French) - 865 ;; (Nordic) - 852 ;; - 850 ;; (Latin 1) - 855 ;; (Cyrillic) - 866 ;; (Cyrillic - Russian) - 857 ;; (Turkish) - 864 ;; (Arabic) - 869 ;; (Greek) - 874);; (Thai) - ;; In Emacs 23 (unicode), cp... and ibm... are aliases. - ;; Cf. http://thread.gmane.org/v9lkng5nwy.fsf@marauder.physik.uni-ulm.de - "List of IBM codepage numbers. - -The codepage mappings slightly differ between IBM and other vendors. -See \"ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/IBM/README.TXT\". - -If an element is a number corresponding to a supported windows -codepage, appropriate entries to `mm-charset-synonym-alist' are -added by `mm-setup-codepage-ibm'." - :type '(list (set :inline t - (const 437 :tag "US etc.") - (const 860 :tag "Portugal") - (const 861 :tag "Iceland") - (const 862 :tag "Israel") - (const 863 :tag "Canadian French") - (const 865 :tag "Nordic") - (const 852) - (const 850 :tag "Latin 1") - (const 855 :tag "Cyrillic") - (const 866 :tag "Cyrillic - Russian") - (const 857 :tag "Turkish") - (const 864 :tag "Arabic") - (const 869 :tag "Greek") - (const 874 :tag "Thai")) - (repeat :inline t - :tag "Other options" - (integer :tag "Codepage number"))) - :version "22.1" ;; Gnus 5.10.9 - :group 'mime) - -(defun mm-setup-codepage-iso-8859 (&optional list) - "Add appropriate entries to `mm-charset-synonym-alist'. -Unless LIST is given, `mm-codepage-iso-8859-list' is used." - (unless list - (setq list mm-codepage-iso-8859-list)) - (dolist (i list) - (let (cp windows iso) - (if (consp i) - (setq cp (intern (format "cp%d" (car i))) - windows (intern (format "windows-%d" (car i))) - iso (intern (format "iso-8859-%d" (cdr i)))) - (setq cp (intern (format "cp%d" i)) - windows (intern (format "windows-%d" i)))) - (unless (mm-coding-system-p windows) - (if (mm-coding-system-p cp) - (add-to-list 'mm-charset-synonym-alist (cons windows cp)) - (add-to-list 'mm-charset-synonym-alist (cons windows iso))))))) - -(defun mm-setup-codepage-ibm (&optional list) - "Add appropriate entries to `mm-charset-synonym-alist'. -Unless LIST is given, `mm-codepage-ibm-list' is used." - (unless list - (setq list mm-codepage-ibm-list)) - (dolist (number list) - (let ((ibm (intern (format "ibm%d" number))) - (cp (intern (format "cp%d" number)))) - (when (and (not (mm-coding-system-p ibm)) - (mm-coding-system-p cp)) - (add-to-list 'mm-charset-synonym-alist (cons ibm cp)))))) - -;; Initialize: -(mm-setup-codepage-iso-8859) -(mm-setup-codepage-ibm) + "A mapping from unknown or invalid charset names to the real charset names.") ;; Note: this has to be defined before `mm-charset-to-coding-system'. -(defcustom mm-charset-eval-alist - '( - ;; Emacs 22 provides autoloads for 1250-1258 - ;; (i.e. `mm-codepage-setup' does nothing). - (windows-1250 . (mm-codepage-setup 1250 t)) - (windows-1251 . (mm-codepage-setup 1251 t)) - (windows-1253 . (mm-codepage-setup 1253 t)) - (windows-1257 . (mm-codepage-setup 1257 t))) +(defcustom mm-charset-eval-alist nil "An alist of (CHARSET . FORM) pairs. If an article is encoded in an unknown CHARSET, FORM is evaluated. This allows the loading of additional libraries providing charsets on demand. If supported by your Emacs version, you could use `autoload-coding-system' here." :version "22.1" ;; Gnus 5.10.9 - :type '(list (set :inline t - (const (windows-1250 . (mm-codepage-setup 1250 t))) - (const (windows-1251 . (mm-codepage-setup 1251 t))) - (const (windows-1253 . (mm-codepage-setup 1253 t))) - (const (windows-1257 . (mm-codepage-setup 1257 t))) - (const (cp850 . (mm-codepage-setup 850 nil)))) - (repeat :inline t + :type '(list (repeat :inline t :tag "Other options" (cons (symbol :tag "charset") (symbol :tag "form")))) commit 66d9ef95c0f9407d2a6d26bcd7ed84a303294b53 Author: Lars Ingebrigtsen Date: Sun Feb 14 17:07:48 2016 +1100 Remove compat code for older Emacsen * lisp/gnus/gnus-art.el (gnus-button-url-regexp): Remove XEmacs compat code. * lisp/gnus/gnus-sync.el (gnus-sync-json-alist-p): Remove unused compat function. (gnus-sync-json-plist-p): Ditto. * lisp/gnus/message.el (message-default-charset): Make obsolete. (message-info): Remove compat code. (message-setup-fill-variables): Remove kludge needed earlier to not overwrite `normal-auto-fill-function'. (message-split-line): Remove compat code. * lisp/gnus/mm-view.el (mm-display-inline-fontify): Remove compat code. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index a2dc82e..c66ca53 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2283,8 +2283,6 @@ long lines if and only if arg is positive." (setq truncate-lines nil)) ((numberp arg) (setq truncate-lines t))) - ;; In versions of Emacs 22 (CVS) before 2006-05-26, - ;; `toggle-truncate-lines' needs an argument. (toggle-truncate-lines))) (defun gnus-article-treat-body-boundary () @@ -4481,8 +4479,8 @@ commands: (make-local-variable 'gnus-article-ignored-charsets) (set (make-local-variable 'bookmark-make-record-function) 'gnus-summary-bookmark-make-record) - ;; Prevent Emacs 22 from displaying non-break space with `nobreak-space' - ;; face. + ;; Prevent Emacs from displaying non-break space with + ;; `nobreak-space' face. (set (make-local-variable 'nobreak-char-display) nil) ;; Enable `gnus-article-remove-images' to delete images shr.el renders. (set (make-local-variable 'shr-put-image-function) 'gnus-shr-put-image) @@ -6567,7 +6565,7 @@ Argument LINES specifies lines to be scrolled up." (defun gnus-article-beginning-of-window () "Move point to the beginning of the window. -In Emacs, the point is placed at the line number which `scroll-margin' +The point is placed at the line number which `scroll-margin' specifies." ;; There is an obscure bug in Emacs that makes it impossible to ;; scroll past big pictures in the article buffer. Try to fix @@ -6793,7 +6791,7 @@ not have a face in `gnus-article-boring-faces'." (defun gnus-article-describe-key (key) "Display documentation of the function invoked by KEY. KEY is a string or a vector." - (interactive (list (let ((cursor-in-echo-area t)) ;; better for XEmacs. + (interactive (list (let ((cursor-in-echo-area t)) (read-key-sequence "Describe key: ")))) (gnus-article-check-buffer) (if (memq (key-binding key t) '(gnus-article-read-summary-keys @@ -6814,7 +6812,7 @@ KEY is a string or a vector." (defun gnus-article-describe-key-briefly (key &optional insert) "Display documentation of the function invoked by KEY. KEY is a string or a vector." - (interactive (list (let ((cursor-in-echo-area t)) ;; better for XEmacs. + (interactive (list (let ((cursor-in-echo-area t)) (read-key-sequence "Describe key: ")) current-prefix-arg)) (gnus-article-check-buffer) @@ -7355,21 +7353,17 @@ groups." "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|" "nntp\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)" "\\(//[-a-z0-9_.]+:[0-9]*\\)?" - (if (string-match "[[:digit:]]" "1") ;; Support POSIX? - (let ((chars "-a-z0-9_=#$@~%&*+\\/[:word:]") - (punct "!?:;.,")) - (concat - "\\(?:" - ;; Match paired parentheses, e.g. in Wikipedia URLs: - ;; http://thread.gmane.org/47B4E3B2.3050402@gmail.com - "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)" - "\\(?:" "[" chars punct "]+" "[" chars "]" "\\)?" - "\\|" - "[" chars punct "]+" "[" chars "]" - "\\)")) - (concat ;; XEmacs 21.4 doesn't support POSIX. - "\\([-a-z0-9_=!?#$@~%&*+\\/:;.,]\\|\\w\\)+" - "\\([-a-z0-9_=#$@~%&*+\\/]\\|\\w\\)")) + (let ((chars "-a-z0-9_=#$@~%&*+\\/[:word:]") + (punct "!?:;.,")) + (concat + "\\(?:" + ;; Match paired parentheses, e.g. in Wikipedia URLs: + ;; http://thread.gmane.org/47B4E3B2.3050402@gmail.com + "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)" + "\\(?:" "[" chars punct "]+" "[" chars "]" "\\)?" + "\\|" + "[" chars punct "]+" "[" chars "]" + "\\)")) "\\)") "Regular expression that matches URLs." :version "24.4" diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el index 38cfa44..93545ff 100644 --- a/lisp/gnus/gnus-int.el +++ b/lisp/gnus/gnus-int.el @@ -777,8 +777,7 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned." (message-options-set-recipient) (save-restriction (message-narrow-to-head) - (let ((mail-parse-charset message-default-charset)) - (mail-encode-encoded-word-buffer))) + (mail-encode-encoded-word-buffer)) (message-encode-message-body))) (let ((gnus-command-method (or gnus-command-method (gnus-find-method-for-group group))) @@ -800,8 +799,7 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned." (message-options-set-recipient) (save-restriction (message-narrow-to-head) - (let ((mail-parse-charset message-default-charset)) - (mail-encode-encoded-word-buffer))) + (mail-encode-encoded-word-buffer)) (message-encode-message-body))) (let* ((func (car (gnus-group-name-to-method group))) (result (funcall (intern (format "%s-request-replace-article" func)) diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 5859fba..8cabe01 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1658,8 +1658,7 @@ this is a reply." (run-hooks 'gnus-gcc-post-body-encode-hook) (save-restriction (message-narrow-to-headers) - (let* ((mail-parse-charset message-default-charset) - (newsgroups-field (save-restriction + (let* ((newsgroups-field (save-restriction (message-narrow-to-headers-or-head) (message-fetch-field "Newsgroups"))) (followup-field (save-restriction diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index e651c05..6b3add2 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -2562,7 +2562,7 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) (easy-menu-define gnus-article-commands-menu gnus-article-mode-map "" (cons "Commands" innards)) - ;; in Emacs, don't share menu. + ;; Don't share the menu. (setq gnus-article-commands-menu (copy-keymap gnus-summary-article-menu)) (define-key gnus-article-mode-map [menu-bar commands] diff --git a/lisp/gnus/gnus-sync.el b/lisp/gnus/gnus-sync.el index cd8a753..249eb08 100644 --- a/lisp/gnus/gnus-sync.el +++ b/lisp/gnus/gnus-sync.el @@ -201,27 +201,6 @@ KVDATA must be an alist." (defun gnus-sync-lesync-DELETE (url headers &optional data) (gnus-sync-lesync-call url "DELETE" headers data)) -;; this is not necessary with newer versions of json.el but 1.2 or older -;; (which are in Emacs 24.1 and earlier) need it -(defun gnus-sync-json-alist-p (list) - "Non-null if and only if LIST is an alist." - (while (consp list) - (setq list (if (consp (car list)) - (cdr list) - 'not-alist))) - (null list)) - -;; this is not necessary with newer versions of json.el but 1.2 or older -;; (which are in Emacs 24.1 and earlier) need it -(defun gnus-sync-json-plist-p (list) - "Non-null if and only if LIST is a plist." - (while (consp list) - (setq list (if (and (keywordp (car list)) - (consp (cdr list))) - (cddr list) - 'not-plist))) - (null list)) - ; (gnus-sync-lesync-setup "http://lesync.info:5984/tzz" "tzzadmin" "mypassword" "mysalt" t t) ; (gnus-sync-lesync-setup "http://lesync.info:5984/tzz") diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index d9ea50b..7d3c708 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1503,7 +1503,7 @@ CHOICE is a list of the choice char and help message at IDX." (setq tchar nil) (setq buf (get-buffer-create "*Gnus Help*")) (pop-to-buffer buf) - (fundamental-mode) ; for Emacs 20.4+ + (fundamental-mode) (buffer-disable-undo) (erase-buffer) (insert prompt ":\n\n") diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el index 21398d1..ebc9c97 100644 --- a/lisp/gnus/mail-source.el +++ b/lisp/gnus/mail-source.el @@ -995,7 +995,6 @@ This only works when `display-time' is enabled." (if on (progn (require 'time) - ;; display-time-mail-function is an Emacs feature. (setq display-time-mail-function #'mail-source-new-mail-p) ;; Set up the main timer. (setq mail-source-report-new-mail-timer diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 51b6c93..cc147b3 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -49,7 +49,7 @@ (require 'mm-util) (require 'rfc2047) -(autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/ +(autoload 'mailclient-send-it "mailclient") (defvar gnus-message-group-art) (defvar gnus-list-identifiers) ; gnus-sum is required where necessary @@ -1342,14 +1342,16 @@ If nil, Message won't auto-save." :link '(custom-manual "(message)Various Message Variables") :type '(choice directory (const :tag "Don't auto-save" nil))) -(defcustom message-default-charset - (and (not (mm-multibyte-p)) 'iso-8859-1) +(defcustom message-default-charset (and (not (mm-multibyte-p)) 'iso-8859-1) "Default charset used in non-MULE Emacsen. If nil, you might be asked to input the charset." :version "21.1" :group 'message :link '(custom-manual "(message)Various Message Variables") :type 'symbol) +(make-obsolete-variable + 'message-default-charset + "The default charset comes from the language environment" "25.2") (defcustom message-dont-reply-to-names mail-dont-reply-to-names "Addresses to prune when doing wide replies. @@ -2625,8 +2627,7 @@ PGG manual, depending on the value of `mml2015-use'." (require 'mml2015) mml2015-use) ((eq arg 4) 'emacs-mime) - ;; `booleanp' only available in Emacs 22+ - ((and (not (memq arg '(nil t))) + ((and (not (booleanp arg)) (symbolp arg)) arg) (t @@ -2873,8 +2874,6 @@ See also `message-forbidden-properties'." (inhibit-read-only t)) (remove-text-properties begin end message-forbidden-properties)))) -(autoload 'ecomplete-setup "ecomplete") ;; for Emacs <23. - (defvar message-smileys '(":-)" ":)" ":-(" ":(" ";-)" ";)") @@ -3032,20 +3031,8 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." (setq adaptive-fill-first-line-regexp (concat quote-prefix-regexp "\\|" adaptive-fill-first-line-regexp))) - (make-local-variable 'auto-fill-inhibit-regexp) - ;;(setq auto-fill-inhibit-regexp "^[A-Z][^: \n\t]+:") - (setq auto-fill-inhibit-regexp nil) - (make-local-variable 'normal-auto-fill-function) - (setq normal-auto-fill-function 'message-do-auto-fill) - ;; KLUDGE: auto fill might already be turned on in `text-mode-hook'. - ;; In that case, ensure that it uses the right function. The real - ;; solution would be not to use `define-derived-mode', and run - ;; `text-mode-hook' ourself at the end of the mode. - ;; -- Per Abrahamsen Date: 2001-10-19. - ;; This kludge is unneeded in Emacs>=21 since define-derived-mode is - ;; now careful to run parent hooks after the body. --Stef - (when auto-fill-function - (setq auto-fill-function normal-auto-fill-function))) + (setq-default auto-fill-inhibit-regexp nil) + (setq-default normal-auto-fill-function 'message-do-auto-fill)) @@ -6118,10 +6105,7 @@ Headers already prepared in the buffer are not modified." "Split current line, moving portion beyond point vertically down. If the current line has `message-yank-prefix', insert it on the new line." (interactive "*") - (condition-case nil - (split-line message-yank-prefix) ;; Emacs 22.1+ supports arg. - (error - (split-line)))) + (split-line message-yank-prefix)) (defun message-insert-header (header value) (insert (capitalize (symbol-name header)) @@ -7239,7 +7223,7 @@ header line with the old Message-ID." (cond ((save-window-excursion (with-output-to-temp-buffer "*Directory*" (with-current-buffer standard-output - (fundamental-mode)) ; for Emacs 20.4+ + (fundamental-mode)) (buffer-disable-undo standard-output) (let ((default-directory "/")) (call-process @@ -8031,7 +8015,7 @@ The following arguments may contain lists of values." (save-window-excursion (with-output-to-temp-buffer " *MESSAGE information message*" (with-current-buffer " *MESSAGE information message*" - (fundamental-mode) ; for Emacs 20.4+ + (fundamental-mode) (mapc 'princ text) (goto-char (point-min)))) (funcall ask question)) diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index 31c8cce..c62ea95 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el @@ -458,11 +458,7 @@ If MODE is not set, try to find mode automatically." (unless charset (setq coding-system (mm-find-buffer-file-coding-system))) (setq text (buffer-string)))) - ;; XEmacs @#$@ version of font-lock refuses to fully turn itself - ;; on for buffers whose name begins with " ". That's why we use - ;; `with-current-buffer'/`generate-new-buffer' rather than - ;; `with-temp-buffer'. - (with-current-buffer (generate-new-buffer "*fontification*") + (with-temp-buffer (buffer-disable-undo) (mm-enable-multibyte) (insert (cond ((eq charset 'gnus-decoded) @@ -500,8 +496,7 @@ If MODE is not set, try to find mode automatically." (setq text (buffer-string)) ;; Set buffer unmodified to avoid confirmation when killing the ;; buffer. - (set-buffer-modified-p nil) - (kill-buffer (current-buffer))) + (set-buffer-modified-p nil)) (mm-insert-inline handle text))) ;; Shouldn't these functions check whether the user even wants to use diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index 52a9db2..1af04fd 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el @@ -2018,13 +2018,13 @@ If TIME is nil, then return the cutoff time for oldness instead." (error "No current split history")) (with-output-to-temp-buffer "*nnmail split history*" (with-current-buffer standard-output - (fundamental-mode)) ; for Emacs 20.4+ - (dolist (elem nnmail-split-history) - (princ (mapconcat (lambda (ga) - (concat (car ga) ":" (int-to-string (cdr ga)))) - elem - ", ")) - (princ "\n")))) + (fundamental-mode)) + (dolist (elem nnmail-split-history) + (princ (mapconcat (lambda (ga) + (concat (car ga) ":" (int-to-string (cdr ga)))) + elem + ", ")) + (princ "\n")))) (defun nnmail-purge-split-history (group) "Remove all instances of GROUP from `nnmail-split-history'." commit 9de3de8cbf0e63de7e11d6f2051fc3ad891c613c Author: Lars Ingebrigtsen Date: Sun Feb 14 16:35:24 2016 +1100 Remove some compat functions from gmm-utils.el * lisp/gnus/gmm-utils.el (gmm-tool-bar-from-list): Remove compat code. (gmm-image-search-load-path): Remove. (gmm-image-load-path-for-library): Remove. diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el index 34db4bd..785a286 100644 --- a/lisp/gnus/gmm-utils.el +++ b/lisp/gnus/gmm-utils.el @@ -198,15 +198,13 @@ item. When \\[describe-key] shows \" runs the command find-file\", then use `new-file' in ZAP-LIST. DEFAULT-MAP specifies the default key map for ICON-LIST." - (let (;; For Emacs 21, we must let-bind `tool-bar-map'. In Emacs 22, we - ;; could use some other local variable. - (tool-bar-map (if (eq zap-list t) - (make-sparse-keymap) - (copy-keymap tool-bar-map)))) + (let ((map (if (eq zap-list t) + (make-sparse-keymap) + (copy-keymap tool-bar-map)))) (when (listp zap-list) ;; Zap some items which aren't relevant for this mode and take up space. (dolist (key zap-list) - (define-key tool-bar-map (vector key) nil))) + (define-key map (vector key) nil))) (mapc (lambda (el) (let ((command (car el)) (icon (nth 1 el)) @@ -218,7 +216,7 @@ DEFAULT-MAP specifies the default key map for ICON-LIST." ;; widget. Suppress tooltip by adding `:enable nil'. (if (fboundp 'tool-bar-local-item) (apply 'tool-bar-local-item icon nil nil - tool-bar-map :enable nil props) + map :enable nil props) ;; (tool-bar-local-item ICON DEF KEY MAP &rest PROPS) ;; (tool-bar-add-item ICON DEF KEY &rest PROPS) (apply 'tool-bar-add-item icon nil nil :enable nil props))) @@ -226,18 +224,18 @@ DEFAULT-MAP specifies the default key map for ICON-LIST." (apply 'tool-bar-local-item icon command (intern icon) ;; reuse icon or fmap here? - tool-bar-map props)) + map props)) (t ;; A menu command (apply 'tool-bar-local-item-from-menu ;; (apply 'tool-bar-local-item icon def key ;; tool-bar-map props) - command icon tool-bar-map (symbol-value fmap) + command icon map (symbol-value fmap) props))) t)) (if (symbolp icon-list) (eval icon-list) icon-list)) - tool-bar-map)) + map)) (defmacro defun-gmm (name function arg-list &rest body) "Create function NAME. @@ -248,109 +246,6 @@ Otherwise, create function NAME with ARG-LIST and BODY." `(defalias ',name ',function) `(defun ,name ,arg-list ,@body)))) -(defun-gmm gmm-image-search-load-path - image-search-load-path (file &optional path) - "Emacs 21 and XEmacs don't have `image-search-load-path'. -This function returns nil on those systems." - nil) - -;; Cf. `mh-image-load-path-for-library' in `mh-compat.el'. - -(defun-gmm gmm-image-load-path-for-library - image-load-path-for-library (library image &optional path no-error) - "Return a suitable search path for images used by LIBRARY. - -It searches for IMAGE in `image-load-path' (excluding -\"`data-directory'/images\") and `load-path', followed by a path -suitable for LIBRARY, which includes \"../../etc/images\" and -\"../etc/images\" relative to the library file itself, and then -in \"`data-directory'/images\". - -Then this function returns a list of directories which contains -first the directory in which IMAGE was found, followed by the -value of `load-path'. If PATH is given, it is used instead of -`load-path'. - -If NO-ERROR is non-nil and a suitable path can't be found, don't -signal an error. Instead, return a list of directories as before, -except that nil appears in place of the image directory. - -Here is an example that uses a common idiom to provide -compatibility with versions of Emacs that lack the variable -`image-load-path': - - ;; Shush compiler. - (defvar image-load-path) - - (let* ((load-path (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\")) - (image-load-path (cons (car load-path) - (when (boundp \\='image-load-path) - image-load-path)))) - (mh-tool-bar-folder-buttons-init))" - (unless library (error "No library specified")) - (unless image (error "No image specified")) - (let (image-directory image-directory-load-path) - ;; Check for images in image-load-path or load-path. - (let ((img image) - (dir (or - ;; Images in image-load-path. - (image-search-load-path image) - ;; Images in load-path. - (locate-library image))) - parent) - ;; Since the image might be in a nested directory (for - ;; example, mail/attach.pbm), adjust `image-directory' - ;; accordingly. - (when dir - (setq dir (file-name-directory dir)) - (while (setq parent (file-name-directory img)) - (setq img (directory-file-name parent) - dir (expand-file-name "../" dir)))) - (setq image-directory-load-path dir)) - - ;; If `image-directory-load-path' isn't Emacs's image directory, - ;; it's probably a user preference, so use it. Then use a - ;; relative setting if possible; otherwise, use - ;; `image-directory-load-path'. - (cond - ;; User-modified image-load-path? - ((and image-directory-load-path - (not (equal image-directory-load-path - (file-name-as-directory - (expand-file-name "images" data-directory))))) - (setq image-directory image-directory-load-path)) - ;; Try relative setting. - ((let (library-name d1ei d2ei) - ;; First, find library in the load-path. - (setq library-name (locate-library library)) - (if (not library-name) - (error "Cannot find library %s in load-path" library)) - ;; And then set image-directory relative to that. - (setq - ;; Go down 2 levels. - d2ei (file-name-as-directory - (expand-file-name - (concat (file-name-directory library-name) "../../etc/images"))) - ;; Go down 1 level. - d1ei (file-name-as-directory - (expand-file-name - (concat (file-name-directory library-name) "../etc/images")))) - (setq image-directory - ;; Set it to nil if image is not found. - (cond ((file-exists-p (expand-file-name image d2ei)) d2ei) - ((file-exists-p (expand-file-name image d1ei)) d1ei))))) - ;; Use Emacs's image directory. - (image-directory-load-path - (setq image-directory image-directory-load-path)) - (no-error - (message "Could not find image %s for library %s" image library)) - (t - (error "Could not find image %s for library %s" image library))) - - ;; Return an augmented `path' or `load-path'. - (nconc (list image-directory) - (delete image-directory (copy-sequence (or path load-path)))))) - (defun gmm-customize-mode (&optional mode) "Customize customization group for MODE. If mode is nil, use `major-mode' of the current buffer." diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 34ec110..f42f798 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1084,9 +1084,8 @@ When FORCE, rebuild the tool bar." (display-graphic-p) (or (not gnus-group-tool-bar-map) force)) (let* ((load-path - (gmm-image-load-path-for-library "gnus" - "gnus/toggle-subscription.xpm" - nil t)) + (image-load-path-for-library + "gnus" "gnus/toggle-subscription.xpm" nil t)) (image-load-path (cons (car load-path) image-load-path)) (map (gmm-tool-bar-from-list gnus-group-tool-bar gnus-group-tool-bar-zap-list diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index d3e5ece..e651c05 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -2938,9 +2938,7 @@ When FORCE, rebuild the tool bar." tool-bar-mode (or (not gnus-summary-tool-bar-map) force)) (let* ((load-path - (gmm-image-load-path-for-library "gnus" - "mail/save.xpm" - nil t)) + (image-load-path-for-library "gnus" "mail/save.xpm" nil t)) (image-load-path (cons (car load-path) image-load-path)) (map (gmm-tool-bar-from-list gnus-summary-tool-bar gnus-summary-tool-bar-zap-list diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index f570ff4..51b6c93 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -7902,9 +7902,8 @@ When FORCE, rebuild the tool bar." (or (not message-tool-bar-map) force)) (setq message-tool-bar-map (let* ((load-path - (gmm-image-load-path-for-library "message" - "mail/save-draft.xpm" - nil t)) + (image-load-path-for-library + "message" "mail/save-draft.xpm" nil t)) (image-load-path (cons (car load-path) image-load-path))) (gmm-tool-bar-from-list message-tool-bar message-tool-bar-zap-list commit e1f22c1739f2269d1efbb25d4d74c8afea9f47db Author: Lars Ingebrigtsen Date: Sun Feb 14 16:29:53 2016 +1100 Remove the gmm-lazy and nnmail-lazy compat widgets * lisp/gnus/gmm-utils.el (gmm-lazy): Remove. * lisp/gnus/nnmail.el (nnmail-lazy): Remove. diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el index 30bddef..34db4bd 100644 --- a/lisp/gnus/gmm-utils.el +++ b/lisp/gnus/gmm-utils.el @@ -97,34 +97,6 @@ ARGS are passed to `message'." (autoload 'widget-convert "wid-edit") (autoload 'widget-default-get "wid-edit") -;; Copy of the `nnmail-lazy' code from `nnmail.el': -(define-widget 'gmm-lazy 'default - "Base widget for recursive data structures. - -This is a copy of the `lazy' widget in Emacs 22.1 provided for compatibility." - :format "%{%t%}: %v" - :convert-widget 'widget-value-convert-widget - :value-create (lambda (widget) - (let ((value (widget-get widget :value)) - (type (widget-get widget :type))) - (widget-put widget :children - (list (widget-create-child-value - widget (widget-convert type) value))))) - :value-delete 'widget-children-value-delete - :value-get (lambda (widget) - (widget-value (car (widget-get widget :children)))) - :value-inline (lambda (widget) - (widget-apply (car (widget-get widget :children)) - :value-inline)) - :default-get (lambda (widget) - (widget-default-get - (widget-convert (widget-get widget :type)))) - :match (lambda (widget value) - (widget-apply (widget-convert (widget-get widget :type)) - :match value)) - :validate (lambda (widget) - (widget-apply (car (widget-get widget :children)) :validate))) - ;; Note: The format of `gmm-tool-bar-item' may change if some future Emacs ;; version will provide customizable tool bar buttons using a different ;; interface. @@ -144,7 +116,7 @@ This is a copy of the `lazy' widget in Emacs 22.1 provided for compatibility." ;; ;; Then use (plist-get rs-command :none), (plist-get rs-command :shift) -(define-widget 'gmm-tool-bar-item (if (gmm-widget-p 'lazy) 'lazy 'gmm-lazy) +(define-widget 'gmm-tool-bar-item 'lazy "Tool bar list item." :tag "Tool bar item" :type '(choice @@ -163,7 +135,7 @@ This is a copy of the `lazy' widget in Emacs 22.1 provided for compatibility." (const :tag "No map") (plist :inline t :tag "Properties")))) -(define-widget 'gmm-tool-bar-zap-list (if (gmm-widget-p 'lazy) 'lazy 'gmm-lazy) +(define-widget 'gmm-tool-bar-zap-list 'lazy "Tool bar zap list." :tag "Tool bar zap list" :type '(choice (const :tag "Zap all" t) diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index b8899f4..52a9db2 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el @@ -368,34 +368,7 @@ messages will be shown to indicate the current status." :type '(choice (const :tag "infinite" nil) (number :tag "count"))) -(define-widget 'nnmail-lazy 'default - "Base widget for recursive data structures. - -This is copy of the `lazy' widget in Emacs 22.1 provided for compatibility." - :format "%{%t%}: %v" - :convert-widget 'widget-value-convert-widget - :value-create (lambda (widget) - (let ((value (widget-get widget :value)) - (type (widget-get widget :type))) - (widget-put widget :children - (list (widget-create-child-value - widget (widget-convert type) value))))) - :value-delete 'widget-children-value-delete - :value-get (lambda (widget) - (widget-value (car (widget-get widget :children)))) - :value-inline (lambda (widget) - (widget-apply (car (widget-get widget :children)) - :value-inline)) - :default-get (lambda (widget) - (widget-default-get - (widget-convert (widget-get widget :type)))) - :match (lambda (widget value) - (widget-apply (widget-convert (widget-get widget :type)) - :match value)) - :validate (lambda (widget) - (widget-apply (car (widget-get widget :children)) :validate))) - -(define-widget 'nnmail-split-fancy 'nnmail-lazy +(define-widget 'nnmail-split-fancy 'lazy "Widget for customizing splits in the variable of the same name." :tag "Split" :type '(menu-choice :value (any ".*value.*" "misc") commit a0844f15cad956a31f8a2cdb22df9ac9962ea95a Author: Lars Ingebrigtsen Date: Sun Feb 14 15:41:02 2016 +1100 Clean up nnimap-request-move-article slightly * lisp/gnus/nnheader.el (subr-x): Require. * lisp/gnus/nnimap.el (nnimap-request-move-article): Clean up the code slightly. diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index 9f4d1b9..191a908 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el @@ -40,6 +40,7 @@ (require 'mail-utils) (require 'mm-util) (require 'gnus-util) +(require 'subr-x) (autoload 'gnus-range-add "gnus-range") (autoload 'gnus-remove-from-range "gnus-range") ;; FIXME none of these are used explicitly in this file. diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 66096ff..fc9304f 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -913,7 +913,8 @@ textual parts.") t) (deffoo nnimap-request-move-article (article group server accept-form - &optional _last internal-move-group) + &optional _last + internal-move-group) (setq group (nnimap-decode-gnus-group group)) (when internal-move-group (setq internal-move-group (nnimap-decode-gnus-group internal-move-group))) @@ -923,17 +924,18 @@ textual parts.") 'nnimap-request-head 'nnimap-request-article) article group server (current-buffer)) - ;; If the move is internal (on the same server), just do it the easy - ;; way. + ;; If the move is internal (on the same server), just do it the + ;; easy way. (let ((message-id (message-field-value "message-id"))) (if internal-move-group (with-current-buffer (nnimap-buffer) (let* ((can-move (nnimap-capability "MOVE")) - (command (if can-move - "UID MOVE %d %S" - "UID COPY %d %S")) - (result (nnimap-command command article - (utf7-encode internal-move-group t)))) + (command (if can-move + "UID MOVE %d %S" + "UID COPY %d %S")) + (result (nnimap-command + command article + (utf7-encode internal-move-group t)))) (when (and (car result) (not can-move)) (nnimap-delete-article article)) (cons internal-move-group @@ -942,11 +944,10 @@ textual parts.") internal-move-group server message-id nnimap-request-articles-find-limit))))) ;; Move the article to a different method. - (let ((result (eval accept-form))) - (when result - (nnimap-change-group group server) - (nnimap-delete-article article) - result))))))) + (when-let ((result (eval accept-form))) + (nnimap-change-group group server) + (nnimap-delete-article article) + result)))))) (deffoo nnimap-request-expire-articles (articles group &optional server force) (setq group (nnimap-decode-gnus-group group)) commit 598ff2349eb8e3c9fc3a17d14899abe6a1e3c534 Author: Lars Ingebrigtsen Date: Sun Feb 14 15:08:40 2016 +1100 Use open-network-stream instead of open-protocol-stream * lisp/gnus/nnimap.el: Use open-network-stream instead of open-protocol-stream. * lisp/gnus/nntp.el: Ditto. * lisp/gnus/pop3.el: Ditto. * lisp/gnus/sieve-manage.el: Ditto. * lisp/net/network-stream.el (open-protocol-stream): Make obsolete. diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 0e8fb66..66096ff 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -26,13 +26,6 @@ ;;; Code: -(eval-and-compile - (require 'nnheader) - ;; In Emacs 24, `open-protocol-stream' is an autoloaded alias for - ;; `make-network-stream'. - (unless (fboundp 'open-protocol-stream) - (require 'proto-stream))) - (eval-when-compile (require 'cl)) @@ -424,7 +417,7 @@ textual parts.") (when nnimap-server-port (push nnimap-server-port ports)) (let* ((stream-list - (open-protocol-stream + (open-network-stream "*nnimap*" (current-buffer) nnimap-address (nnimap-map-port (car ports)) :type nnimap-stream diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index e6483c2..fa5f0e6 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -25,12 +25,6 @@ ;;; Code: -(eval-and-compile - ;; In Emacs 24, `open-protocol-stream' is an autoloaded alias for - ;; `make-network-stream'. - (unless (fboundp 'open-protocol-stream) - (require 'proto-stream))) - (require 'nnheader) (require 'nnoo) (require 'gnus-util) @@ -1266,7 +1260,7 @@ If SEND-IF-FORCE, only send authinfo to the server if the (nntp-open-ssl-stream tls) (nntp-open-tls-stream tls)))) (if (assoc nntp-open-connection-function map) - (open-protocol-stream + (open-network-stream "nntpd" pbuffer nntp-address nntp-port-number :type (cadr (assoc nntp-open-connection-function map)) :end-of-command "^\\([2345]\\|[.]\\).*\n" diff --git a/lisp/gnus/pop3.el b/lisp/gnus/pop3.el index 0b1f5c8..1695bbd 100644 --- a/lisp/gnus/pop3.el +++ b/lisp/gnus/pop3.el @@ -34,12 +34,6 @@ (eval-when-compile (require 'cl)) -(eval-and-compile - ;; In Emacs 24, `open-protocol-stream' is an autoloaded alias for - ;; `make-network-stream'. - (unless (fboundp 'open-protocol-stream) - (require 'proto-stream))) - (require 'mail-utils) (defvar parse-time-months) @@ -545,7 +539,7 @@ Returns the process associated with the connection." (erase-buffer) (setq pop3-read-point (point-min)) (setq result - (open-protocol-stream + (open-network-stream "POP" (current-buffer) mailhost port :type (cond ((or (eq pop3-stream-type 'ssl) diff --git a/lisp/gnus/sieve-manage.el b/lisp/gnus/sieve-manage.el index dd503c3..695bbd8 100644 --- a/lisp/gnus/sieve-manage.el +++ b/lisp/gnus/sieve-manage.el @@ -201,7 +201,7 @@ Return the buffer associated with the connection." (sieve-manage-erase) (setq sieve-manage-state 'initial) (destructuring-bind (proc . props) - (open-protocol-stream + (open-network-stream "SIEVE" buffer server port :type stream :capability-command "CAPABILITY\r\n" diff --git a/lisp/net/gnutls.el b/lisp/net/gnutls.el index ce44c03..904cb31 100644 --- a/lisp/net/gnutls.el +++ b/lisp/net/gnutls.el @@ -26,7 +26,7 @@ ;; This package provides language bindings for the GnuTLS library ;; using the corresponding core functions in gnutls.c. It should NOT -;; be used directly, only through open-protocol-stream. +;; be used directly, only through open-network-stream. ;; Simple test: ;; diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el index 59ac299..e5557b8 100644 --- a/lisp/net/network-stream.el +++ b/lisp/net/network-stream.el @@ -195,6 +195,8 @@ asynchronously, if possible." ;;;###autoload (defalias 'open-protocol-stream 'open-network-stream) +(define-obsolete-function-alias 'open-protocol-stream 'open-network-stream + "25.2") (defun network-stream-open-plain (name buffer host service parameters) (let ((start (with-current-buffer buffer (point))) commit 920414f2417afbbb37bb38b91ebd8792fb1929cb Author: Lars Ingebrigtsen Date: Sun Feb 14 15:02:59 2016 +1100 Remove compat code that relies on (featurep 'mule) * lisp/gnus/gnus-group.el (gnus-group-name-decode): Remove compat code. * lisp/gnus/gnus-start.el (gnus-read-descriptions-file): Remove compat code. * lisp/gnus/mm-bodies.el (mm-decode-body, mm-decode-string): Remove compat code. * lisp/gnus/mm-view.el (mm-w3m-standalone-supports-m17n-p): Remove compat code. (mm-w3m-standalone-supports-m17n-p): Ditto. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 0cbaaf0..34ec110 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1204,7 +1204,7 @@ The following commands are available: (defun gnus-group-name-decode (string charset) ;; Fixme: Don't decode in unibyte mode. - (if (and string charset (featurep 'mule)) + (if (and string charset) (decode-coding-string string charset) string)) diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 61e5409..a577972 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -3157,7 +3157,7 @@ If FORCE is non-nil, the .newsrc file is read." (gnus-parameter-charset name) gnus-default-charset))) ;; Fixme: Don't decode in unibyte mode. - (when (and str charset (featurep 'mule)) + (when (and str charset) (setq str (decode-coding-string str charset))) (set group str))) (forward-line 1)))) diff --git a/lisp/gnus/mm-bodies.el b/lisp/gnus/mm-bodies.el index 91e1a27..6ccaa77 100644 --- a/lisp/gnus/mm-bodies.el +++ b/lisp/gnus/mm-bodies.el @@ -243,8 +243,7 @@ decoding. If it is nil, default to `mail-parse-charset'." (save-excursion (when encoding (mm-decode-content-transfer-encoding encoding type)) - (when (and (featurep 'mule) ;; Fixme: Wrong test for unibyte session. - (not (eq charset 'gnus-decoded))) + (when (not (eq charset 'gnus-decoded)) (let ((coding-system (mm-charset-to-coding-system ;; Allow overwrite using ;; `mm-charset-override-alist'. @@ -271,22 +270,21 @@ decoding. If it is nil, default to `mail-parse-charset'." (memq charset mail-parse-ignored-charsets)) (setq charset mail-parse-charset)) (or - (when (featurep 'mule) - (let ((coding-system (mm-charset-to-coding-system - charset - ;; Allow overwrite using - ;; `mm-charset-override-alist'. - nil t))) - (if (and (not coding-system) - (listp mail-parse-ignored-charsets) - (memq 'gnus-unknown mail-parse-ignored-charsets)) - (setq coding-system - (mm-charset-to-coding-system mail-parse-charset))) - (when (and charset coding-system - (mm-multibyte-p) - (or (not (eq coding-system 'ascii)) - (setq coding-system mail-parse-charset))) - (decode-coding-string string coding-system)))) + (let ((coding-system (mm-charset-to-coding-system + charset + ;; Allow overwrite using + ;; `mm-charset-override-alist'. + nil t))) + (if (and (not coding-system) + (listp mail-parse-ignored-charsets) + (memq 'gnus-unknown mail-parse-ignored-charsets)) + (setq coding-system + (mm-charset-to-coding-system mail-parse-charset))) + (when (and charset coding-system + (mm-multibyte-p) + (or (not (eq coding-system 'ascii)) + (setq coding-system mail-parse-charset))) + (decode-coding-string string coding-system))) string)) (provide 'mm-bodies) diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index 518b740..31c8cce 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el @@ -198,14 +198,13 @@ (delete-region ,(point-min-marker) ,(point-max-marker))))))))) -(defvar mm-w3m-standalone-supports-m17n-p (if (featurep 'mule) 'undecided) +(defvar mm-w3m-standalone-supports-m17n-p 'undecided "*T means the w3m command supports the m17n feature.") (defun mm-w3m-standalone-supports-m17n-p () "Say whether the w3m command supports the m17n feature." (cond ((eq mm-w3m-standalone-supports-m17n-p t) t) ((eq mm-w3m-standalone-supports-m17n-p nil) nil) - ((not (featurep 'mule)) (setq mm-w3m-standalone-supports-m17n-p nil)) ((condition-case nil (let ((coding-system-for-write 'iso-2022-jp) (coding-system-for-read 'iso-2022-jp) commit 19d298f7d7f672ecb1d58be372f401cdf3d86160 Author: Lars Ingebrigtsen Date: Sun Feb 14 14:59:40 2016 +1100 Remove compat functions from starttls.el * lisp/gnus/starttls.el (starttls-set-process-query-on-exit-flag): Remove. diff --git a/lisp/gnus/starttls.el b/lisp/gnus/starttls.el index f3ef5e0..096ed2a 100644 --- a/lisp/gnus/starttls.el +++ b/lisp/gnus/starttls.el @@ -232,13 +232,6 @@ handshake, or nil on failure." (starttls-negotiate-gnutls process) (signal-process (process-id process) 'SIGALRM))) -(eval-and-compile - (if (fboundp 'set-process-query-on-exit-flag) - (defalias 'starttls-set-process-query-on-exit-flag - 'set-process-query-on-exit-flag) - (defalias 'starttls-set-process-query-on-exit-flag - 'process-kill-without-query))) - (defun starttls-open-stream-gnutls (name buffer host port) (message "Opening STARTTLS connection to `%s:%s'..." host port) (let* (done @@ -250,7 +243,7 @@ handshake, or nil on failure." (int-to-string port) port) starttls-extra-arguments))) - (starttls-set-process-query-on-exit-flag process nil) + (set-process-query-on-exit-flag process nil) (while (and (processp process) (eq (process-status process) 'run) (with-current-buffer buffer @@ -292,7 +285,7 @@ GnuTLS requires a port number." name buffer starttls-program host (format "%s" port) starttls-extra-args))) - (starttls-set-process-query-on-exit-flag process nil) + (set-process-query-on-exit-flag process nil) process))) (defun starttls-available-p () commit 928bb3ff3e29c3a7b3449c11ecbb440e959b5b4f Author: Lars Ingebrigtsen Date: Sun Feb 14 14:58:39 2016 +1100 Remove compat functions from smime.el * lisp/gnus/smime.el (smime-replace-in-string): Remove. (smime-make-temp-file): Remove. diff --git a/lisp/gnus/smime.el b/lisp/gnus/smime.el index 27e3127..44841a7 100644 --- a/lisp/gnus/smime.el +++ b/lisp/gnus/smime.el @@ -126,19 +126,6 @@ (eval-when-compile (require 'cl)) -(eval-and-compile - (cond - ((fboundp 'replace-in-string) - (defalias 'smime-replace-in-string 'replace-in-string)) - ((fboundp 'replace-regexp-in-string) - (defun smime-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))))) - (defgroup smime nil "S/MIME configuration." :group 'mime) @@ -244,18 +231,6 @@ must be set in `ldap-host-parameters-alist'." (defvar smime-details-buffer "*OpenSSL output*") -;; Use mm-util? -(eval-and-compile - (defalias 'smime-make-temp-file - (if (fboundp 'make-temp-file) - 'make-temp-file - (lambda (prefix &optional dir-flag) ;; Simple implementation - (expand-file-name - (make-temp-name prefix) - (if (fboundp 'temp-directory) - (temp-directory) - temporary-file-directory)))))) - ;; Password dialog function (declare-function password-read-and-add "password-cache" (prompt &optional key)) @@ -301,7 +276,7 @@ key and certificate itself." (keyfile (or (car-safe keyfile) keyfile)) (buffer (generate-new-buffer " *smime*")) (passphrase (smime-ask-passphrase (expand-file-name keyfile))) - (tmpfile (smime-make-temp-file "smime"))) + (tmpfile (make-temp-file "smime"))) (if passphrase (setenv "GNUS_SMIME_PASSPHRASE" passphrase)) (prog1 @@ -335,7 +310,7 @@ have proper MIME tags. CERTFILES is a list of filenames, each file is expected to contain of a PEM encoded certificate." (smime-new-details-buffer) (let ((buffer (generate-new-buffer " *smime*")) - (tmpfile (smime-make-temp-file "smime"))) + (tmpfile (make-temp-file "smime"))) (prog1 (when (prog1 (apply 'smime-call-openssl-region b e (list buffer tmpfile) @@ -431,7 +406,7 @@ in the buffer specified by `smime-details-buffer'." (smime-new-details-buffer) (let ((buffer (generate-new-buffer " *smime*")) CAs (passphrase (smime-ask-passphrase (expand-file-name keyfile))) - (tmpfile (smime-make-temp-file "smime"))) + (tmpfile (make-temp-file "smime"))) (if passphrase (setenv "GNUS_SMIME_PASSPHRASE" passphrase)) (if (prog1 @@ -607,11 +582,11 @@ A string or a list of strings is returned." (string= (substring (cadaar ldapresult) 0 3) "MII")) (setq cert - (smime-replace-in-string - (cadaar ldapresult) + (replace-regexp-in-string (concat "\\(\n\\|\r\\|-----BEGIN CERTIFICATE-----\\|" "-----END CERTIFICATE-----\\)") - "" t)) + "" + (cadaar ldapresult) nil t)) (setq cert (base64-encode-string (cadaar ldapresult) t))) (insert "-----BEGIN CERTIFICATE-----\n") (let ((i 0) (len (length cert))) commit f322abc9452aded2ed462dc0d02e4bf41416e2d2 Author: Lars Ingebrigtsen Date: Sun Feb 14 14:56:21 2016 +1100 Remove compat code from smiley * lisp/gnus/smiley.el (smiley-style): Remove compat code. diff --git a/lisp/gnus/smiley.el b/lisp/gnus/smiley.el index 0a9af9e..b5450a8 100644 --- a/lisp/gnus/smiley.el +++ b/lisp/gnus/smiley.el @@ -58,19 +58,17 @@ (defvar smiley-data-directory) (defcustom smiley-style - (if (or (and (fboundp 'face-attribute) - ;; In batch mode, attributes can be unspecified. - (condition-case nil - (>= (face-attribute 'default :height) 160) - (error nil))) - (and (fboundp 'face-height) - (>= (face-height 'default) 14))) + (if (and (fboundp 'face-attribute) + ;; In batch mode, attributes can be unspecified. + (condition-case nil + (>= (face-attribute 'default :height) 160) + (error nil))) 'medium 'low-color) "Smiley style." - :type '(choice (const :tag "small, 3 colors" low-color) ;; 13x14 - (const :tag "medium, ~10 colors" medium) ;; 16x16 - (const :tag "dull, grayscale" grayscale));; 14x14 + :type '(choice (const :tag "small, 3 colors" low-color) ;; 13x14 + (const :tag "medium, ~10 colors" medium) ;; 16x16 + (const :tag "dull, grayscale" grayscale)) ;; 14x14 :set (lambda (symbol value) (set-default symbol value) (setq smiley-data-directory (smiley-directory)) commit c311723eee7278a0da036adc684290ea1690f35d Author: Lars Ingebrigtsen Date: Sun Feb 14 14:54:28 2016 +1100 Remove compat code from rfc2047 * lisp/gnus/rfc2047.el (rfc2047-encode-message-header): Remove compat code. (rfc2047-decode-string): Ditto. diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el index b05dfc1..4cb10e5 100644 --- a/lisp/gnus/rfc2047.el +++ b/lisp/gnus/rfc2047.el @@ -290,9 +290,7 @@ Should be called narrowed to the head of the message." (let ((rfc2047-encoding-type 'mime)) (rfc2047-encode-region (point) (point-max)))) ((eq method 'default) - (if (and (featurep 'mule) - (if (boundp 'enable-multibyte-characters) - (default-value 'enable-multibyte-characters)) + (if (and (default-value 'enable-multibyte-characters) mail-parse-charset) (encode-coding-region (point) (point-max) mail-parse-charset))) @@ -317,11 +315,8 @@ Should be called narrowed to the head of the message." ;;; (rfc2047-encode-region (point-min) (point-max)) ;;; (error "Cannot send unencoded text"))) ((mm-coding-system-p method) - (if (or (and (featurep 'mule) - (if (boundp 'enable-multibyte-characters) - (default-value 'enable-multibyte-characters))) - (featurep 'file-coding)) - (encode-coding-region (point) (point-max) method))) + (when (default-value 'enable-multibyte-characters) + (encode-coding-region (point) (point-max) method))) ;; Hm. (t))) (goto-char (point-max)))))))) @@ -1103,49 +1098,47 @@ strings are stripped." "Decode MIME-encoded STRING and return the result. If ADDRESS-MIME is non-nil, strip backslashes which precede characters other than `\"' and `\\' in quoted strings." - ;; (let ((m (mm-multibyte-p))) - (if (string-match "=\\?" string) - (with-temp-buffer - ;; We used to only call mm-enable-multibyte if `m' is non-nil, - ;; but this can't be the right criterion. Don't just revert this - ;; change if it encounters a bug. Please help me fix it - ;; right instead. --Stef - ;; The string returned should always be multibyte in a multibyte - ;; session, i.e. the buffer should be multibyte before - ;; `buffer-string' is called. - (mm-enable-multibyte) - (insert string) - (inline - (rfc2047-decode-region (point-min) (point-max) address-mime)) - (buffer-string)) - (when address-mime - (setq string - (with-temp-buffer - (when (multibyte-string-p string) - (mm-enable-multibyte)) - (insert string) - (rfc2047-strip-backslashes-in-quoted-strings) - (buffer-string)))) - ;; Fixme: As above, `m' here is inappropriate. - (if (and ;; m - mail-parse-charset - (not (eq mail-parse-charset 'us-ascii)) - (not (eq mail-parse-charset 'gnus-decoded))) - ;; `decode-coding-string' in Emacs offers a third optional - ;; arg NOCOPY to avoid consing a new string if the decoding - ;; is "trivial". Unfortunately it currently doesn't - ;; consider anything else than a nil coding system - ;; trivial. - ;; `rfc2047-decode-string' is called multiple times for each - ;; article during summary buffer generation, and we really - ;; want to avoid unnecessary consing. So we bypass - ;; `decode-coding-string' if the string is purely ASCII. - (if (and (fboundp 'detect-coding-string) - ;; string is purely ASCII - (eq (detect-coding-string string t) 'undecided)) - string - (decode-coding-string string mail-parse-charset)) - (string-to-multibyte string)))) ;; ) + (if (string-match "=\\?" string) + (with-temp-buffer + ;; We used to only call mm-enable-multibyte if `m' is non-nil, + ;; but this can't be the right criterion. Don't just revert this + ;; change if it encounters a bug. Please help me fix it + ;; right instead. --Stef + ;; The string returned should always be multibyte in a multibyte + ;; session, i.e. the buffer should be multibyte before + ;; `buffer-string' is called. + (mm-enable-multibyte) + (insert string) + (inline + (rfc2047-decode-region (point-min) (point-max) address-mime)) + (buffer-string)) + (when address-mime + (setq string + (with-temp-buffer + (when (multibyte-string-p string) + (mm-enable-multibyte)) + (insert string) + (rfc2047-strip-backslashes-in-quoted-strings) + (buffer-string)))) + ;; Fixme: As above, `m' here is inappropriate. + (if (and ;; m + mail-parse-charset + (not (eq mail-parse-charset 'us-ascii)) + (not (eq mail-parse-charset 'gnus-decoded))) + ;; `decode-coding-string' in Emacs offers a third optional + ;; arg NOCOPY to avoid consing a new string if the decoding + ;; is "trivial". Unfortunately it currently doesn't + ;; consider anything else than a nil coding system + ;; trivial. + ;; `rfc2047-decode-string' is called multiple times for each + ;; article during summary buffer generation, and we really + ;; want to avoid unnecessary consing. So we bypass + ;; `decode-coding-string' if the string is purely ASCII. + (if (eq (detect-coding-string string t) 'undecided) + ;; string is purely ASCII + string + (decode-coding-string string mail-parse-charset)) + (string-to-multibyte string)))) (defun rfc2047-decode-address-string (string) "Decode MIME-encoded STRING and return the result. commit 374c21d59a3e2b8a49c7e4ecc466edb5313dbb98 Author: Lars Ingebrigtsen Date: Sun Feb 14 14:50:53 2016 +1100 Remove compat function from pop3 * lisp/gnus/pop3.el (pop3-set-process-query-on-exit-flag): Remove. diff --git a/lisp/gnus/pop3.el b/lisp/gnus/pop3.el index 41ebe98..0b1f5c8 100644 --- a/lisp/gnus/pop3.el +++ b/lisp/gnus/pop3.el @@ -533,13 +533,6 @@ this is nil, `ssl' is assumed for connections to port (const :tag "SSL/TLS" ssl) (const starttls))) -(eval-and-compile - (if (fboundp 'set-process-query-on-exit-flag) - (defalias 'pop3-set-process-query-on-exit-flag - 'set-process-query-on-exit-flag) - (defalias 'pop3-set-process-query-on-exit-flag - 'process-kill-without-query))) - (defun pop3-open-server (mailhost port) "Open TCP connection to MAILHOST on PORT. Returns the process associated with the connection." @@ -576,7 +569,7 @@ Returns the process associated with the connection." (setq pop3-timestamp (substring response (or (string-match "<" response) 0) (+ 1 (or (string-match ">" response) -1))))) - (pop3-set-process-query-on-exit-flag (car result) nil) + (set-process-query-on-exit-flag (car result) nil) (erase-buffer) (car result))))) commit 2366c7036d0e784592904e94c1c5bfac37760659 Author: Lars Ingebrigtsen Date: Sun Feb 14 14:50:03 2016 +1100 Remove compat code in Gnus backends * lisp/gnus/nndiary.el (nndiary-error): Remove. * lisp/gnus/nndraft.el (nndraft-request-associate-buffer): Ditto. * lisp/gnus/nnfolder.el (nnfolder-read-folder): Ditto. * lisp/gnus/nnheader.el (nnheader-find-file-noselect): Ditto. * lisp/gnus/nnimap.el (nnimap-log-buffer): Remove compat code. diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el index 9245396..71229dd 100644 --- a/lisp/gnus/nndiary.el +++ b/lisp/gnus/nndiary.el @@ -88,16 +88,6 @@ (require 'gnus-start) (require 'gnus-sum) -;; Compatibility Functions ================================================= - -(eval-and-compile - (if (fboundp 'signal-error) - (defun nndiary-error (&rest args) - (apply #'signal-error 'nndiary args)) - (defun nndiary-error (&rest args) - (apply #'error args)))) - - ;; Back End behavior customization =========================================== (defgroup nndiary nil @@ -1157,12 +1147,12 @@ all. This may very well take some time.") ;; within the specified bounds. ;; Signals are caught by `nndiary-schedule'. (if (not (string-match "^[ \t]*[0-9]+[ \t]*$" str)) - (nndiary-error "not an integer value") + (error "Not an integer value") ;; else (let ((val (string-to-number str))) (and (or (< val min) (and max (> val max))) - (nndiary-error "value out of range")) + (error "Value out of range")) val))) (defun nndiary-parse-schedule-value (str min-or-values max) @@ -1179,7 +1169,7 @@ all. This may very well take some time.") (match-string 1 str)))) (if (and val (setq val (assoc val min-or-values))) (list (cadr val)) - (nndiary-error "invalid syntax"))) + (error "Invalid syntax"))) ;; min-or-values is min (mapcar (lambda (val) @@ -1199,7 +1189,7 @@ all. This may very well take some time.") (t (cons end beg))))) (t - (nndiary-error "invalid syntax"))) + (error "Invalid syntax"))) )) (split-string str ","))) )) @@ -1214,7 +1204,7 @@ all. This may very well take some time.") (let ((header (format "^X-Diary-%s: \\(.*\\)$" head))) (goto-char (point-min)) (if (not (re-search-forward header nil t)) - (nndiary-error "header missing") + (error "Header missing") ;; else (nndiary-parse-schedule-value (match-string 1) min-or-values max)) )) diff --git a/lisp/gnus/nndraft.el b/lisp/gnus/nndraft.el index f6c62c8..f10b6fa 100644 --- a/lisp/gnus/nndraft.el +++ b/lisp/gnus/nndraft.el @@ -203,10 +203,7 @@ are generated if and only if they are also in `message-draft-headers'.") (setq buffer-file-name (expand-file-name file) buffer-auto-save-file-name (make-auto-save-file-name)) (clear-visited-file-modtime) - (let ((hook (if (boundp 'write-contents-functions) - 'write-contents-functions - 'write-contents-hooks))) - (add-hook hook 'nndraft-generate-headers nil t)) + (add-hook 'write-contents-functions 'nndraft-generate-headers nil t) (add-hook 'after-save-hook 'nndraft-update-unread-articles nil t) (message-add-action '(nndraft-update-unread-articles) 'exit 'postpone 'kill) diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el index ff02055..402ffba 100644 --- a/lisp/gnus/nnfolder.el +++ b/lisp/gnus/nnfolder.el @@ -884,9 +884,7 @@ deleted. Point is left where the deleted region was." (active (or (cadr (assoc group nnfolder-group-alist)) (cons 1 0))) (scantime (assoc group nnfolder-scantime-alist)) - (minid (or (and (boundp 'most-positive-fixnum) - most-positive-fixnum) - (lsh -1 -1))) + (minid most-positive-fixnum) maxid start end newscantime novbuf articles newnum buffer-read-only) diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index 42dfcb3..9f4d1b9 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el @@ -980,14 +980,8 @@ See `find-file-noselect' for the arguments." (enable-local-eval nil) (coding-system-for-read nnheader-file-coding-system) (version-control 'never) - (ffh (if (boundp 'find-file-hook) - 'find-file-hook - 'find-file-hooks)) - (val (symbol-value ffh))) - (set ffh nil) - (unwind-protect - (apply 'find-file-noselect args) - (set ffh val)))) + (find-file-hook nil)) + (apply 'find-file-noselect args))) (defun nnheader-directory-regular-files (dir) "Return a list of all regular files in DIR." diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index a53d6cd..0e8fb66 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1885,9 +1885,7 @@ Return the server's response to the SELECT or EXAMINE command." (let ((name "*imap log*")) (or (get-buffer name) (with-current-buffer (get-buffer-create name) - (when (boundp 'window-point-insertion-type) - (make-local-variable 'window-point-insertion-type) - (setq window-point-insertion-type t)) + (setq-local window-point-insertion-type t) (current-buffer))))) (defun nnimap-log-command (command) commit f3cdf9c23b79b242a6a313744686ed29cc16950b Author: Lars Ingebrigtsen Date: Sun Feb 14 14:42:26 2016 +1100 Remove compat code from some mml files * lisp/gnus/mml-sec.el (mml-secure-passphrase-cache-expiry): Remove compat code. * lisp/gnus/mml-smime.el (mml-smime-openssl-sign-query): Always use `mail-extract-address-components', since this isn't time critical. (mml-smime-get-dns-cert): Ditto. * lisp/gnus/mml.el (mml-preview): Remove compat code. diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el index fec3b29..049890e 100644 --- a/lisp/gnus/mm-uu.el +++ b/lisp/gnus/mm-uu.el @@ -290,8 +290,7 @@ If PROPERTIES is non-nil, PROPERTIES are applied to the buffer, see `set-text-properties'. If PROPERTIES equals t, this means to apply the face `mm-uu-extract'." (let ((obuf (current-buffer)) - (multi (and (boundp 'enable-multibyte-characters) - enable-multibyte-characters)) + (multi enable-multibyte-characters) (coding-system buffer-file-coding-system)) (with-current-buffer (generate-new-buffer " *mm-uu*") (if multi (mm-enable-multibyte) (mm-disable-multibyte)) diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el index bc7c0ac..576ecee 100644 --- a/lisp/gnus/mml-sec.el +++ b/lisp/gnus/mml-sec.el @@ -122,10 +122,7 @@ See Info node `(message) Security'." :group 'message :type 'boolean) -(defcustom mml-secure-passphrase-cache-expiry - (if (boundp 'password-cache-expiry) - password-cache-expiry - 16) +(defcustom mml-secure-passphrase-cache-expiry password-cache-expiry "How many seconds the passphrase is cached. Whether the passphrase is cached at all is controlled by `mml-secure-cache-passphrase'." diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el index f7cf71a..02e602c 100644 --- a/lisp/gnus/mml-smime.el +++ b/lisp/gnus/mml-smime.el @@ -175,15 +175,12 @@ Whether the passphrase is cached at all is controlled by (list 'keyfile (if (= (length smime-keys) 1) (cadar smime-keys) - (or (let ((from (cadr (funcall (if (boundp - 'gnus-extract-address-components) - gnus-extract-address-components - 'mail-extract-address-components) - (or (save-excursion - (save-restriction - (message-narrow-to-headers) - (message-fetch-field "from"))) - ""))))) + (or (let ((from (cadr (mail-extract-address-components + (or (save-excursion + (save-restriction + (message-narrow-to-headers) + (message-fetch-field "from"))) + ""))))) (and from (smime-get-key-by-email from))) (smime-get-key-by-email (gnus-completing-read "Sign this part with what signature" @@ -204,15 +201,12 @@ Whether the passphrase is cached at all is controlled by (while (not result) (setq who (read-from-minibuffer (format "%sLookup certificate for: " (or bad "")) - (cadr (funcall (if (boundp - 'gnus-extract-address-components) - gnus-extract-address-components - 'mail-extract-address-components) - (or (save-excursion - (save-restriction - (message-narrow-to-headers) - (message-fetch-field "to"))) - ""))))) + (cadr (mail-extract-address-components + (or (save-excursion + (save-restriction + (message-narrow-to-headers) + (message-fetch-field "to"))) + ""))))) (if (setq cert (smime-cert-by-dns who)) (setq result (list 'certfile (buffer-name cert))) (setq bad (format-message "`%s' not found. " who)))) diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index ce152ac..d9cf15f 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -1544,12 +1544,11 @@ or the `pop-to-buffer' function." (message-sort-headers) (mml-to-mime)) (if raw - (when (fboundp 'set-buffer-multibyte) - (let ((s (buffer-string))) - ;; Insert the content into unibyte buffer. - (erase-buffer) - (mm-disable-multibyte) - (insert s))) + (let ((s (buffer-string))) + ;; Insert the content into unibyte buffer. + (erase-buffer) + (mm-disable-multibyte) + (insert s)) (let ((gnus-newsgroup-charset (car message-posting-charset)) gnus-article-prepare-hook gnus-original-article-buffer gnus-displaying-mime) commit 8f597e90f6c7b1f1cae0096f66a335df01b0e6f9 Author: Lars Ingebrigtsen Date: Sun Feb 14 14:36:57 2016 +1100 Remove compat code and compat functions from mm-util.el * lisp/gnus/mm-util.el (mm-mime-mule-charset-alist): Remove compat code. (mm-coding-system-priorities) (mm-mule-charset-to-mime-charset, mm-charset-after) (mm-mime-charset, mm-iso-8859-x-to-15-region): Remove compat code. (mm-detect-coding-region): Define unconditionally. (mm-detect-mime-charset-region): Ditto. (mm-coding-system-to-mime-charset): It's 'mime-charset now. (coding-system-name) (find-file-coding-system-for-read-from-filename) (find-operation-coding-system): Remove aliases. diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index 97b28bc..a67bc30 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -487,7 +487,7 @@ superset of iso-8859-1." ;; Fixme: some of the cars here aren't valid MIME charsets. That ;; should only matter with XEmacs, though. (defvar mm-mime-mule-charset-alist - `((us-ascii ascii) + '((us-ascii ascii) (iso-8859-1 latin-iso8859-1) (iso-8859-2 latin-iso8859-2) (iso-8859-3 latin-iso8859-3) @@ -537,17 +537,7 @@ superset of iso-8859-1." (iso-2022-jp-3 latin-jisx0201 japanese-jisx0208-1978 japanese-jisx0208 japanese-jisx0213-1 japanese-jisx0213-2) (shift_jis latin-jisx0201 katakana-jisx0201 japanese-jisx0208) - ,(cond ((fboundp 'unicode-precedence-list) - (cons 'utf-8 (delq 'ascii (mapcar 'charset-name - (unicode-precedence-list))))) - ((or (not (fboundp 'charsetp)) ;; non-Mule case - (charsetp 'unicode-a) - (not (mm-coding-system-p 'mule-utf-8))) - '(utf-8 unicode-a unicode-b unicode-c unicode-d unicode-e)) - (t ;; If we have utf-8 we're in Mule 5+. - (append '(utf-8) - (delete 'ascii - (coding-system-get 'mule-utf-8 'safe-charsets)))))) + (utf-8)) "Alist of MIME-charset/MULE-charsets.") ;; Correct by construction, but should be unnecessary for Emacs: @@ -597,16 +587,11 @@ Valid elements include: "A table of the difference character between ISO-8859-X and ISO-8859-15.") (defcustom mm-coding-system-priorities - (let ((lang (if (boundp 'current-language-environment) - (symbol-value 'current-language-environment)))) - (cond (;; XEmacs without Mule but with `file-coding'. - (not lang) nil) - ;; In XEmacs 21.5 it may be the one like "Japanese (UTF-8)". - ((string-match "\\`Japanese" lang) - ;; Japanese users prefer iso-2022-jp to others usually used - ;; for `buffer-file-coding-system', however iso-8859-1 should - ;; be used when there are only ASCII and Latin-1 characters. - '(iso-8859-1 iso-2022-jp utf-8)))) + (and (string-match "\\`Japanese" current-language-environment) + ;; Japanese users prefer iso-2022-jp to others usually used + ;; for `buffer-file-coding-system', however iso-8859-1 should + ;; be used when there are only ASCII and Latin-1 characters. + '(iso-8859-1 iso-2022-jp utf-8)) "Preferred coding systems for encoding outgoing messages. More than one suitable coding system may be found for some text. @@ -618,8 +603,7 @@ variable is set, it overrides the default priority." :group 'mime) ;; ?? -(defvar mm-use-find-coding-systems-region - (fboundp 'find-coding-systems-region) +(defvar mm-use-find-coding-systems-region t "Use `find-coding-systems-region' to find proper coding systems. Setting it to nil is useful on Emacsen supporting Unicode if sending @@ -646,29 +630,16 @@ like \"€\" to the euro sign, mainly in html messages.") (defun mm-mule-charset-to-mime-charset (charset) "Return the MIME charset corresponding to the given Mule CHARSET." - (if (and (fboundp 'find-coding-systems-for-charsets) - (fboundp 'sort-coding-systems)) - (let ((css (sort (sort-coding-systems - (find-coding-systems-for-charsets (list charset))) - 'mm-sort-coding-systems-predicate)) - cs mime) - (while (and (not mime) - css) - (when (setq cs (pop css)) - (setq mime (or (coding-system-get cs :mime-charset) - (coding-system-get cs 'mime-charset))))) - mime) - (let ((alist (mapcar (lambda (cs) - (assq cs mm-mime-mule-charset-alist)) - (sort (mapcar 'car mm-mime-mule-charset-alist) - 'mm-sort-coding-systems-predicate))) - out) - (while alist - (when (memq charset (cdar alist)) - (setq out (caar alist) - alist nil)) - (pop alist)) - out))) + (let ((css (sort (sort-coding-systems + (find-coding-systems-for-charsets (list charset))) + 'mm-sort-coding-systems-predicate)) + cs mime) + (while (and (not mime) + css) + (when (setq cs (pop css)) + (setq mime (or (coding-system-get cs :mime-charset) + (coding-system-get cs 'mime-charset))))) + mime)) (defun mm-enable-multibyte () "Set the multibyte flag of the current buffer. @@ -692,8 +663,7 @@ non-nil." mail-parse-mule-charset ;; cached mule-charset (progn (setq mail-parse-mule-charset - (and (boundp 'current-language-environment) - (car (last + (and (car (last (assq 'charset (assoc current-language-environment language-info-alist)))))) @@ -709,38 +679,27 @@ non-nil." (defun mm-charset-after (&optional pos) "Return charset of a character in current buffer at position POS. If POS is nil, it defaults to the current point. -If POS is out of range, the value is nil. -If the charset is `composition', return the actual one." +If POS is out of range, the value is nil." (let ((char (char-after pos)) charset) (if (< char 128) (setq charset 'ascii) - ;; charset-after is fake in some Emacsen. - (setq charset (and (fboundp 'char-charset) (char-charset char))) - (if (eq charset 'composition) ; Mule 4 - (let ((p (or pos (point)))) - (cadr (find-charset-region p (1+ p)))) - (if (and charset (not (memq charset '(ascii eight-bit-control - eight-bit-graphic)))) - charset - (mm-guess-charset)))))) + (setq charset (char-charset char)) + (if (and charset (not (memq charset '(ascii eight-bit-control + eight-bit-graphic)))) + charset + (mm-guess-charset))))) (defun mm-mime-charset (charset) "Return the MIME charset corresponding to the given Mule CHARSET." - (if (eq charset 'unknown) - (error "The message contains non-printable characters, please use attachment")) - (if (and (fboundp 'coding-system-get) (fboundp 'get-charset-property)) - (or - (and (mm-preferred-coding-system charset) - (or (coding-system-get - (mm-preferred-coding-system charset) :mime-charset) - (coding-system-get - (mm-preferred-coding-system charset) 'mime-charset))) - (and (eq charset 'ascii) - 'us-ascii) - (mm-preferred-coding-system charset) - (mm-mule-charset-to-mime-charset charset)) - ;; This is for XEmacs. - (mm-mule-charset-to-mime-charset charset))) + (when (eq charset 'unknown) + (error "The message contains non-printable characters, please use attachment")) + (or + (and (mm-preferred-coding-system charset) + (coding-system-get (mm-preferred-coding-system charset) 'mime-charset)) + (and (eq charset 'ascii) + 'us-ascii) + (mm-preferred-coding-system charset) + (mm-mule-charset-to-mime-charset charset))) ;; Fixme: This is used in places when it should be testing the ;; default multibyteness. @@ -749,25 +708,24 @@ If the charset is `composition', return the actual one." enable-multibyte-characters) (defun mm-iso-8859-x-to-15-region (&optional b e) - (if (fboundp 'char-charset) - (let (charset item c inconvertible) - (save-restriction - (if e (narrow-to-region b e)) - (goto-char (point-min)) - (skip-chars-forward "\0-\177") - (while (not (eobp)) - (cond - ((not (setq item (assq (char-charset (setq c (char-after))) - mm-iso-8859-x-to-15-table))) - (forward-char)) - ((memq c (cdr (cdr item))) - (setq inconvertible t) - (forward-char)) - (t - (insert-before-markers (prog1 (+ c (car (cdr item))) - (delete-char 1))))) - (skip-chars-forward "\0-\177"))) - (not inconvertible)))) + (let (charset item c inconvertible) + (save-restriction + (if e (narrow-to-region b e)) + (goto-char (point-min)) + (skip-chars-forward "\0-\177") + (while (not (eobp)) + (cond + ((not (setq item (assq (char-charset (setq c (char-after))) + mm-iso-8859-x-to-15-table))) + (forward-char)) + ((memq c (cdr (cdr item))) + (setq inconvertible t) + (forward-char)) + (t + (insert-before-markers (prog1 (+ c (car (cdr item))) + (delete-char 1))))) + (skip-chars-forward "\0-\177"))) + (not inconvertible))) (defun mm-sort-coding-systems-predicate (a b) (let ((priorities @@ -879,15 +837,13 @@ it if any may malfunction." (defun mm-find-charset-region (b e) "Return a list of Emacs charsets in the region B to E." (cond - ((and (mm-multibyte-p) - (fboundp 'find-charset-region)) + ((mm-multibyte-p) ;; Remove composition since the base charsets have been included. ;; Remove eight-bit-*, treat them as ascii. (let ((css (find-charset-region b e))) - (dolist (cs - '(composition eight-bit-control eight-bit-graphic control-1) - css) - (setq css (delq cs css))))) + (dolist (cs '(composition eight-bit-control eight-bit-graphic control-1)) + (setq css (delq cs css))) + css)) (t ;; We are in a unibyte buffer, so we futz around a bit. (save-excursion @@ -898,11 +854,9 @@ it if any may malfunction." (if (eobp) '(ascii) (let (charset) - (setq charset - (and (boundp 'current-language-environment) - (car (last (assq 'charset - (assoc current-language-environment - language-info-alist)))))) + (setq charset (car (last (assq 'charset + (assoc current-language-environment + language-info-alist))))) (if (eq charset 'ascii) (setq charset nil)) (or charset (setq charset @@ -929,9 +883,9 @@ it if any may malfunction." "Like `insert-file-contents', but only reads in the file. A buffer may be modified in several ways after reading into the buffer due to advanced Emacs features, such as file-name-handlers, format decoding, -`find-file-hooks', etc. +`find-file-hook', etc. If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'. - This function ensures that none of these modifications will take place." +This function ensures that none of these modifications will take place." (letf* ((format-alist nil) (auto-mode-alist (if inhibit nil (mm-auto-mode-alist))) ((default-value 'major-mode) 'fundamental-mode) @@ -946,14 +900,8 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'. (append mm-inhibit-file-name-handlers inhibit-file-name-handlers) inhibit-file-name-handlers)) - (ffh (if (boundp 'find-file-hook) - 'find-file-hook - 'find-file-hooks)) - (val (symbol-value ffh))) - (set ffh nil) - (unwind-protect - (insert-file-contents filename visit beg end replace) - (set ffh val)))) + (find-file-hook nil)) + (insert-file-contents filename visit beg end replace))) (defun mm-append-to-file (start end filename &optional codesys inhibit) "Append the contents of the region to the end of file FILENAME. @@ -1017,39 +965,23 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'." result))) ;; Fixme: This doesn't look useful where it's used. -(if (fboundp 'detect-coding-region) - (defun mm-detect-coding-region (start end) - "Like `detect-coding-region' except returning the best one." - (let ((coding-systems - (detect-coding-region start end))) - (or (car-safe coding-systems) - coding-systems))) - (defun mm-detect-coding-region (start end) - (let ((point (point))) - (goto-char start) - (skip-chars-forward "\0-\177" end) - (prog1 - (if (eq (point) end) 'ascii (mm-guess-charset)) - (goto-char point))))) +(defun mm-detect-coding-region (start end) + "Like `detect-coding-region' except returning the best one." + (let ((coding-systems (detect-coding-region start end))) + (or (car-safe coding-systems) + coding-systems))) (declare-function mm-detect-coding-region "mm-util" (start end)) -(if (fboundp 'coding-system-get) - (defun mm-detect-mime-charset-region (start end) - "Detect MIME charset of the text in the region between START and END." - (let ((cs (mm-detect-coding-region start end))) - (or (coding-system-get cs :mime-charset) - (coding-system-get cs 'mime-charset)))) - (defun mm-detect-mime-charset-region (start end) - "Detect MIME charset of the text in the region between START and END." - (let ((cs (mm-detect-coding-region start end))) - cs))) +(defun mm-detect-mime-charset-region (start end) + "Detect MIME charset of the text in the region between START and END." + (let ((cs (mm-detect-coding-region start end))) + (coding-system-get cs 'mime-charset))) (defun mm-coding-system-to-mime-charset (coding-system) "Return the MIME charset corresponding to CODING-SYSTEM." - (when coding-system - (or (coding-system-get coding-system :mime-charset) - (coding-system-get coding-system 'mime-charset)))) + (and coding-system + (coding-system-get coding-system 'mime-charset))) (defvar jka-compr-acceptable-retval-list) (declare-function jka-compr-make-temp-name "jka-compr" (&optional local)) @@ -1118,14 +1050,6 @@ decompressed data. The buffer's multibyteness must be turned off." (message "%s" (or err-msg (concat msg "done"))) retval))))) -(eval-when-compile - (unless (fboundp 'coding-system-name) - (defalias 'coding-system-name 'ignore)) - (unless (fboundp 'find-file-coding-system-for-read-from-filename) - (defalias 'find-file-coding-system-for-read-from-filename 'ignore)) - (unless (fboundp 'find-operation-coding-system) - (defalias 'find-operation-coding-system 'ignore))) - (defun mm-find-buffer-file-coding-system (&optional filename) "Find coding system used to decode the contents of the current buffer. This function looks for the coding system magic cookie or examines the commit 014e0d151949c5ecba667f36ca449cbbb719eb54 Author: Lars Ingebrigtsen Date: Sun Feb 14 14:06:23 2016 +1100 Remove some compat code from mm-*.el * lisp/gnus/mm-bodies.el (mm-decode-body): Ditto. * lisp/gnus/mm-decode.el (mm-tmp-directory) (mm-valid-image-format-p): Remove compat code. * lisp/gnus/mm-url.el (mm-url-insert-file-contents): Remove "Connection" "Close" workaround for older Emacsen. diff --git a/lisp/gnus/flow-fill.el b/lisp/gnus/flow-fill.el index 904f031..d288142 100644 --- a/lisp/gnus/flow-fill.el +++ b/lisp/gnus/flow-fill.el @@ -157,7 +157,6 @@ RFC 2646 suggests 66 characters for readability." (condition-case nil (let ((fill-prefix (when quote (concat quote " "))) (fill-column (eval fill-flowed-display-column)) - filladapt-mode adaptive-fill-mode) (fill-region (point-at-bol) (min (1+ (point-at-eol)) diff --git a/lisp/gnus/gnus-cite.el b/lisp/gnus/gnus-cite.el index 0881663..4f05d2e 100644 --- a/lisp/gnus/gnus-cite.el +++ b/lisp/gnus/gnus-cite.el @@ -527,7 +527,6 @@ longer than the frame width." (inhibit-point-motion-hooks t) (marks (gnus-dissect-cited-text)) (adaptive-fill-mode nil) - (filladapt-mode nil) (fill-column (if width (prefix-numeric-value width) fill-column))) (save-restriction (while (cdr marks) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 46f0177..f570ff4 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -656,10 +656,12 @@ variable should be a regexp or a list of regexps." (defun message-send-mail-function () "Return suitable value for the variable `message-send-mail-function'." (cond ((and (require 'sendmail) + (boundp 'sendmail-program) sendmail-program (executable-find sendmail-program)) 'message-send-mail-with-sendmail) ((and (locate-library "smtpmail") + (boundp 'smtpmail-default-smtp-server) smtpmail-default-smtp-server) 'message-smtpmail-send-it) ((locate-library "mailclient") diff --git a/lisp/gnus/mm-bodies.el b/lisp/gnus/mm-bodies.el index e07edd3..91e1a27 100644 --- a/lisp/gnus/mm-bodies.el +++ b/lisp/gnus/mm-bodies.el @@ -259,10 +259,7 @@ decoding. If it is nil, default to `mail-parse-charset'." (or (not (eq coding-system 'ascii)) (setq coding-system mail-parse-charset))) (decode-coding-region (point-min) (point-max) coding-system)) - (setq buffer-file-coding-system - (if (boundp 'last-coding-system-used) - (symbol-value 'last-coding-system-used) - coding-system)))))) + (setq buffer-file-coding-system last-coding-system-used))))) (defun mm-decode-string (string charset) "Decode STRING with CHARSET." diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 28b08af..51fcd8b 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -382,12 +382,7 @@ enables you to choose manually one of two types those mails include." :type '(repeat regexp) ;; See `mm-preferred-alternative-precedence'. :group 'mime-display) -(defcustom mm-tmp-directory - (if (fboundp 'temp-directory) - (temp-directory) - (if (boundp 'temporary-file-directory) - temporary-file-directory - "/tmp/")) +(defcustom mm-tmp-directory temporary-file-directory "Where mm will store its temporary files." :type 'directory :group 'mime-display) @@ -1587,8 +1582,7 @@ be determined." (defun mm-valid-image-format-p (format) "Say whether FORMAT can be displayed natively by Emacs." - (and (fboundp 'image-type-available-p) - (display-graphic-p) + (and (display-graphic-p) (image-type-available-p format))) (defun mm-valid-and-fit-image-p (format handle) @@ -1787,8 +1781,7 @@ If RECURSIVE, search recursively." (defun mm-shr (handle) ;; Require since we bind its variables. (require 'shr) - (let ((shr-width (if (and (boundp 'shr-use-fonts) - shr-use-fonts) + (let ((shr-width (if shr-use-fonts nil fill-column)) (shr-content-function (lambda (id) diff --git a/lisp/gnus/mm-url.el b/lisp/gnus/mm-url.el index fb11d7a..6919266 100644 --- a/lisp/gnus/mm-url.el +++ b/lisp/gnus/mm-url.el @@ -276,19 +276,10 @@ If `mm-url-use-external' is non-nil, use `mm-url-program'." (insert-file-contents (substring url (1- (match-end 0)))) (mm-url-insert-file-contents-external url)) (goto-char (point-min)) - (if (fboundp 'url-generic-parse-url) - (setq url-current-object - (url-generic-parse-url url))) + (setq url-current-object (url-generic-parse-url url)) (list url (buffer-size))) (mm-url-load-url) (let ((name buffer-file-name) - (url-request-extra-headers - ;; ISTM setting a Connection header was a workaround for - ;; older versions of url included with w3, but it does more - ;; harm than good with the one shipped with Emacs. --ansel - (if (not (and (boundp 'url-version) - (equal url-version "Emacs"))) - (list (cons "Connection" "Close")))) result) (setq result (url-insert-file-contents url)) (save-excursion @@ -296,10 +287,9 @@ If `mm-url-use-external' is non-nil, use `mm-url-program'." (while (re-search-forward "\r 1000\r ?" nil t) (replace-match ""))) (setq buffer-file-name name) - (if (and (fboundp 'url-generic-parse-url) - (listp result)) - (setq url-current-object (url-generic-parse-url - (car result)))) + (when (listp result) + (setq url-current-object + (url-generic-parse-url (car result)))) result))) ;;;###autoload @@ -399,10 +389,7 @@ spaces. Die Die Die." ((= char ? ) "+") ((memq char mm-url-unreserved-chars) (char-to-string char)) (t (upcase (format "%%%02x" char))))) - (encode-coding-string chunk - (if (fboundp 'find-coding-systems-string) - (car (find-coding-systems-string chunk)) - buffer-file-coding-system)) + (encode-coding-string chunk (car (find-coding-systems-string chunk))) ""))) (defun mm-url-encode-www-form-urlencoded (pairs) commit b9baa80d7f550c1b51613398db2b106bc7220e8b Author: Lars Ingebrigtsen Date: Sun Feb 14 13:57:55 2016 +1100 Remove compat code and functions from message.el * lisp/gnus/message.el (message-send-mail-function): Remove compat code. (message-dont-reply-to-names, message-mode) (message-setup-fill-variables, message-fill-paragraph) (message-remove-blank-cited-lines, message-make-from) (message-forward-rmail-make-body, message-tool-bar-gnome) (message-tab): Remove compat code. (message-completion-in-region): Remove. (message-read-from-minibuffer): Remove compat code. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 9ab44fa..46f0177 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -656,12 +656,10 @@ variable should be a regexp or a list of regexps." (defun message-send-mail-function () "Return suitable value for the variable `message-send-mail-function'." (cond ((and (require 'sendmail) - (boundp 'sendmail-program) sendmail-program (executable-find sendmail-program)) 'message-send-mail-with-sendmail) ((and (locate-library "smtpmail") - (boundp 'smtpmail-default-smtp-server) smtpmail-default-smtp-server) 'message-smtpmail-send-it) ((locate-library "mailclient") @@ -1351,9 +1349,8 @@ If nil, you might be asked to input the charset." :link '(custom-manual "(message)Various Message Variables") :type 'symbol) -(defcustom message-dont-reply-to-names - (and (boundp 'mail-dont-reply-to-names) mail-dont-reply-to-names) - "*Addresses to prune when doing wide replies. +(defcustom message-dont-reply-to-names mail-dont-reply-to-names + "Addresses to prune when doing wide replies. This can be a regexp, a list of regexps or a predicate function. Also, a value of nil means exclude your own user name only. @@ -2985,10 +2982,7 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." ;; Allow mail alias things. (cond ((message-mail-alias-type-p 'abbrev) - (if (fboundp 'mail-abbrevs-setup) - (mail-abbrevs-setup) - (if (fboundp 'mail-aliases-setup) ; warning avoidance - (mail-aliases-setup)))) + (mail-abbrevs-setup)) ((message-mail-alias-type-p 'ecomplete) (ecomplete-setup))) (add-hook 'completion-at-point-functions 'message-completion-function nil t) @@ -3014,8 +3008,6 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." (make-local-variable 'paragraph-separate) (make-local-variable 'paragraph-start) (make-local-variable 'adaptive-fill-regexp) - (unless (boundp 'adaptive-fill-first-line-regexp) - (setq adaptive-fill-first-line-regexp nil)) (make-local-variable 'adaptive-fill-first-line-regexp) (let ((quote-prefix-regexp ;; User should change message-cite-prefix-regexp if @@ -3457,12 +3449,10 @@ Prefix arg means justify as well." This function is used as the value of `fill-paragraph-function' in Message buffers and is not meant to be called directly." (interactive (list (if current-prefix-arg 'full))) - (if (if (boundp 'filladapt-mode) filladapt-mode) - nil - (if (message-point-in-header-p) - (message-fill-field) - (message-newline-and-reformat arg t)) - t)) + (if (message-point-in-header-p) + (message-fill-field) + (message-newline-and-reformat arg t)) + t) (defun message-point-in-header-p () "Return t if point is in the header." @@ -3746,15 +3736,11 @@ If REMOVE is non-nil, remove newlines, too. To use this automatically, you may add this function to `gnus-message-setup-hook'." (interactive "P") - (let ((citexp - (concat - "^\\(" - (when (boundp 'message-yank-cited-prefix) - (concat message-yank-cited-prefix "\\|")) - message-yank-prefix - "\\)+ *\n" - ))) - (message "removing `%s'" citexp) + (let ((citexp (concat "^\\(" + (concat message-yank-cited-prefix "\\|") + message-yank-prefix + "\\)+ *\n"))) + (message "Removing `%s'" citexp) (save-excursion (message-goto-body) (while (re-search-forward citexp nil t) @@ -5704,10 +5690,7 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'." "Make a From header." (let* ((style message-from-style) (login (or address (message-make-address))) - (fullname (or name - (and (boundp 'user-full-name) - user-full-name) - (user-full-name)))) + (fullname (or name user-full-name (user-full-name)))) (when (string= fullname "&") (setq fullname (user-login-name))) (with-temp-buffer @@ -5807,8 +5790,7 @@ give as trustworthy answer as possible." ;; `system-name' returned the right result. sysname) ;; Try `mail-host-address'. - ((and (boundp 'mail-host-address) - (stringp mail-host-address) + ((and (stringp mail-host-address) (not (string-match message-bogus-system-names mail-host-address))) mail-host-address) ;; We try `user-mail-address' as a backup. @@ -6340,11 +6322,10 @@ moved to the beginning " ((and message-beginning-of-line (message-point-in-header-p)) (let* ((point (point)) (bol (progn (beginning-of-line n) (point))) - (boh (message-beginning-of-header (and (boundp 'visual-line-mode) - visual-line-mode)))) + (boh (message-beginning-of-header visual-line-mode))) (goto-char (if (and boh (or (< boh point) (= bol point))) boh bol)))) ;; Go to beginning of visual line - ((and (boundp 'visual-line-mode) visual-line-mode) + (visual-line-mode (beginning-of-visual-line n)) ;; Go to beginning of line. ((beginning-of-line n)))) @@ -6424,10 +6405,7 @@ moved to the beginning " "Message already being composed; erase? ") (message nil)))) (error "Message being composed"))) - (funcall (or switch-function - (if (fboundp #'pop-to-buffer-same-window) - #'pop-to-buffer-same-window - #'pop-to-buffer)) + (funcall (or switch-function 'pop-to-buffer-same-window) name) (set-buffer name)) (erase-buffer) @@ -7606,10 +7584,8 @@ is for the internal use." (defun message-forward-rmail-make-body (forward-buffer) (save-window-excursion (set-buffer forward-buffer) - (if (rmail-msg-is-pruned) - (if (fboundp 'rmail-msg-restore-non-pruned-header) - (rmail-msg-restore-non-pruned-header) ; Emacs 22 - (rmail-toggle-header 0)))) ; Emacs 23 + (when (rmail-msg-is-pruned) + (rmail-toggle-header 0))) (message-forward-make-body forward-buffer)) ;; Fixme: Should have defcustom. @@ -7859,12 +7835,10 @@ Pre-defined symbols include `message-tool-bar-gnome' and (defcustom message-tool-bar-gnome '((ispell-message "spell" nil :vert-only t - :visible (or (not (boundp 'flyspell-mode)) - (not flyspell-mode))) + :visible (not flyspell-mode)) (flyspell-buffer "spell" t :vert-only t - :visible (and (boundp 'flyspell-mode) - flyspell-mode) + :visible flyspell-mode :help "Flyspell whole buffer") (message-send-and-exit "mail/send" t :label "Send") (message-dont-send "mail/save-draft") @@ -7929,9 +7903,7 @@ When FORCE, rebuild the tool bar." (gmm-image-load-path-for-library "message" "mail/save-draft.xpm" nil t)) - (image-load-path (cons (car load-path) - (when (boundp 'image-load-path) - image-load-path)))) + (image-load-path (cons (car load-path) image-load-path))) (gmm-tool-bar-from-list message-tool-bar message-tool-bar-zap-list 'message-mode-map)))) @@ -7982,10 +7954,8 @@ not in those headers. If that variable is nil, indent with the regular text mode tabbing command." (interactive) (cond - ((if (and (boundp 'completion-fail-discreetly) - (fboundp 'completion-at-point)) - (let ((completion-fail-discreetly t)) (completion-at-point)) - (funcall (or (message-completion-function) #'ignore))) + ((let ((completion-fail-discreetly t)) + (completion-at-point)) ;; Completion was performed; nothing else to do. nil) (message-tab-body-function (funcall message-tab-body-function)) @@ -8031,41 +8001,7 @@ regular text mode tabbing command." group) collection)) gnus-active-hashtb)) - (message-completion-in-region b e collection))) - -(defalias 'message-completion-in-region - (if (fboundp 'completion-in-region) - 'completion-in-region - (lambda (b e hashtb) - (let* ((string (buffer-substring b e)) - (completions (all-completions string hashtb)) - comp) - (delete-region b (point)) - (cond - ((= (length completions) 1) - (if (string= (car completions) string) - (progn - (insert string) - (message "Only matching group")) - (insert (car completions)))) - ((and (setq comp (try-completion string hashtb)) - (not (string= comp string))) - (insert comp)) - (t - (insert string) - (if (not comp) - (message "No matching groups") - (save-selected-window - (pop-to-buffer "*Completions*") - (buffer-disable-undo) - (let ((buffer-read-only nil)) - (erase-buffer) - (let ((standard-output (current-buffer))) - (display-completion-list (sort completions 'string<))) - (setq buffer-read-only nil) - (goto-char (point-min)) - (delete-region (point) - (progn (forward-line 3) (point)))))))))))) + (completion-in-region b e collection))) (defun message-expand-name () (cond ((and (memq 'eudc message-expand-name-databases) @@ -8187,13 +8123,9 @@ regexp VARSTR." (defun message-read-from-minibuffer (prompt &optional initial-contents) "Read from the minibuffer while providing abbrev expansion." - (if (fboundp 'mail-abbrevs-setup) - (let ((minibuffer-setup-hook 'mail-abbrevs-setup) - (minibuffer-local-map message-minibuffer-local-map)) - (read-from-minibuffer prompt initial-contents)) - (let ((minibuffer-setup-hook 'mail-abbrev-minibuffer-setup-hook) - (minibuffer-local-map message-minibuffer-local-map)) - (read-string prompt initial-contents)))) + (let ((minibuffer-setup-hook 'mail-abbrevs-setup) + (minibuffer-local-map message-minibuffer-local-map)) + (read-from-minibuffer prompt initial-contents))) (defun message-use-alternative-email-as-from () "Set From field of the outgoing message to the first matching commit 8e14ce4b5c88b9ec04d3a38ed2fcb8aa72b4c627 Author: Lars Ingebrigtsen Date: Sun Feb 14 13:04:15 2016 +1100 Declare rfc1843 instead of autoloading * lisp/gnus/gnus-art.el (rfc1843-decode-region): Declare instead of autoload. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 317d2c8..a2dc82e 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2671,11 +2671,12 @@ If READ-CHARSET, ask for a coding system." (point-min) (point-max) (mm-charset-to-coding-system charset nil t))))))) -(autoload 'rfc1843-decode-region "rfc1843") +(declare-function rfc1843-decode-region "rfc1843" (from to)) (defun article-decode-HZ () "Translate a HZ-encoded article." (interactive) + (require 'rfc1843) (save-excursion (let ((inhibit-read-only t)) (rfc1843-decode-region (point-min) (point-max))))) commit cebd899370fb3b143ba640c3b6499e982e869849 Author: Eli Zaretskii Date: Sat Feb 13 20:11:13 2016 +0200 Avoid signaling an error in 'dired-do-find-regexp-and-replace' * lisp/dired-aux.el: Require cl-lib, so that 'cl-mapcan' is autoloaded correctly. (Bug#22613) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 9bcb1f9..6d24800 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -38,6 +38,7 @@ ;; We need macros in dired.el to compile properly, ;; and we call subroutines in it too. (require 'dired) +(require 'cl-lib) ; for cl-mapcan (defvar dired-create-files-failures nil "Variable where `dired-create-files' records failing file names. commit f96cfce306ddceae9502a1962bc5030854c7acb2 Author: Eli Zaretskii Date: Sat Feb 13 15:17:51 2016 +0200 Fix network-stream-tests.el for MS-Windows * test/lisp/net/network-stream-tests.el (connect-to-tls-ipv6-nowait): Skip for MS-Windows builds. (connect-to-tls-ipv4-wait): Add a 0.1 sleep-for. diff --git a/test/lisp/net/network-stream-tests.el b/test/lisp/net/network-stream-tests.el index 92c5370..a5e146f 100644 --- a/test/lisp/net/network-stream-tests.el +++ b/test/lisp/net/network-stream-tests.el @@ -192,6 +192,10 @@ (setq status (gnutls-peer-status proc)) (should (consp status)) (delete-process proc) + ;; This sleep-for is needed for the native MS-Windows build. If + ;; it is removed, the next test mysteriously fails because the + ;; initial part of the echo is not received. + (sleep-for 0.1) (let ((issuer (plist-get (plist-get status :certificate) :issuer))) (should (stringp issuer)) (setq issuer (split-string issuer ",")) @@ -200,6 +204,7 @@ (ert-deftest connect-to-tls-ipv6-nowait () (skip-unless (executable-find "gnutls-serv")) (skip-unless (gnutls-available-p)) + (skip-unless (not (eq system-type 'windows-nt))) (let ((server (make-tls-server)) (times 0) proc status) commit d98ae99839a81c6279387a5e7679298f799fa99e Author: Lars Ingebrigtsen Date: Sat Feb 13 19:00:04 2016 +1100 Remove some Message compat functions * lisp/gnus/message.el (message-kill-all-overlays): Define unconditionally. (message-window-inside-pixel-edges): Remove. (mail-dont-reply-to): Remove. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 0a80646..9ab44fa 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -1936,20 +1936,8 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'." (autoload 'rmail-msg-is-pruned "rmail") (autoload 'rmail-output "rmailout") -;; Emacs < 24.1 do not have mail-dont-reply-to -(unless (fboundp 'mail-dont-reply-to) - (defalias 'mail-dont-reply-to 'rmail-dont-reply-to)) - -(eval-and-compile - (if (featurep 'emacs) - (progn - (defun message-kill-all-overlays () - (mapcar #'delete-overlay (overlays-in (point-min) (point-max)))) - (defalias 'message-window-inside-pixel-edges - 'window-inside-pixel-edges)) - (defun message-kill-all-overlays () - (map-extents (lambda (extent ignore) (delete-extent extent)))) - (defalias 'message-window-inside-pixel-edges 'ignore))) +(defun message-kill-all-overlays () + (mapcar #'delete-overlay (overlays-in (point-min) (point-max)))) @@ -8510,7 +8498,7 @@ Used in `message-simplify-recipients'." (goto-char (point-min)) (while (re-search-forward " Date: Sat Feb 13 18:57:01 2016 +1100 Remove some Gnus compat code * lisp/gnus/gnus-art.el (gnus-mime-inline-part): Remove compat code. (gnus-mm-display-part): Ditto. * lisp/gnus/gnus-start.el (gnus-dribble-read-file): Remove compat code. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 5925f01..317d2c8 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -5346,18 +5346,9 @@ Compressed files like .gz and .bz2 are decompressed." (let ((displayed-p (mm-handle-displayed-p handle))) (gnus-insert-mime-button handle (get-text-property btn 'gnus-part) (list displayed-p)) - (if (featurep 'emacs) - (delete-region - (point) - (next-single-property-change (point) 'gnus-data nil (point-max))) - (let* ((end (next-single-property-change (point) 'gnus-data)) - (annots (annotations-at (or end (point-max))))) - (delete-region (point) - (if end - (if annots (1+ end) end) - (point-max))) - (dolist (annot annots) - (set-extent-endpoints annot (point) (point))))) + (delete-region + (point) + (next-single-property-change (point) 'gnus-data nil (point-max))) (setq start (point)) (if (search-backward "\n\n" nil t) (progn @@ -5740,18 +5731,9 @@ all parts." ;; Toggle the button appearance between `[button]...' and `[button]'. (let ((displayed-p (mm-handle-displayed-p handle))) (gnus-insert-mime-button handle id (list displayed-p)) - (if (featurep 'emacs) - (delete-region - (point) - (next-single-property-change (point) 'gnus-data nil (point-max))) - (let* ((end (next-single-property-change (point) 'gnus-data)) - (annots (annotations-at (or end (point-max))))) - (delete-region (point) - (if end - (if annots (1+ end) end) - (point-max))) - (dolist (annot annots) - (set-extent-endpoints annot (point) (point))))) + (delete-region + (point) + (next-single-property-change (point) 'gnus-data nil (point-max))) (setq start (point)) (if (search-backward "\n\n" nil t) (progn diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index f2965ba..61e5409 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -888,9 +888,7 @@ If REGEXP is given, lines that match it will be deleted." (setq buffer-file-name dribble-file) ;; The buffer may be shrunk a lot when deleting old entries. ;; It caused the auto-saving to stop. - (if (featurep 'emacs) - (set (make-local-variable 'auto-save-include-big-deletions) t) - (set (make-local-variable 'disable-auto-save-when-buffer-shrinks) nil)) + (set (make-local-variable 'auto-save-include-big-deletions) t) (auto-save-mode t) (buffer-disable-undo) (bury-buffer (current-buffer)) commit 3982245371c0b8e17b4d96d16ed4b1d87c0ffc25 Author: Lars Ingebrigtsen Date: Sat Feb 13 18:45:11 2016 +1100 Sort groups before inserting them into the group buffer * lisp/gnus/gnus-group.el (gnus-group-describe-all-groups): Sort groups before inserting them. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index aaf6398..0cbaaf0 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -4117,22 +4117,23 @@ If DONT-SCAN is non-nil, scan non-activated groups as well." (gnus-read-all-descriptions-files))) (error "Couldn't request descriptions file")) (let ((buffer-read-only nil) - b) - (erase-buffer) + b groups) (mapatoms (lambda (group) - (setq b (point)) - (let ((charset (gnus-group-name-charset nil (symbol-name group)))) - (insert (format " *: %-20s %s\n" - (gnus-group-name-decode - (symbol-name group) charset) - (gnus-group-name-decode - (symbol-value group) charset)))) - (add-text-properties - b (1+ b) (list 'gnus-group group - 'gnus-unread t 'gnus-marked nil - 'gnus-level (1+ gnus-level-subscribed)))) + (push (symbol-name group) groups)) gnus-description-hashtb) + (setq groups (sort groups 'string<)) + (erase-buffer) + (dolist (group groups) + (setq b (point)) + (let ((charset (gnus-group-name-charset nil group))) + (insert (format " *: %-20s %s\n" + (gnus-group-name-decode group charset) + (gnus-group-name-decode group charset)))) + (add-text-properties + b (1+ b) (list 'gnus-group (intern group gnus-description-hashtb) + 'gnus-unread t 'gnus-marked nil + 'gnus-level (1+ gnus-level-subscribed)))) (goto-char (point-min)) (gnus-group-position-point))) commit ca5f9c97e6c78c1816ac4422736cf2bd7fdbb80b Author: Lars Ingebrigtsen Date: Sat Feb 13 18:20:55 2016 +1100 Make "unseen" tracking work again in Gnus * lisp/gnus/gnus-sum.el (gnus-update-marks): Make "unseen" tracking work again. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index adb9b02..d3e5ece 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -6036,6 +6036,11 @@ If SELECT-ARTICLES, only select those articles from GROUP." (setq arts (cdr arts))) (setq list (cdr all))))) + ;; When exiting the group, everything that's previously been + ;; unseen is now seen. + (when (eq (cdr type) 'seen) + (setq list (gnus-range-add list gnus-newsgroup-unseen))) + (when (eq (gnus-article-mark-to-type (cdr type)) 'list) (setq list (gnus-compress-sequence (set symbol (sort list '<)) t))) commit e8186ed0f0a293a6f9d2912b1543d66128e0d131 Author: Lars Ingebrigtsen Date: Sat Feb 13 18:13:03 2016 +1100 Remove Gnus compat functions defined in gnus.el * lisp/gnus/gnus.el (gnus-extent-detached-p): Remove. (gnus-extent-start-open, gnus-character-to-event) (gnus-assq-delete-all, gnus-add-text-properties) (gnus-put-text-property, gnus-key-press-event-p): diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index b35847b..6c1915b 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -2679,7 +2679,7 @@ The following commands are available: (let* ((gnus-tmp-name (format "%s" (car category))) (gnus-tmp-groups (length (gnus-agent-cat-groups category)))) (beginning-of-line) - (gnus-add-text-properties + (add-text-properties (point) (prog1 (1+ (point)) ;; Insert the text. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 4858c2a..5925f01 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2060,7 +2060,7 @@ always hide." (- gnus-article-normalized-header-length column) ? ))) ((> column gnus-article-normalized-header-length) - (gnus-put-text-property + (put-text-property (progn (forward-char gnus-article-normalized-header-length) (point)) @@ -2296,13 +2296,13 @@ long lines if and only if arg is positive." (goto-char (point-max)) (let ((start (point))) (insert "X-Boundary: ") - (gnus-add-text-properties start (point) gnus-hidden-properties) + (add-text-properties start (point) gnus-hidden-properties) (insert (let (str (max (window-width))) (while (>= max (length str)) (setq str (concat str gnus-body-boundary-delimiter))) (substring str 0 max)) "\n") - (gnus-put-text-property start (point) 'gnus-decoration 'header))))) + (put-text-property start (point) 'gnus-decoration 'header))))) (defun article-fill-long-lines () "Fill lines that are wider than the window width." @@ -6112,8 +6112,7 @@ If nil, don't show those extra buttons." (defun gnus-article-insert-newline () "Insert a newline, but mark it as undeletable." - (gnus-put-text-property - (point) (progn (insert "\n") (point)) 'gnus-undeletable t)) + (put-text-property (point) (progn (insert "\n") (point)) 'gnus-undeletable t)) (defun gnus-mime-display-alternative (handles &optional preferred ibegend id) (let* ((preferred (or preferred (mm-preferred-alternative handles))) @@ -6139,7 +6138,7 @@ If nil, don't show those extra buttons." (not preferred) (not (gnus-unbuttonized-mime-type-p "multipart/alternative"))) - (gnus-add-text-properties + (add-text-properties (setq from (point)) (progn (insert (format "%d. " id)) @@ -6161,7 +6160,7 @@ If nil, don't show those extra buttons." :action 'gnus-widget-press-button) ;; Do the handles (while (setq handle (pop handles)) - (gnus-add-text-properties + (add-text-properties (setq from (point)) (progn (insert (format "(%c) %-18s" @@ -6529,14 +6528,14 @@ If given a numerical ARG, move forward ARG pages." (interactive) (when (gnus-article-next-page) (goto-char (point-min)) - (gnus-article-read-summary-keys nil (gnus-character-to-event ?n)))) + (gnus-article-read-summary-keys nil ?n))) (defun gnus-article-goto-prev-page () "Show the previous page of the article." (interactive) (if (save-restriction (widen) (bobp)) ;; Real beginning-of-buffer? - (gnus-article-read-summary-keys nil (gnus-character-to-event ?p)) + (gnus-article-read-summary-keys nil ?p) (gnus-article-prev-page nil))) ;; This is cleaner but currently breaks `gnus-pick-mode': @@ -6805,7 +6804,7 @@ not have a face in `gnus-article-boring-faces'." (defun gnus-article-read-summary-send-keys () (interactive) - (let ((unread-command-events (list (gnus-character-to-event ?S)))) + (let ((unread-command-events (list ?S))) (gnus-article-read-summary-keys))) (defun gnus-article-describe-key (key) @@ -7959,14 +7958,14 @@ do the highlighting. See the documentation for those functions." (when (and header-face (not (memq (point) hpoints))) (push (point) hpoints) - (gnus-put-text-property from (point) 'face header-face)) + (put-text-property from (point) 'face header-face)) (when (and field-face (not (memq (setq from (point)) fpoints))) (push from fpoints) (if (re-search-forward "^[^ \t]" nil t) (forward-char -2) (goto-char (point-max))) - (gnus-put-text-property from (point) 'face field-face))))))) + (put-text-property from (point) 'face field-face))))))) (defun gnus-article-highlight-signature () "Highlight the signature in an article. @@ -8021,7 +8020,7 @@ specified by `gnus-button-alist'." (gnus-article-extend-url-button from start end)) (gnus-article-add-button start end 'gnus-button-push (list from entry)) - (gnus-put-text-property + (put-text-property start end 'gnus-string (buffer-substring-no-properties start end)))))))))) @@ -8123,7 +8122,7 @@ url is put as the `gnus-button-url' overlay property on the button." (when gnus-article-button-face (overlay-put (make-overlay from to nil t) 'face gnus-article-button-face)) - (gnus-add-text-properties + (add-text-properties from to (nconc (and gnus-article-mouse-face (list 'mouse-face gnus-article-mouse-face)) diff --git a/lisp/gnus/gnus-bcklg.el b/lisp/gnus/gnus-bcklg.el index b7a6365..d5c7e0e 100644 --- a/lisp/gnus/gnus-bcklg.el +++ b/lisp/gnus/gnus-bcklg.el @@ -83,7 +83,7 @@ (insert-buffer-substring buffer) ;; Tag the beginning of the article with the ident. (if (> (point-max) b) - (gnus-put-text-property b (1+ b) 'gnus-backlog ident) + (put-text-property b (1+ b) 'gnus-backlog ident) (gnus-error 3 "Article %d is blank" number)))))))) (defun gnus-backlog-remove-oldest-article () diff --git a/lisp/gnus/gnus-cite.el b/lisp/gnus/gnus-cite.el index 57f463f..0881663 100644 --- a/lisp/gnus/gnus-cite.el +++ b/lisp/gnus/gnus-cite.el @@ -1118,7 +1118,7 @@ See also the documentation for `gnus-article-highlight-citation'." ((assq number gnus-cite-attribution-alist)) (t (gnus-add-wash-type 'cite) - (gnus-add-text-properties + (add-text-properties (point) (progn (forward-line 1) (point)) (nconc (list 'article-type 'cite) gnus-hidden-properties)))) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index a7c3ebb..aaf6398 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1393,7 +1393,7 @@ if it is a string, only list groups matching REGEXP." (or (not regexp) (and (stringp regexp) (string-match regexp group)) (and (functionp regexp) (funcall regexp group)))) - (gnus-add-text-properties + (add-text-properties (point) (prog1 (1+ (point)) (insert " " mark " *: " (gnus-group-decoded-name group) @@ -1569,7 +1569,7 @@ if it is a string, only list groups matching REGEXP." gnus-tmp-header) ; passed as parameter to user-funcs. (beginning-of-line) (setq beg (point)) - (gnus-add-text-properties + (add-text-properties (point) (prog1 (1+ (point)) ;; Insert the text. @@ -1597,11 +1597,11 @@ if it is a string, only list groups matching REGEXP." (progn (unless (bound-and-true-p cursor-sensor-mode) (cursor-sensor-mode 1)) - (gnus-put-text-property beg end 'cursor-sensor-functions + (put-text-property beg end 'cursor-sensor-functions '(gnus-tool-bar-update))) - (gnus-put-text-property beg end 'point-entered + (put-text-property beg end 'point-entered #'gnus-tool-bar-update) - (gnus-put-text-property beg end 'point-left + (put-text-property beg end 'point-left #'gnus-tool-bar-update)))) (defun gnus-group-update-eval-form (group list) @@ -1643,12 +1643,12 @@ and ends at END." (let ((face (cdar (gnus-group-update-eval-form group gnus-group-highlight)))) - (unless (eq face (gnus-get-text-property-excluding-characters-with-faces beg 'face)) + (unless (eq face (gnus-get-text-property-excluding-characters-with-faces + beg 'face)) (let ((inhibit-read-only t)) (gnus-put-text-property-excluding-characters-with-faces beg end 'face - (if (boundp face) (symbol-value face) face))) - (gnus-extent-start-open beg)))) + (if (boundp face) (symbol-value face) face)))))) (defun gnus-group-get-icon (group) "Return an icon for GROUP according to `gnus-group-icon-list'." @@ -3995,7 +3995,7 @@ entail asking the server for the groups." (erase-buffer) (while groups (setq group (pop groups)) - (gnus-add-text-properties + (add-text-properties (point) (prog1 (1+ (point)) (insert " *: " (gnus-group-decoded-name group) @@ -4128,7 +4128,7 @@ If DONT-SCAN is non-nil, scan non-activated groups as well." (symbol-name group) charset) (gnus-group-name-decode (symbol-value group) charset)))) - (gnus-add-text-properties + (add-text-properties b (1+ b) (list 'gnus-group group 'gnus-unread t 'gnus-marked nil 'gnus-level (1+ gnus-level-subscribed)))) diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index 1b289c2..afbb845 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el @@ -180,7 +180,7 @@ fit these criteria." alt-text (when (string-match "\\(alt\\|title\\)=\"\\([^\"]+\\)" parameters) (xml-substitute-special (match-string 2 parameters)))) - (gnus-add-text-properties + (add-text-properties start end (list 'image-url url 'image-displayer `(lambda (url start end) @@ -293,7 +293,7 @@ Use ALT-TEXT for the image string." (let ((overlay (make-overlay start end))) (overlay-put overlay 'evaporate t) (overlay-put overlay 'gnus-button-url url) - (gnus-put-text-property start end 'gnus-string url) + (put-text-property start end 'gnus-string url) (when gnus-article-mouse-face (overlay-put overlay 'mouse-face gnus-article-mouse-face))))) ;; The upper-case IMG_ALT is apparently just an artifact that @@ -455,10 +455,9 @@ Return a string with image data." :help-echo alt-text :keymap gnus-html-displayed-image-map url) - (gnus-put-text-property start (point) - 'gnus-alt-text alt-text) + (put-text-property start (point) 'gnus-alt-text alt-text) (when url - (gnus-add-text-properties + (add-text-properties start (point) `(image-url ,url diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el index c684007..f635d99 100644 --- a/lisp/gnus/gnus-icalendar.el +++ b/lisp/gnus/gnus-icalendar.el @@ -779,7 +779,7 @@ These will be used to retrieve the RSVP information from ical events." ;; FIXME: the gnus-mime-button-map keymap does not make sense for this kind ;; of button. (let ((start (point))) - (gnus-add-text-properties + (add-text-properties start (progn (insert "[ " text " ]") diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index e2b8dcc..5859fba 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1491,7 +1491,7 @@ See `gnus-summary-mail-forward' for ARG." (message-goto-subject) (re-search-forward " *$") (replace-match " (crosspost notification)" t t) - (gnus-deactivate-mark) + (deactivate-mark) (when (gnus-y-or-n-p "Send this complaint? ") (message-send-and-exit)))))) diff --git a/lisp/gnus/gnus-salt.el b/lisp/gnus/gnus-salt.el index b7af969..fc85bd6 100644 --- a/lisp/gnus/gnus-salt.el +++ b/lisp/gnus/gnus-salt.el @@ -218,7 +218,7 @@ This must be bound to a button-down mouse event." (start-point (posn-point start-posn)) (start-line (1+ (count-lines (point-min) start-point))) (start-window (posn-window start-posn)) - (bounds (gnus-window-edges start-window)) + (bounds (window-edges start-window)) (top (nth 1 bounds)) (bottom (if (window-minibuffer-p start-window) (nth 3 bounds) @@ -618,7 +618,7 @@ Two predefined functions are available: (t (cdar gnus-tree-brackets)))) (buffer-read-only nil) beg end) - (gnus-add-text-properties + (add-text-properties (setq beg (point)) (setq end (progn (eval gnus-tree-line-format-spec) (point))) (list 'gnus-number gnus-tmp-number)) @@ -834,8 +834,7 @@ it in the environment specified by BINDINGS." region) (set-buffer gnus-tree-buffer) (when (setq region (gnus-tree-article-region article)) - (when (or (not gnus-selected-tree-overlay) - (gnus-extent-detached-p gnus-selected-tree-overlay)) + (when (not gnus-selected-tree-overlay) ;; Create a new overlay. (overlay-put (setq gnus-selected-tree-overlay @@ -864,7 +863,7 @@ it in the environment specified by BINDINGS." (with-current-buffer (gnus-get-tree-buffer) (let (region) (when (setq region (gnus-tree-article-region article)) - (gnus-put-text-property (car region) (cdr region) 'face face) + (put-text-property (car region) (cdr region) 'face face) (set-window-point (gnus-get-buffer-window (current-buffer) t) (cdr region))))))) diff --git a/lisp/gnus/gnus-spec.el b/lisp/gnus/gnus-spec.el index 5d6ad7f..a3525d8 100644 --- a/lisp/gnus/gnus-spec.el +++ b/lisp/gnus/gnus-spec.el @@ -210,7 +210,7 @@ Return a list of updated types." :type 'face) (defun gnus-mouse-face-function (form type) - `(gnus-put-text-property + `(put-text-property (point) (progn ,@form (point)) 'mouse-face ,(if (equal type 0) @@ -243,19 +243,19 @@ Return a list of updated types." :type 'face) (defun gnus-face-face-function (form type) - `(gnus-add-text-properties + `(add-text-properties (point) (progn ,@form (point)) (cons 'face (cons ;; Delay consing the value of the `face' property until - ;; `gnus-add-text-properties' runs, since it will be modified - ;; by `gnus-put-text-property-excluding-characters-with-faces'. + ;; `add-text-properties' runs, since it will be modified + ;; by `put-text-property-excluding-characters-with-faces'. (list ',(symbol-value (intern (format "gnus-face-%d" type))) 'default) ;; Redundant now, but still convenient. '(gnus-face t))))) (defun gnus-balloon-face-function (form type) - `(gnus-put-text-property + `(put-text-property (point) (progn ,@form (point)) 'help-echo ,(intern (format "gnus-balloon-face-%d" type)))) @@ -424,7 +424,7 @@ characters when given a pad value." `(let (gnus-position) ,@(gnus-complex-form-to-spec form spec-alist) (if gnus-position - (gnus-put-text-property gnus-position (1+ gnus-position) + (put-text-property gnus-position (1+ gnus-position) 'gnus-position t))) `(progn ,@(gnus-complex-form-to-spec form spec-alist))))))) @@ -630,7 +630,7 @@ characters when given a pad value." If PROPS, insert the result." (let ((form (gnus-parse-format format alist props))) (if props - (gnus-add-text-properties (point) (progn (eval form) (point)) props) + (add-text-properties (point) (progn (eval form) (point)) props) (eval form)))) (defun gnus-set-format (type &optional insertable) diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el index 3578599..35a3882 100644 --- a/lisp/gnus/gnus-srvr.el +++ b/lisp/gnus/gnus-srvr.el @@ -308,7 +308,7 @@ The following commands are available: " (cloud)" ""))) (beginning-of-line) - (gnus-add-text-properties + (add-text-properties (point) (prog1 (1+ (point)) ;; Insert the text. @@ -863,7 +863,7 @@ claim them." (prefix (let ((gnus-select-method orig-select-method)) (gnus-group-prefixed-name "" method)))) (while (setq group (pop groups)) - (gnus-add-text-properties + (add-text-properties (point) (prog1 (1+ (point)) (insert diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index a208160..adb9b02 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -3625,7 +3625,7 @@ buffer that was in action when the last article was fetched." (defun gnus-summary-insert-dummy-line (gnus-tmp-subject gnus-tmp-number) "Insert a dummy root in the summary buffer." (beginning-of-line) - (gnus-add-text-properties + (add-text-properties (point) (progn (eval gnus-summary-dummy-line-format-spec) (point)) (list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number))) @@ -3731,7 +3731,7 @@ buffer that was in action when the last article was fetched." (setq gnus-tmp-lines "?") (setq gnus-tmp-lines (number-to-string gnus-tmp-lines))) (condition-case () - (gnus-put-text-property + (put-text-property (point) (progn (eval gnus-summary-line-format-spec) (point)) 'gnus-number gnus-tmp-number) @@ -5421,7 +5421,7 @@ or a straight list of headers." (if (= gnus-tmp-lines -1) (setq gnus-tmp-lines "?") (setq gnus-tmp-lines (number-to-string gnus-tmp-lines))) - (gnus-put-text-property + (put-text-property (point) (progn (eval gnus-summary-line-format-spec) (point)) 'gnus-number number) @@ -7788,7 +7788,7 @@ If BACKWARD, the previous article is selected instead of the next." "exiting")) (gnus-summary-next-group nil group backward))) (t - (when (gnus-key-press-event-p last-input-event) + (when (numberp last-input-event) ;; Somehow or other, we may now have selected a different ;; window. Make point go back to the summary buffer. (when (eq current-summary (current-buffer)) @@ -12387,7 +12387,7 @@ If REVERSE, save parts that do not match TYPE." ": " (or (cdr (assq 'execute (car pslist))) "") "\n") (setq e (point)) (forward-line -1) ; back to `b' - (gnus-add-text-properties + (add-text-properties b (1- e) (list 'gnus-number gnus-reffed-article-number 'mouse-face gnus-mouse-face)) (gnus-data-enter diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el index b471c2a..3923659 100644 --- a/lisp/gnus/gnus-topic.el +++ b/lisp/gnus/gnus-topic.el @@ -572,7 +572,6 @@ articles in the topic and its subtopics." (not (zerop unread)) ;Non-empty tick ;Ticked articles (/= point-max (point-max)))) ;Inactive groups - (gnus-extent-start-open (point)) (gnus-topic-insert-topic-line (car type) visiblep (not (eq (nth 2 type) 'hidden)) @@ -641,7 +640,7 @@ articles in the topic and its subtopics." (beginning-of-line) ;; Insert the text. (if shownp - (gnus-add-text-properties + (add-text-properties (point) (prog1 (1+ (point)) (eval gnus-topic-line-format-spec)) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 170404c..d9ea50b 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -782,9 +782,6 @@ If there's no subdirectory, delete DIRECTORY as well." (setq string (replace-match "" t t string))) string) -(declare-function gnus-put-text-property "gnus" - (start end property value &optional object)) - (defsubst gnus-put-text-property-excluding-newlines (beg end prop val) "The same as `put-text-property', but don't put this prop on any newlines in the region." (save-match-data @@ -792,9 +789,9 @@ If there's no subdirectory, delete DIRECTORY as well." (save-restriction (goto-char beg) (while (re-search-forward gnus-emphasize-whitespace-regexp end 'move) - (gnus-put-text-property beg (match-beginning 0) prop val) + (put-text-property beg (match-beginning 0) prop val) (setq beg (point))) - (gnus-put-text-property beg (point) prop val))))) + (put-text-property beg (point) prop val))))) (defsubst gnus-put-overlay-excluding-newlines (beg end prop val) "The same as `put-text-property', but don't put this prop on any newlines in the region." @@ -818,7 +815,7 @@ Otherwise, do nothing." (when (eq prop 'face) (setcar (cdr (get-text-property beg 'face)) (or val 'default))) (inline - (gnus-put-text-property beg stop prop val))) + (put-text-property beg stop prop val))) (setq beg stop)))) (defun gnus-get-text-property-excluding-characters-with-faces (pos prop) @@ -1265,20 +1262,17 @@ If HASH-TABLE-P is non-nil, regards SEQUENCE as a hash table." (put 'gnus-with-output-to-file 'lisp-indent-function 1) (put 'gnus-with-output-to-file 'edebug-form-spec '(form body)) -(declare-function gnus-add-text-properties "gnus" - (start end properties &optional object)) - (defun gnus-add-text-properties-when (property value start end properties &optional object) - "Like `gnus-add-text-properties', only applied on where PROPERTY is VALUE." + "Like `add-text-properties', only applied on where PROPERTY is VALUE." (let (point) (while (and start (< start end) ;; XEmacs will loop for every when start=end. (setq point (text-property-not-all start end property value))) - (gnus-add-text-properties start point properties object) + (add-text-properties start point properties object) (setq start (text-property-any point end property value))) (if start - (gnus-add-text-properties start end properties object)))) + (add-text-properties start end properties object)))) (defun gnus-remove-text-properties-when (property value start end properties &optional object) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 04496b6..f839325 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -303,15 +303,9 @@ be set in `.emacs' instead." :group 'gnus-start :type 'boolean) -(unless (featurep 'gnus-xmas) - (defalias 'gnus-extent-detached-p 'ignore) - (defalias 'gnus-extent-start-open 'ignore) - (defalias 'gnus-mail-strip-quoted-names 'mail-strip-quoted-names) - (defalias 'gnus-character-to-event 'identity) - (defalias 'gnus-assq-delete-all 'assq-delete-all) - (defalias 'gnus-add-text-properties 'add-text-properties) - (defalias 'gnus-put-text-property 'put-text-property) - (defvar gnus-mode-line-image-cache t) +(defvar gnus-mode-line-image-cache t) + +(eval-and-compile (if (fboundp 'find-image) (defun gnus-mode-line-buffer-identification (line) (let ((str (car-safe line)) @@ -336,12 +330,7 @@ be set in `.emacs' instead." str) (list str)) line))) - (defalias 'gnus-mode-line-buffer-identification 'identity)) - (defalias 'gnus-deactivate-mark 'deactivate-mark) - (defalias 'gnus-window-edges 'window-edges) - (defalias 'gnus-key-press-event-p 'numberp) - ;;(defalias 'gnus-decode-rfc1522 'ignore) - ) + (defalias 'gnus-mode-line-buffer-identification 'identity))) ;; We define these group faces here to avoid the display ;; update forced when creating new faces. commit ea03ab9662b4e4f317c5dbcc3cbbd8c435bdc97f Author: Lars Ingebrigtsen Date: Sat Feb 13 17:58:41 2016 +1100 Remove compat code from gnus-uu and win * lisp/gnus/gnus-util.el (gnus-image-type-available-p): Remove compat code. * lisp/gnus/gnus-uu.el (gnus-uu-tmp-dir): Remove compat code. * lisp/gnus/gnus-win.el (gnus-frames-on-display-list): Remove. diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 5e6b66d..170404c 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1734,10 +1734,7 @@ lists of strings." ;;; Image functions. (defun gnus-image-type-available-p (type) - (and (fboundp 'image-type-available-p) - (if (fboundp 'display-images-p) - (display-images-p) - t) + (and (display-images-p) (image-type-available-p type))) (defun gnus-create-image (file &optional type data-p &rest props) diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index 6a0c8f9..f199d16 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -217,11 +217,8 @@ Note that this variable can be used in conjunction with the ;; Various variables users may set -(defcustom gnus-uu-tmp-dir - (cond ((fboundp 'temp-directory) (temp-directory)) - ((boundp 'temporary-file-directory) temporary-file-directory) - ("/tmp/")) - "*Variable saying where gnus-uu is to do its work. +(defcustom gnus-uu-tmp-dir temporary-file-directory + "Variable saying where gnus-uu is to do its work. Default is \"/tmp/\"." :group 'gnus-extract :type 'directory) diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el index c17ccd6..9c950a9 100644 --- a/lisp/gnus/gnus-win.el +++ b/lisp/gnus/gnus-win.el @@ -508,18 +508,11 @@ should have point." (mapcar (lambda (b) (delete-windows-on b t)) (delq lowest-buf bufs))))) -(eval-and-compile - (cond - ((fboundp 'frames-on-display-list) - (defalias 'gnus-frames-on-display-list 'frames-on-display-list)) - (t - (defalias 'gnus-frames-on-display-list 'frame-list)))) - (defun gnus-get-buffer-window (buffer &optional frame) (cond ((and (null gnus-use-frames-on-any-display) (memq frame '(t 0 visible))) (car - (let ((frames (gnus-frames-on-display-list))) + (let ((frames (frames-on-display-list))) (gnus-remove-if (lambda (win) (not (memq (window-frame win) frames))) (get-buffer-window-list buffer nil frame))))) commit 9efc29a2dfda67c2e6b6693a6cb06a19fbdccaeb Author: Lars Ingebrigtsen Date: Sat Feb 13 17:40:34 2016 +1100 Remove several gnus-util compat functions * lisp/gnus/gnus-util.el (gnus-set-process-query-on-exit-flag): Remove. (gnus-read-shell-command): Remove. (gnus-match-substitute-replacement): Remove. (gnus-string-match-p): Remove. (gnus-string-prefix-p): Remove. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index e22d422..4858c2a 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2459,7 +2459,7 @@ long lines if and only if arg is positive." ;; The command is a string, so we interpret the command ;; as a, well, command, and fork it off. (let ((process-connection-type nil)) - (gnus-set-process-query-on-exit-flag + (set-process-query-on-exit-flag (start-process "article-x-face" nil shell-file-name shell-command-switch gnus-article-x-face-command) @@ -4126,8 +4126,7 @@ and the raw article including all headers will be piped." (setq command (if (and (eq command 'default) default) default - (gnus-read-shell-command "Shell command on this article: " - default)))) + (read-shell-command "Shell command on this article: " default)))) (when (string-equal command "") (if default (setq command default) diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 43a4969..e2b8dcc 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1904,10 +1904,10 @@ this is a reply." (cond ((stringp value) (if (and matched-string - (gnus-string-match-p "\\\\[&[:digit:]]" value) + (string-match-p "\\\\[&[:digit:]]" value) (match-beginning 1)) - (gnus-match-substitute-replacement value nil nil - matched-string) + (match-substitute-replacement value nil nil + matched-string) value)) ((or (symbolp value) (functionp value)) diff --git a/lisp/gnus/gnus-notifications.el b/lisp/gnus/gnus-notifications.el index d0b0202..2f6d6a8 100644 --- a/lisp/gnus/gnus-notifications.el +++ b/lisp/gnus/gnus-notifications.el @@ -182,8 +182,9 @@ This is typically a function to add in address (cond ((functionp gnus-ignored-from-addresses) (funcall gnus-ignored-from-addresses address)) - (t (gnus-string-match-p (gnus-ignored-from-addresses) - address)))) + (t (string-match-p + (gnus-ignored-from-addresses) + address)))) (let* ((photo-file (gnus-notifications-get-photo-file address)) (notification-id (gnus-notifications-notify (or (car address-components) address) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 2c87ba1..a208160 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -12061,7 +12061,7 @@ no matter what the properties `:decode' and `:headers' are." command result) (unless (numberp (car articles)) (error "No article to pipe")) - (setq command (gnus-read-shell-command + (setq command (read-shell-command (concat "Shell command on " (if (cdr articles) (format "these %d articles" (length articles)) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 23c6cd9..5e6b66d 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1656,15 +1656,6 @@ empty directories from OLD-PATH." (ignore-errors (set-file-modes filename mode))) -(if (fboundp 'set-process-query-on-exit-flag) - (defalias 'gnus-set-process-query-on-exit-flag - 'set-process-query-on-exit-flag) - (defalias 'gnus-set-process-query-on-exit-flag - 'process-kill-without-query)) - -(defalias 'gnus-read-shell-command - (if (fboundp 'read-shell-command) 'read-shell-command 'read-string)) - (declare-function image-size "image.c" (spec &optional pixels frame)) (defun gnus-rescale-image (image size) @@ -1715,48 +1706,6 @@ The first found will be returned if a file has hard or symbolic links." (memq elem list)))) found)) -(eval-and-compile - (cond - ((fboundp 'match-substitute-replacement) - (defalias 'gnus-match-substitute-replacement 'match-substitute-replacement)) - (t - (defun gnus-match-substitute-replacement (replacement &optional fixedcase literal string subexp) - "Return REPLACEMENT as it will be inserted by `replace-match'. -In other words, all back-references in the form `\\&' and `\\N' -are substituted with actual strings matched by the last search. -Optional FIXEDCASE, LITERAL, STRING and SUBEXP have the same -meaning as for `replace-match'. - -This is the definition of match-substitute-replacement in subr.el from GNU Emacs." - (let ((match (match-string 0 string))) - (save-match-data - (set-match-data (mapcar (lambda (x) - (if (numberp x) - (- x (match-beginning 0)) - x)) - (match-data t))) - (replace-match replacement fixedcase literal match subexp))))))) - -(if (fboundp 'string-match-p) - (defalias 'gnus-string-match-p 'string-match-p) - (defsubst gnus-string-match-p (regexp string &optional start) - "\ -Same as `string-match' except this function does not change the match data." - (save-match-data - (string-match regexp string start)))) - -(if (fboundp 'string-prefix-p) - (defalias 'gnus-string-prefix-p 'string-prefix-p) - (defun gnus-string-prefix-p (str1 str2 &optional ignore-case) - "Return non-nil if STR1 is a prefix of STR2. -If IGNORE-CASE is non-nil, the comparison is done without paying attention -to case differences." - (and (<= (length str1) (length str2)) - (let ((prefix (substring str2 0 (length str1)))) - (if ignore-case - (string-equal (downcase str1) (downcase prefix)) - (string-equal str1 prefix)))))) - (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/mm-decode.el b/lisp/gnus/mm-decode.el index 383aede..28b08af 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-read-shell-command "gnus-util") (autoload 'mm-inline-partial "mm-partial") (autoload 'mm-inline-external-body "mm-extern") @@ -1451,7 +1450,7 @@ text/\\(\\sw+\\)\\(?:;\\s-*charset=\\([^\"'>]+\\)\\)?[^>]*>" nil t) Use CMD as the process." (let ((name (mail-content-type-get (mm-handle-type handle) 'name)) (command (or cmd - (gnus-read-shell-command + (read-shell-command "Shell command on MIME part: " mm-last-shell-command)))) (mm-with-unibyte-buffer (mm-insert-part handle) diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el index 4744187..bc7c0ac 100644 --- a/lisp/gnus/mml-sec.el +++ b/lisp/gnus/mml-sec.el @@ -704,9 +704,9 @@ be present in the keyring." ;; In contrast, signing requires secret key. (mml-secure-secret-key-exists-p context subkey)) (or (not fingerprint) - (gnus-string-match-p (concat fingerprint "$") fpr) - (gnus-string-match-p (concat fingerprint "$") - (epg-sub-key-fingerprint subkey)))) + (string-match-p (concat fingerprint "$") fpr) + (string-match-p (concat fingerprint "$") + (epg-sub-key-fingerprint subkey)))) (throw 'break t))))))) (defun mml-secure-find-usable-keys (context name usage &optional justone) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index eefe1a1..a53d6cd 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -437,7 +437,7 @@ textual parts.") :success " OK " :starttls-function (lambda (capabilities) - (when (gnus-string-match-p "STARTTLS" capabilities) + (when (string-match-p "STARTTLS" capabilities) "1 STARTTLS\r\n")))) (stream (car stream-list)) (props (cdr stream-list)) @@ -459,15 +459,15 @@ textual parts.") (nnheader-report 'nnimap "Unable to contact %s:%s via %s" nnimap-address (car ports) nnimap-stream) 'no-connect) - (gnus-set-process-query-on-exit-flag stream nil) - (if (not (gnus-string-match-p "[*.] \\(OK\\|PREAUTH\\)" greeting)) + (set-process-query-on-exit-flag stream nil) + (if (not (string-match-p "[*.] \\(OK\\|PREAUTH\\)" greeting)) (nnheader-report 'nnimap "%s" greeting) ;; Store the greeting (for debugging purposes). (setf (nnimap-greeting nnimap-object) greeting) (setf (nnimap-capabilities nnimap-object) (mapcar #'upcase (split-string capabilities))) - (unless (gnus-string-match-p "[*.] PREAUTH" greeting) + (unless (string-match-p "[*.] PREAUTH" greeting) (if (not (setq credentials (if (eq nnimap-authenticator 'anonymous) (list "anonymous" diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 7614002..6c2d113 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -1669,7 +1669,7 @@ actually)." (server (cadr (gnus-server-to-method srv))) (groupspec (mapconcat (lambda (x) - (if (gnus-string-match-p "gmane" x) + (if (string-match-p "gmane" x) (format "group:%s" (gnus-group-short-name x)) (error "Can't search non-gmane groups: %s" x))) groups " ")) diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el index e34a13b..cebdc95 100644 --- a/lisp/gnus/nnmaildir.el +++ b/lisp/gnus/nnmaildir.el @@ -97,14 +97,14 @@ See `nnmaildir-flag-mark-mapping'." (defun nnmaildir--ensure-suffix (filename) "Ensure that FILENAME contains the suffix \":2,\"." - (if (gnus-string-match-p ":2," filename) + (if (string-match-p ":2," filename) filename (concat filename ":2,"))) (defun nnmaildir--add-flag (flag suffix) "Return a copy of SUFFIX where FLAG is set. SUFFIX should start with \":2,\"." - (unless (gnus-string-match-p "^:2," suffix) + (unless (string-match-p "^:2," suffix) (error "Invalid suffix `%s'" suffix)) (let* ((flags (substring suffix 3)) (flags-as-list (append flags nil)) @@ -117,7 +117,7 @@ SUFFIX should start with \":2,\"." (defun nnmaildir--remove-flag (flag suffix) "Return a copy of SUFFIX where FLAG is cleared. SUFFIX should start with \":2,\"." - (unless (gnus-string-match-p "^:2," suffix) + (unless (string-match-p "^:2," suffix) (error "Invalid suffix `%s'" suffix)) (let* ((flags (substring suffix 3)) (flags-as-list (append flags nil)) @@ -848,11 +848,11 @@ by nnmaildir-request-article.") (when (or ;; first look for marks in suffix, if it's valid... (when (and (stringp suffix) - (gnus-string-prefix-p ":2," suffix)) + (string-prefix-p ":2," suffix)) (or - (not (gnus-string-match-p + (not (string-match-p (string (nnmaildir--mark-to-flag 'read)) suffix)) - (gnus-string-match-p + (string-match-p (string (nnmaildir--mark-to-flag 'tick)) suffix))) ;; then look in marks directories (not (file-exists-p (concat cdir prefix))) diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index 6108b5a..e6483c2 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -1302,7 +1302,7 @@ If SEND-IF-FORCE, only send authinfo to the server if the ;; Use TCP-keepalive so that connections that pass through a NAT router ;; don't hang when left idle. (set-network-process-option process :keepalive t)) - (gnus-set-process-query-on-exit-flag process nil) + (set-process-query-on-exit-flag process nil) (if (and (nntp-wait-for process "^2.*\n" buffer nil t) (memq (process-status process) '(open run))) (prog1 diff --git a/lisp/gnus/spam-report.el b/lisp/gnus/spam-report.el index 0b58dc8..88854e0 100644 --- a/lisp/gnus/spam-report.el +++ b/lisp/gnus/spam-report.el @@ -255,7 +255,7 @@ This is initialized based on `user-mail-address'." 80)) (error "Could not open connection to %s" host)) (set-marker (process-mark tcp-connection) (point-min)) - (gnus-set-process-query-on-exit-flag tcp-connection nil) + (set-process-query-on-exit-flag tcp-connection nil) (process-send-string tcp-connection (format "GET %s HTTP/1.1\nUser-Agent: %s\nHost: %s\n\n" commit 9bcefcf0b0bcb860f432299c8e6cf109d07ee8ef Author: Lars Ingebrigtsen Date: Sat Feb 13 17:35:04 2016 +1100 Remove the gnus-merge alias * lisp/gnus/gnus-util.el (gnus-merge): Remove. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 5fb566e..2c87ba1 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -8614,7 +8614,7 @@ fetched for this group." (gnus-agent nil) (gnus-read-all-available-headers t)) (setq gnus-newsgroup-headers - (gnus-merge + (cl-merge 'list gnus-newsgroup-headers (gnus-fetch-headers articles nil t) 'gnus-article-sort-by-number)) @@ -9026,7 +9026,7 @@ non-numeric or nil fetch the number specified by the (gnus-sorted-nunion gnus-newsgroup-unreads new-unreads)) (setq gnus-newsgroup-headers (gnus-delete-duplicate-headers - (gnus-merge + (cl-merge 'list gnus-newsgroup-headers new-headers 'gnus-article-sort-by-number))) (setq gnus-newsgroup-articles @@ -12844,10 +12844,10 @@ returned." (mail-header-number h)) gnus-newsgroup-headers))) (setq gnus-newsgroup-headers - (gnus-merge 'list - gnus-newsgroup-headers - (gnus-fetch-headers articles nil t) - 'gnus-article-sort-by-number)) + (cl-merge 'list + gnus-newsgroup-headers + (gnus-fetch-headers articles nil t) + 'gnus-article-sort-by-number)) (setq gnus-newsgroup-articles (gnus-sorted-nunion gnus-newsgroup-articles articles)) ;; Suppress duplicates? diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index eadf04d..23c6cd9 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1609,21 +1609,6 @@ sequence, this is like `mapcar'. With several, it is like the Common Lisp (cdr ,result))) `(mapcar ,function ,seq1))) -(if (fboundp 'merge) - (defalias 'gnus-merge 'merge) - ;; Adapted from cl-seq.el - (defun gnus-merge (type list1 list2 pred) - "Destructively merge lists LIST1 and LIST2 to produce a new list. -Argument TYPE is for compatibility and ignored. -Ordering of the elements is preserved according to PRED, a `less-than' -predicate on the elements." - (let ((res nil)) - (while (and list1 list2) - (if (funcall pred (car list2) (car list1)) - (push (pop list2) res) - (push (pop list1) res))) - (nconc (nreverse res) list1 list2)))) - (defun gnus-emacs-version () "Stringified Emacs version." (let* ((lst (if (listp gnus-user-agent) commit f466bf32d943a41abb964d839ddf8a27c380920e Author: Lars Ingebrigtsen Date: Sat Feb 13 17:33:25 2016 +1100 Remove the gnus-union alias * lisp/gnus/gnus-util.el (gnus-union): Remove. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 7e48fbf..a7c3ebb 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1369,7 +1369,7 @@ if it is a string, only list groups matching REGEXP." (when (or gnus-group-listed-groups (and (>= level gnus-level-killed) (<= lowest gnus-level-killed))) (gnus-group-prepare-flat-list-dead - (gnus-union + (cl-union not-in-list (setq gnus-killed-list (sort gnus-killed-list 'string<)) :test 'equal) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index ff98041..eadf04d 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1265,29 +1265,6 @@ If HASH-TABLE-P is non-nil, regards SEQUENCE as a hash table." (put 'gnus-with-output-to-file 'lisp-indent-function 1) (put 'gnus-with-output-to-file 'edebug-form-spec '(form body)) -(if (fboundp 'union) - (defalias 'gnus-union 'union) - (defun gnus-union (l1 l2 &rest keys) - "Set union of lists L1 and L2. -If KEYS contains the `:test' and `equal' pair, use `equal' to compare -items in lists, otherwise use `eq'." - (cond ((null l1) l2) - ((null l2) l1) - ((equal l1 l2) l1) - (t - (or (>= (length l1) (length l2)) - (setq l1 (prog1 l2 (setq l2 l1)))) - (if (eq 'equal (plist-get keys :test)) - (while l2 - (or (member (car l2) l1) - (push (car l2) l1)) - (pop l2)) - (while l2 - (or (memq (car l2) l1) - (push (car l2) l1)) - (pop l2))) - l1)))) - (declare-function gnus-add-text-properties "gnus" (start end properties &optional object)) diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el index b441750..4744187 100644 --- a/lisp/gnus/mml-sec.el +++ b/lisp/gnus/mml-sec.el @@ -557,7 +557,7 @@ Return keys." (let* ((usage-prefs (mml-secure-cust-usage-lookup context usage)) (curr-fprs (cdr (assoc name (cdr usage-prefs)))) (key-fprs (mapcar 'mml-secure-fingerprint keys)) - (new-fprs (gnus-union curr-fprs key-fprs :test 'equal))) + (new-fprs (cl-union curr-fprs key-fprs :test 'equal))) (if curr-fprs (setcdr (assoc name (cdr usage-prefs)) new-fprs) (setcdr usage-prefs (cons (cons name new-fprs) (cdr usage-prefs)))) commit 6d4761330d7e2cf94ce8df07744c7b297bebb79e Author: Lars Ingebrigtsen Date: Sat Feb 13 17:31:10 2016 +1100 Remove the gnus-delete-alist alias * lisp/gnus/gnus-util.el (gnus-run-mode-hooks): Remove compat code. (gnus-delete-alist): Remove. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 1602c47..7e48fbf 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -4488,7 +4488,7 @@ and the second element is the address." (if force (if (null articles) (setcar (nthcdr 3 info) - (gnus-delete-alist type (car marked))) + (assq-delete-all type (car marked))) (setcdr m (gnus-compress-sequence articles t))) (setcdr m (gnus-compress-sequence (sort (nconc (gnus-uncompress-range (cdr m)) diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index 22ff7b9..14059ac 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -1431,7 +1431,7 @@ If FORMAT, also format the current score file." (and (file-exists-p file) (not (file-writable-p file)))) () - (setq score (setcdr entry (gnus-delete-alist 'touched score))) + (setq score (setcdr entry (assq-delete-all 'touched score))) (erase-buffer) (let (emacs-lisp-mode-hook) (if (and (not gnus-adaptive-pretty-print) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 23a1676..ff98041 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1115,11 +1115,8 @@ ARG is passed to the first function." (apply 'run-hook-with-args hook args))) (defun gnus-run-mode-hooks (&rest funcs) - "Run `run-mode-hooks' if it is available, otherwise `run-hooks'. -This function saves the current buffer." - (if (fboundp 'run-mode-hooks) - (save-current-buffer (apply 'run-mode-hooks funcs)) - (save-current-buffer (apply 'run-hooks funcs)))) + "Run `run-mode-hooks', saving the current buffer." + (save-current-buffer (apply 'run-mode-hooks funcs))) ;;; Various @@ -1167,16 +1164,6 @@ If HASH-TABLE-P is non-nil, regards SEQUENCE as a hash table." (setq sequence (cdr sequence)))) (nreverse out))) -(if (fboundp 'assq-delete-all) - (defalias 'gnus-delete-alist 'assq-delete-all) - (defun gnus-delete-alist (key alist) - "Delete from ALIST all elements whose car is KEY. -Return the modified alist." - (let (entry) - (while (setq entry (assq key alist)) - (setq alist (delq entry alist))) - alist))) - (defun gnus-grep-in-list (word list) "Find if a WORD matches any regular expression in the given LIST." (when (and word list) commit bfee9fab2f51a94db68247c6ee6eedebb7669209 Author: Lars Ingebrigtsen Date: Sat Feb 13 17:27:26 2016 +1100 Remove the gnus-float-time alias * lisp/gnus/gnus-util.el (gnus-completion-styles): Remove compat code. (gnus-float-time): Remove. diff --git a/lisp/gnus/ecomplete.el b/lisp/gnus/ecomplete.el index 76beb40..cb50cce 100644 --- a/lisp/gnus/ecomplete.el +++ b/lisp/gnus/ecomplete.el @@ -55,11 +55,7 @@ (defun ecomplete-add-item (type key text) (let ((elems (assq type ecomplete-database)) - (now (string-to-number - (format "%.0f" (if (featurep 'emacs) - (float-time) - (require 'gnus-util) - (gnus-float-time))))) + (now (string-to-number (format "%.0f" (float-time)))) entry) (unless elems (push (setq elems (list type)) ecomplete-database)) diff --git a/lisp/gnus/gnus-delay.el b/lisp/gnus/gnus-delay.el index 93069e5..2f387fc 100644 --- a/lisp/gnus/gnus-delay.el +++ b/lisp/gnus/gnus-delay.el @@ -103,10 +103,10 @@ DELAY is a string, giving the length of the time. Possible values are: (aset deadline 1 minute) (aset deadline 2 hour) ;; Convert to seconds. - (setq deadline (gnus-float-time (apply 'encode-time - (append deadline nil)))) + (setq deadline (float-time (apply 'encode-time + (append deadline nil)))) ;; If this time has passed already, add a day. - (when (< deadline (gnus-float-time)) + (when (< deadline (float-time)) (setq deadline (+ 86400 deadline))) ; 86400 secs/day ;; Convert seconds to date header. (setq deadline (message-make-date @@ -129,7 +129,7 @@ DELAY is a string, giving the length of the time. Possible values are: (t (setq delay (* num 60)))) (setq deadline (message-make-date - (seconds-to-time (+ (gnus-float-time) delay))))) + (seconds-to-time (+ (float-time) delay))))) (t (error "Malformed delay `%s'" delay))) (message-add-header (format "%s: %s" gnus-delay-header deadline))) (set-buffer-modified-p t) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 89a5ca2..5fb566e 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -3848,8 +3848,8 @@ respectively." Returns \" ? \" if there's bad input or if another error occurs. Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"." (condition-case () - (let* ((messy-date (gnus-float-time (gnus-date-get-time messy-date))) - (now (gnus-float-time)) + (let* ((messy-date (float-time (gnus-date-get-time messy-date))) + (now (float-time)) ;;If we don't find something suitable we'll use this one (my-format "%b %d '%y")) (let* ((difference (- now messy-date)) @@ -5061,7 +5061,7 @@ Unscored articles will be counted as having a score of zero." (defun gnus-thread-latest-date (thread) "Return the highest article date in THREAD." (apply 'max - (mapcar (lambda (header) (gnus-float-time + (mapcar (lambda (header) (float-time (gnus-date-get-time (mail-header-date header)))) (message-flatten-list thread)))) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 6ca0de3..23a1676 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -52,13 +52,10 @@ gnus-iswitchb-completing-read))) (defcustom gnus-completion-styles - (if (and (boundp 'completion-styles-alist) - (boundp 'completion-styles)) - (append (when (and (assq 'substring completion-styles-alist) - (not (memq 'substring completion-styles))) - (list 'substring)) - completion-styles) - nil) + (append (when (and (assq 'substring completion-styles-alist) + (not (memq 'substring completion-styles))) + (list 'substring)) + completion-styles) "Value of `completion-styles' to use when completing." :version "24.1" :group 'gnus-meta @@ -291,13 +288,6 @@ Symbols are also allowed; their print names are used instead." (and (= (car fdate) (car date)) (> (nth 1 fdate) (nth 1 date)))))) -;; Every version of Emacs Gnus supports has built-in float-time. -;; The featurep test silences an irritating compiler warning. -(defalias 'gnus-float-time - (if (or (featurep 'emacs) - (fboundp 'float-time)) - 'float-time 'time-to-seconds)) - ;;; Keymap macros. (defmacro gnus-local-set-keys (&rest plist) diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el index 2388a1a..21398d1 100644 --- a/lisp/gnus/mail-source.el +++ b/lisp/gnus/mail-source.el @@ -629,8 +629,6 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile) 0) (funcall callback mail-source-crash-box info))) -(autoload 'gnus-float-time "gnus-util") - (defvar mail-source-incoming-last-checked-time nil) (defun mail-source-delete-crash-box () @@ -651,7 +649,7 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile) ;; Don't check for old incoming files more than once per day to ;; save a lot of file accesses. (when (or (null mail-source-incoming-last-checked-time) - (> (gnus-float-time + (> (float-time (time-since mail-source-incoming-last-checked-time)) (* 24 60 60))) (setq mail-source-incoming-last-checked-time (current-time)) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index c6f54da..eefe1a1 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -365,7 +365,7 @@ textual parts.") (with-current-buffer buffer (when (and nnimap-object (nnimap-last-command-time nnimap-object) - (> (gnus-float-time + (> (float-time (time-subtract now (nnimap-last-command-time nnimap-object))) diff --git a/lisp/gnus/nnspool.el b/lisp/gnus/nnspool.el index 07624f2..9db68b1 100644 --- a/lisp/gnus/nnspool.el +++ b/lisp/gnus/nnspool.el @@ -306,7 +306,7 @@ there.") "\\([^ ]+\\) +\\([0-9]+\\)[0-9][0-9][0-9] ")) (zerop (forward-line -1)))) ;; We require nnheader which requires gnus-util. - (let ((seconds (gnus-float-time (date-to-time date))) + (let ((seconds (float-time (date-to-time date))) groups) ;; Go through lines and add the latest groups to a list. (while (and (looking-at "\\([^ ]+\\) +[0-9]+ ") commit 2443e3801efe6b98d54f719e0b6527b6938e9988 Author: Lars Ingebrigtsen Date: Sat Feb 13 17:24:26 2016 +1100 Remove compat code from gnus-srvr, start and sum * lisp/gnus/gnus-srvr.el (gnus-browse-foreign-server): Remove compat code. * lisp/gnus/gnus-start.el (gnus-check-reasonable-setup): Remove compat code. * lisp/gnus/gnus-sum.el (gnus-summary-display-arrow) (gnus-summary-make-menu-bar, gnus-summary-make-tool-bar) (gnus-recenter) (gnus-summary-limit-strange-charsets-predicate) (gnus-summary-show-thread): Remove compat code. diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el index bb807da..3578599 100644 --- a/lisp/gnus/gnus-srvr.el +++ b/lisp/gnus/gnus-srvr.el @@ -880,8 +880,7 @@ claim them." (t ?K))) (max 0 (- (1+ (cddr group)) (cadr group))) ;; Don't decode if name is ASCII - (if (and (fboundp 'detect-coding-string) - (eq (detect-coding-string name t) 'undecided)) + (if (eq (detect-coding-string name t) 'undecided) name (decode-coding-string name diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 18b8686..f2965ba 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -3198,26 +3198,7 @@ If this variable is nil, don't do anything." (defun gnus-check-reasonable-setup () ;; Check whether nnml and nnfolder share a directory. - (let ((display-warn - (if (fboundp 'display-warning) - 'display-warning - (lambda (type message) - (if noninteractive - (message "Warning (%s): %s" type message) - (let (window) - (with-current-buffer (get-buffer-create "*Warnings*") - (goto-char (point-max)) - (unless (bolp) - (insert "\n")) - (insert (format "Warning (%s): %s\n" type message)) - (setq window (display-buffer (current-buffer))) - (set-window-start - window - (prog2 - (forward-line (- 1 (window-height window))) - (point) - (goto-char (point-max)))))))))) - method active actives match) + (let (method active actives match) (dolist (server gnus-server-alist) (setq method (gnus-server-to-method server) active (intern (format "%s-active-file" (car method)))) @@ -3225,11 +3206,11 @@ If this variable is nil, don't do anything." (gnus-server-opened method) (boundp active)) (when (setq match (assoc (symbol-value active) actives)) - (funcall display-warn 'gnus-server - (format "%s and %s share the same active file %s" - (car method) - (cadr match) - (car match)))) + (display-warning 'gnus-server + (format "%s and %s share the same active file %s" + (car method) + (cadr match) + (car match)))) (push (list (symbol-value active) method) actives))))) (provide 'gnus-start) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 688646f..89a5ca2 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -1061,9 +1061,7 @@ automatically when it is selected." :group 'gnus-summary :type 'hook) -(defcustom gnus-summary-display-arrow - (and (fboundp 'display-graphic-p) - (display-graphic-p)) +(defcustom gnus-summary-display-arrow (display-graphic-p) "*If non-nil, display an arrow highlighting the current article." :version "22.1" :group 'gnus-summary @@ -2442,10 +2440,7 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) '((1 . ,cs)))) (gnus-summary-show-article 1)))) `[,(symbol-name cs) ,command t])) - (sort (if (fboundp 'coding-system-list) - (coding-system-list) - (mapcar 'car mm-mime-mule-charset-alist)) - 'string<))))) + (sort (coding-system-list) 'string<))))) ("Washing" ("Remove Blanks" ["Leading" gnus-article-strip-leading-blank-lines t] @@ -2946,9 +2941,7 @@ When FORCE, rebuild the tool bar." (gmm-image-load-path-for-library "gnus" "mail/save.xpm" nil t)) - (image-load-path (cons (car load-path) - (when (boundp 'image-load-path) - image-load-path))) + (image-load-path (cons (car load-path) image-load-path)) (map (gmm-tool-bar-from-list gnus-summary-tool-bar gnus-summary-tool-bar-zap-list 'gnus-summary-mode-map))) @@ -6822,9 +6815,7 @@ Also do horizontal recentering." (when (and gnus-auto-center-summary (not (eq gnus-auto-center-summary 'vertical))) (gnus-horizontal-recenter)) - (if (fboundp 'recenter-top-bottom) - (recenter-top-bottom n) - (recenter n))) + (recenter-top-bottom n)) (put 'gnus-recenter 'isearch-scroll t) @@ -8321,15 +8312,14 @@ in `nnmail-extra-headers'." (gnus-summary-position-point)))) (defun gnus-summary-limit-strange-charsets-predicate (header) - (when (fboundp 'char-charset) - (let ((string (concat (mail-header-subject header) - (mail-header-from header))) - charset found) - (dotimes (i (1- (length string))) - (setq charset (format "%s" (char-charset (aref string (1+ i))))) - (when (string-match "unicode\\|big\\|japanese" charset) - (setq found t))) - found))) + (let ((string (concat (mail-header-subject header) + (mail-header-from header))) + charset found) + (dotimes (i (1- (length string))) + (setq charset (format "%s" (char-charset (aref string (1+ i))))) + (when (string-match "unicode\\|big\\|japanese" charset) + (setq found t))) + found)) (defun gnus-summary-limit-to-predicate (predicate) "Limit to articles where PREDICATE returns non-nil. @@ -11667,15 +11657,7 @@ Returns nil if no thread was there to be shown." (end (or (gnus-summary--inv end) (gnus-summary--inv (1- end)))) ;; Leave point at bol (beg (progn (beginning-of-line) (if (bobp) (point) (1- (point))))) - (eoi (when end - (if (fboundp 'next-single-char-property-change) - (next-single-char-property-change end 'invisible) - (while (progn - (end-of-line 2) - (and (not (eobp)) - (eq (get-char-property (point) 'invisible) - 'gnus-sum)))) - (point))))) + (eoi (and end (next-single-char-property-change end 'invisible)))) (when eoi (remove-overlays beg eoi 'invisible 'gnus-sum) (goto-char orig) commit 51ed8d5f4790ae8d296ac03e3fcba6c535f225f7 Author: Lars Ingebrigtsen Date: Sat Feb 13 17:13:35 2016 +1100 Remove compat code from gnus-spec.el * lisp/gnus/gnus-spec.el (gnus-lrm-string-p): Remove compat code. (gnus-balloon-face-function): Remove compat code. diff --git a/lisp/gnus/gnus-spec.el b/lisp/gnus/gnus-spec.el index 36f6f43..5d6ad7f 100644 --- a/lisp/gnus/gnus-spec.el +++ b/lisp/gnus/gnus-spec.el @@ -73,11 +73,9 @@ (header gnus-tmp-from)) (defmacro gnus-lrm-string-p (string) - (if (fboundp 'bidi-string-mark-left-to-right) - ;; LRM, RLM, PDF characters as integers to avoid breaking Emacs - ;; 23. - `(memq (aref ,string (1- (length ,string))) '(8206 8207 8236)) - nil)) + ;; LRM, RLM, PDF characters as integers to avoid breaking Emacs + ;; 23. + `(memq (aref ,string (1- (length ,string))) '(8206 8207 8236))) (defvar gnus-lrm-string (if (ignore-errors (string 8206)) (propertize (string 8206) 'invisible t) @@ -258,10 +256,7 @@ Return a list of updated types." (defun gnus-balloon-face-function (form type) `(gnus-put-text-property - (point) (progn ,@form (point)) - ,(if (fboundp 'balloon-help-mode) - ''balloon-help - ''help-echo) + (point) (progn ,@form (point)) 'help-echo ,(intern (format "gnus-balloon-face-%d" type)))) (defun gnus-spec-tab (column) commit 7a42ebd969efd896185b0822e7031268a8f8080d Author: Lars Ingebrigtsen Date: Sat Feb 13 17:04:00 2016 +1100 Fix compat change in last check-in * lisp/gnus/gnus-group.el (gnus-group-name-charset-group-alist): `find-coding-system' doesn't exist in Emacs. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 3b481db..1602c47 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -421,8 +421,7 @@ For example: :type '(repeat (cons (sexp :tag "Method") (symbol :tag "Charset")))) (defcustom gnus-group-name-charset-group-alist - (if (or (find-coding-system 'utf-8) - (mm-coding-system-p 'utf-8)) + (if (mm-coding-system-p 'utf-8) '((".*" . utf-8)) nil) "Alist of group regexp and the charset for group names. commit 8a1143b7b6ca7270d1848111cc2edf539aced25b Author: Lars Ingebrigtsen Date: Sat Feb 13 17:01:31 2016 +1100 Always use url-queue * lisp/gnus/gnus-html.el (gnus-html-schedule-image-fetching): Always use url-queue. diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index 6d6e094..1b289c2 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el @@ -40,6 +40,7 @@ (require 'browse-url) (require 'mm-util) (require 'help-fns) +(require 'url-queue) (defcustom gnus-html-image-cache-ttl (days-to-time 7) "Time used to determine if we should use images from the cache." @@ -373,14 +374,9 @@ Use ALT-TEXT for the image string." "Retrieve IMAGE, and place it into BUFFER on arrival." (gnus-message 8 "gnus-html-schedule-image-fetching: buffer %s, image %s" buffer image) - (if (fboundp 'url-queue-retrieve) - (url-queue-retrieve (car image) - 'gnus-html-image-fetched - (list buffer image) t t) - (ignore-errors - (url-retrieve (car image) - 'gnus-html-image-fetched - (list buffer image))))) + (url-queue-retrieve (car image) + 'gnus-html-image-fetched + (list buffer image) t t)) (defun gnus-html-image-fetched (status buffer image) "Callback function called when image has been fetched." commit fb5406aa9ab3dd37220636afe6202afd784c7b33 Author: Lars Ingebrigtsen Date: Sat Feb 13 17:00:05 2016 +1100 Remove compat functions from gnus-html.el * lisp/gnus/gnus-html.el (gnus-html-encode-url-chars): Remove. diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index f3b5b96..6d6e094 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el @@ -88,27 +88,9 @@ fit these criteria." (define-key map [tab] 'widget-forward) map)) -(eval-and-compile - (defalias 'gnus-html-encode-url-chars - (if (fboundp 'browse-url-url-encode-chars) - 'browse-url-url-encode-chars - (lambda (text chars) - "URL-encode the chars in TEXT that match CHARS. -CHARS is a regexp-like character alternative (e.g., \"[)$]\")." - (let ((encoded-text (copy-sequence text)) - (s 0)) - (while (setq s (string-match chars encoded-text s)) - (setq encoded-text - (replace-match (format "%%%x" - (string-to-char - (match-string 0 encoded-text))) - t t encoded-text) - s (1+ s))) - encoded-text))))) - (defun gnus-html-encode-url (url) "Encode URL." - (gnus-html-encode-url-chars url "[)$ ]")) + (browse-url-url-encode-chars url "[)$ ]")) (defun gnus-html-cache-expired (url ttl) "Check if URL is cached for more than TTL." commit 980122794b41b728e6eb7aaa1054e14f746e1b1c Author: Lars Ingebrigtsen Date: Sat Feb 13 16:58:25 2016 +1100 Remove compat code from gnus-group.el * lisp/gnus/gnus-group.el (gnus-group-name-charset-group-alist) (gnus-group-make-tool-bar, gnus-group-update-tool-bar): Remove compat code. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 2a39b88..3b481db 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -421,7 +421,7 @@ For example: :type '(repeat (cons (sexp :tag "Method") (symbol :tag "Charset")))) (defcustom gnus-group-name-charset-group-alist - (if (or (and (fboundp 'find-coding-system) (find-coding-system 'utf-8)) + (if (or (find-coding-system 'utf-8) (mm-coding-system-p 'utf-8)) '((".*" . utf-8)) nil) @@ -1088,9 +1088,7 @@ When FORCE, rebuild the tool bar." (gmm-image-load-path-for-library "gnus" "gnus/toggle-subscription.xpm" nil t)) - (image-load-path (cons (car load-path) - (when (boundp 'image-load-path) - image-load-path))) + (image-load-path (cons (car load-path) image-load-path)) (map (gmm-tool-bar-from-list gnus-group-tool-bar gnus-group-tool-bar-zap-list 'gnus-group-mode-map))) @@ -1488,12 +1486,10 @@ if it is a string, only list groups matching REGEXP." ;; Date: Mon, 23 Jan 2006 19:59:13 +0100 ;; Message-ID: -(defcustom gnus-group-update-tool-bar - (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. - (fboundp 'force-window-update)) +;; Using `redraw-frame' (see `gnus-tool-bar-update') in Emacs might +;; be confusing, so maybe we shouldn't call it by default. +(defcustom gnus-group-update-tool-bar (and (boundp 'tool-bar-mode) + tool-bar-mode) "Force updating the group buffer tool bar." :group 'gnus-group :version "22.1" commit 983436de735ac25dccc13262ffdf7ca016842621 Author: Lars Ingebrigtsen Date: Sat Feb 13 16:52:47 2016 +1100 Define gnus-diary-kill-entire-line unconditionally * lisp/gnus/gnus-diary.el (gnus-diary-kill-entire-line): Define unconditionally. diff --git a/lisp/gnus/gnus-diary.el b/lisp/gnus/gnus-diary.el index 6f0bfe6..af278b4 100644 --- a/lisp/gnus/gnus-diary.el +++ b/lisp/gnus/gnus-diary.el @@ -83,13 +83,10 @@ There are currently two built-in format functions: ;; Compatibility functions ================================================== -(eval-and-compile - (if (fboundp 'kill-entire-line) - (defalias 'gnus-diary-kill-entire-line 'kill-entire-line) - (defun gnus-diary-kill-entire-line () - (beginning-of-line) - (let ((kill-whole-line t)) - (kill-line))))) +(defun gnus-diary-kill-entire-line () + (beginning-of-line) + (let ((kill-whole-line t)) + (kill-line))) ;; Summary line format ====================================================== commit 95a1925714976321c3b20c85d5727fc7045cac8e Author: Lars Ingebrigtsen Date: Sat Feb 13 16:50:56 2016 +1100 Remove compat code from gnus-cache and gnus-bookmark * lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-mode-map): Ditto. * lisp/gnus/gnus-cache.el (gnus-cache-decoded-group-name): Remove compat code. diff --git a/lisp/gnus/gnus-bookmark.el b/lisp/gnus/gnus-bookmark.el index 66fc610..7e18d5e 100644 --- a/lisp/gnus/gnus-bookmark.el +++ b/lisp/gnus/gnus-bookmark.el @@ -432,9 +432,7 @@ That is, all information but the name." nil (setq gnus-bookmark-bmenu-mode-map (make-keymap)) (suppress-keymap gnus-bookmark-bmenu-mode-map t) - (define-key gnus-bookmark-bmenu-mode-map "q" (if (fboundp 'quit-window) - 'quit-window - 'bury-buffer)) + (define-key gnus-bookmark-bmenu-mode-map "q" 'quit-window) (define-key gnus-bookmark-bmenu-mode-map "\C-m" 'gnus-bookmark-bmenu-select) (define-key gnus-bookmark-bmenu-mode-map "v" 'gnus-bookmark-bmenu-select) (define-key gnus-bookmark-bmenu-mode-map "d" 'gnus-bookmark-bmenu-delete) diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el index fa320e0..050e8cd 100644 --- a/lisp/gnus/gnus-cache.el +++ b/lisp/gnus/gnus-cache.el @@ -453,10 +453,8 @@ system for example was used.") (or (cdr (assoc group gnus-cache-decoded-group-names)) (let ((decoded (gnus-group-decoded-name group)) (coding (or nnmail-pathname-coding-system - (and (boundp 'file-name-coding-system) - file-name-coding-system) - (and (boundp 'default-file-name-coding-system) - default-file-name-coding-system)))) + file-name-coding-system + default-file-name-coding-system))) (push (cons group decoded) gnus-cache-decoded-group-names) (push (cons (decode-coding-string (encode-coding-string decoded coding) commit 6dc084079cb6c89fb533455e8569058cf01b350b Author: Lars Ingebrigtsen Date: Sat Feb 13 16:49:09 2016 +1100 Remove compat code from gnus-art.el * lisp/gnus/gnus-art.el (gnus-article-prepare) (gnus-mime-copy-part, gnus-output-to-file) (gnus-article-reply-with-original) (gnus-button-handle-apropos-variable) (gnus-button-handle-apropos-documentation): diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 0ac475d..e22d422 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -4603,8 +4603,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." (gnus-article-setup-buffer) (set-buffer gnus-article-buffer) ;; Deactivate active regions. - (when (and (boundp 'transient-mark-mode) - transient-mark-mode) + (when transient-mark-mode (setq mark-active nil)) (if (not (setq result (let ((inhibit-read-only t)) (gnus-request-article-this-buffer @@ -5261,10 +5260,7 @@ are decompressed." (progn (mm-enable-multibyte) (insert (decode-coding-string contents coding-system)) - (setq buffer-file-coding-system - (if (boundp 'last-coding-system-used) - (symbol-value 'last-coding-system-used) - coding-system))) + (setq buffer-file-coding-system last-coding-system-used)) (mm-disable-multibyte) (insert contents) (setq buffer-file-coding-system mm-binary-coding-system)) @@ -6457,14 +6453,13 @@ the coding cookie." (when coding ;; If the coding system is not suitable to encode the text, ;; ask a user for a proper one. - (when (fboundp 'select-safe-coding-system) - (setq coding (coding-system-base - (save-window-excursion - (select-safe-coding-system (point-min) (point-max) - coding)))) - (setq coding-system-for-write - (or (cdr (assq coding '((mule-utf-8 . utf-8)))) - coding))) + (setq coding (coding-system-base + (save-window-excursion + (select-safe-coding-system (point-min) (point-max) + coding)))) + (setq coding-system-for-write + (or (cdr (assq coding '((mule-utf-8 . utf-8)))) + coding)) (goto-char (point-min)) ;; Add the coding cookie. (insert (format "X-Gnus-Coding-System: -*- coding: %s; -*-\n\n" @@ -6930,8 +6925,7 @@ the entire article will be yanked." (gnus-summary-reply (list (list article)) wide)) (setq contents (buffer-substring (point) (mark t))) ;; Deactivate active regions. - (when (and (boundp 'transient-mark-mode) - transient-mark-mode) + (when transient-mark-mode (setq mark-active nil)) (with-current-buffer gnus-summary-buffer (gnus-summary-reply @@ -6956,8 +6950,7 @@ the entire article will be yanked." (gnus-summary-followup (list (list article)))) (setq contents (buffer-substring (point) (mark t))) ;; Deactivate active regions. - (when (and (boundp 'transient-mark-mode) - transient-mark-mode) + (when transient-mark-mode (setq mark-active nil)) (with-current-buffer gnus-summary-buffer (gnus-summary-followup @@ -7661,14 +7654,12 @@ Calls `describe-variable' or `describe-function'." (defun gnus-button-handle-apropos-variable (url) "Call `apropos' when pushing the corresponding URL button." - (funcall - (if (fboundp 'apropos-variable) 'apropos-variable 'apropos) + (apropos-variable (replace-regexp-in-string gnus-button-handle-describe-prefix "" url))) (defun gnus-button-handle-apropos-documentation (url) "Call `apropos' when pushing the corresponding URL button." - (funcall - (if (fboundp 'apropos-documentation) 'apropos-documentation 'apropos) + (apropos-documentation (replace-regexp-in-string gnus-button-handle-describe-prefix "" url))) (defun gnus-button-handle-library (url) commit c87f4a54742d86b34969b77756385d3c9abf8b2f Author: Lars Ingebrigtsen Date: Sat Feb 13 16:42:40 2016 +1100 Remove compat code from gnus-agent.el * lisp/gnus/gnus-agent.el (gnus-agent-make-mode-line-string): Remove compat code. diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index 11f93a2..b35847b 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -547,12 +547,9 @@ manipulated as follows: ["Remove" gnus-agent-remove-server t])))) (defun gnus-agent-make-mode-line-string (string mouse-button mouse-func) - (if (and (fboundp 'propertize) - (fboundp 'make-mode-line-mouse-map)) - (propertize string 'local-map - (make-mode-line-mouse-map mouse-button mouse-func) - 'mouse-face 'mode-line-highlight) - string)) + (propertize string 'local-map + (make-mode-line-mouse-map mouse-button mouse-func) + 'mouse-face 'mode-line-highlight)) (defun gnus-agent-toggle-plugged (set-to) "Toggle whether Gnus is unplugged or not." commit d88118db37dd543536677d7c4212a2c67621fb88 Author: Lars Ingebrigtsen Date: Sat Feb 13 16:40:17 2016 +1100 Rewrite gmm-labels usage to use cl-labels * lisp/gnus/gmm-utils.el (gmm-tool-bar-style): Remove compat code. (gmm-labels): Remove. diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el index a18b4c7..30bddef 100644 --- a/lisp/gnus/gmm-utils.el +++ b/lisp/gnus/gmm-utils.el @@ -196,10 +196,9 @@ This is a copy of the `lazy' widget in Emacs 22.1 provided for compatibility." (defcustom gmm-tool-bar-style (if (and (boundp 'tool-bar-mode) tool-bar-mode - (and (fboundp 'display-visual-class) - (not (memq (display-visual-class) - (list 'static-gray 'gray-scale - 'static-color 'pseudo-color))))) + (memq (display-visual-class) + (list 'static-gray 'gray-scale + 'static-color 'pseudo-color))) 'gnome 'retro) "Preferred tool bar style." @@ -390,20 +389,6 @@ If mode is nil, use `major-mode' of the current buffer." (string-match "^\\(.+\\)-mode$" mode) (match-string 1 mode)))))) -;; `labels' is obsolete since Emacs 24.3. -(defmacro gmm-labels (bindings &rest body) - "Make temporary function bindings. -The bindings can be recursive and the scoping is lexical, but capturing -them in closures will only work if `lexical-binding' is in use. But in -Emacs 24.2 and older, the lexical scoping is handled via `lexical-let' -rather than relying on `lexical-binding'. - -\(fn ((FUNC ARGLIST BODY...) ...) FORM...)" - `(,(progn (require 'cl) (if (fboundp 'cl-labels) 'cl-labels 'labels)) - ,bindings ,@body)) -(put 'gmm-labels 'lisp-indent-function 1) -(put 'gmm-labels 'edebug-form-spec '((&rest (sexp sexp &rest form)) &rest form)) - (defun gmm-format-time-string (format-string &optional time tz) "Use FORMAT-STRING to format the time TIME, or now if omitted. The optional TZ specifies the time zone in a number of seconds; any diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el index 17faac4..c684007 100644 --- a/lisp/gnus/gnus-icalendar.el +++ b/lisp/gnus/gnus-icalendar.el @@ -152,17 +152,19 @@ (defun gnus-icalendar-event--find-attendee (ical name-or-email) (let* ((event (car (icalendar--all-events ical))) (event-props (caddr event))) - (gmm-labels ((attendee-name (att) (plist-get (cadr att) 'CN)) - (attendee-email (att) - (replace-regexp-in-string "^.*MAILTO:" "" (caddr att))) - (attendee-prop-matches-p (prop) - (and (eq (car prop) 'ATTENDEE) - (or (member (attendee-name prop) name-or-email) - (let ((att-email (attendee-email prop))) - (gnus-icalendar-find-if (lambda (email) - (string-match email att-email)) - name-or-email)))))) - + (cl-labels ((attendee-name (att) (plist-get (cadr att) 'CN)) + (attendee-email + (att) + (replace-regexp-in-string "^.*MAILTO:" "" (caddr att))) + (attendee-prop-matches-p + (prop) + (and (eq (car prop) 'ATTENDEE) + (or (member (attendee-name prop) name-or-email) + (let ((att-email (attendee-email prop))) + (gnus-icalendar-find-if + (lambda (email) + (string-match email att-email)) + name-or-email)))))) (gnus-icalendar-find-if #'attendee-prop-matches-p event-props)))) (defun gnus-icalendar-event--get-attendee-names (ical) @@ -171,17 +173,19 @@ (lambda (p) (eq (car p) 'ATTENDEE)) (caddr event)))) - (gmm-labels ((attendee-role (prop) (plist-get (cadr prop) 'ROLE)) - (attendee-name (prop) - (or (plist-get (cadr prop) 'CN) - (replace-regexp-in-string "^.*MAILTO:" "" (caddr prop)))) - (attendees-by-type (type) - (gnus-remove-if-not - (lambda (p) (string= (attendee-role p) type)) - attendee-props)) - (attendee-names-by-type (type) - (mapcar #'attendee-name (attendees-by-type type)))) - + (cl-labels + ((attendee-role (prop) (plist-get (cadr prop) 'ROLE)) + (attendee-name + (prop) + (or (plist-get (cadr prop) 'CN) + (replace-regexp-in-string "^.*MAILTO:" "" (caddr prop)))) + (attendees-by-type (type) + (gnus-remove-if-not + (lambda (p) (string= (attendee-role p) type)) + attendee-props)) + (attendee-names-by-type + (type) + (mapcar #'attendee-name (attendees-by-type type)))) (list (attendee-names-by-type "REQ-PARTICIPANT") (attendee-names-by-type "OPT-PARTICIPANT"))))) @@ -220,23 +224,25 @@ ((string= method "REPLY") 'gnus-icalendar-event-reply) (t 'gnus-icalendar-event)))) - (gmm-labels ((map-property (prop) - (let ((value (icalendar--get-event-property event prop))) - (when value - ;; ugly, but cannot get - ;;replace-regexp-in-string work with "\\" as - ;;REP, plus we should also handle "\\;" - (replace-regexp-in-string - "\\\\," "," - (replace-regexp-in-string - "\\\\n" "\n" (substring-no-properties value)))))) - (accumulate-args (mapping) - (destructuring-bind (slot . ical-property) mapping - (setq args (append (list - (intern (concat ":" (symbol-name slot))) - (map-property ical-property)) - args))))) - + (cl-labels + ((map-property + (prop) + (let ((value (icalendar--get-event-property event prop))) + (when value + ;; ugly, but cannot get + ;;replace-regexp-in-string work with "\\" as + ;;REP, plus we should also handle "\\;" + (replace-regexp-in-string + "\\\\," "," + (replace-regexp-in-string + "\\\\n" "\n" (substring-no-properties value)))))) + (accumulate-args + (mapping) + (destructuring-bind (slot . ical-property) mapping + (setq args (append (list + (intern (concat ":" (symbol-name slot))) + (map-property ical-property)) + args))))) (mapc #'accumulate-args prop-map) (apply 'make-instance event-class args)))) @@ -264,41 +270,46 @@ status will be retrieved from the first matching attendee record." (let ((summary-status (capitalize (symbol-name status))) (attendee-status (upcase (symbol-name status))) reply-event-lines) - (gmm-labels ((update-summary (line) - (if (string-match "^[^:]+:" line) - (replace-match (format "\\&%s: " summary-status) t nil line) - line)) - (update-dtstamp () - (format-time-string "DTSTAMP:%Y%m%dT%H%M%SZ" nil t)) - (attendee-matches-identity (line) - (gnus-icalendar-find-if (lambda (name) (string-match-p name line)) - identities)) - (update-attendee-status (line) - (when (and (attendee-matches-identity line) - (string-match "\\(PARTSTAT=\\)[^;]+" line)) - (replace-match (format "\\1%s" attendee-status) t nil line))) - (process-event-line (line) - (when (string-match "^\\([^;:]+\\)" line) - (let* ((key (match-string 0 line)) - ;; NOTE: not all of the below fields are mandatory, - ;; but they are often present in other clients' - ;; replies. Can be helpful for debugging, too. - (new-line - (cond - ((string= key "ATTENDEE") (update-attendee-status line)) - ((string= key "SUMMARY") (update-summary line)) - ((string= key "DTSTAMP") (update-dtstamp)) - ((member key '("ORGANIZER" "DTSTART" "DTEND" - "LOCATION" "DURATION" "SEQUENCE" - "RECURRENCE-ID" "UID")) line) - (t nil)))) - (when new-line - (push new-line reply-event-lines)))))) + (cl-labels + ((update-summary + (line) + (if (string-match "^[^:]+:" line) + (replace-match (format "\\&%s: " summary-status) t nil line) + line)) + (update-dtstamp () + (format-time-string "DTSTAMP:%Y%m%dT%H%M%SZ" nil t)) + (attendee-matches-identity + (line) + (gnus-icalendar-find-if (lambda (name) (string-match-p name line)) + identities)) + (update-attendee-status + (line) + (when (and (attendee-matches-identity line) + (string-match "\\(PARTSTAT=\\)[^;]+" line)) + (replace-match (format "\\1%s" attendee-status) t nil line))) + (process-event-line + (line) + (when (string-match "^\\([^;:]+\\)" line) + (let* ((key (match-string 0 line)) + ;; NOTE: not all of the below fields are mandatory, + ;; but they are often present in other clients' + ;; replies. Can be helpful for debugging, too. + (new-line + (cond + ((string= key "ATTENDEE") (update-attendee-status line)) + ((string= key "SUMMARY") (update-summary line)) + ((string= key "DTSTAMP") (update-dtstamp)) + ((member key '("ORGANIZER" "DTSTART" "DTEND" + "LOCATION" "DURATION" "SEQUENCE" + "RECURRENCE-ID" "UID")) line) + (t nil)))) + (when new-line + (push new-line reply-event-lines)))))) (mapc #'process-event-line (split-string ical-request "\n")) (unless (gnus-icalendar-find-if (lambda (x) (string-match "^ATTENDEE" x)) - reply-event-lines) + reply-event-lines) (error "Could not find an event attendee matching given identity")) (mapconcat #'identity `("BEGIN:VEVENT" @@ -311,16 +322,17 @@ status will be retrieved from the first matching attendee record." The reply will have STATUS (`accepted', `tentative' or `declined'). The reply will be composed for attendees matching any entry on the IDENTITIES list." - (gmm-labels ((extract-block (blockname) - (save-excursion - (let ((block-start-re (format "^BEGIN:%s" blockname)) - (block-end-re (format "^END:%s" blockname)) - start) - (when (re-search-forward block-start-re nil t) - (setq start (line-beginning-position)) - (re-search-forward block-end-re) - (buffer-substring-no-properties start (line-end-position))))))) - + (cl-labels + ((extract-block + (blockname) + (save-excursion + (let ((block-start-re (format "^BEGIN:%s" blockname)) + (block-end-re (format "^END:%s" blockname)) + start) + (when (re-search-forward block-start-re nil t) + (setq start (line-beginning-position)) + (re-search-forward block-end-re) + (buffer-substring-no-properties start (line-end-position))))))) (let (zone event) (with-current-buffer (icalendar--get-unfolded-buffer (get-buffer buf)) (goto-char (point-min)) @@ -497,16 +509,17 @@ the optional ORG-FILE argument is specified, only that one file is searched." (let ((uid (gnus-icalendar-event:uid event)) (files (or org-file (org-agenda-files t 'ifmode)))) - (gmm-labels - ((find-event-in (file) - (org-check-agenda-file file) - (with-current-buffer (find-file-noselect file) - (let ((event-pos (org-find-entry-with-id uid))) - (when (and event-pos - (string= (cdr (assoc "ICAL_EVENT" (org-entry-properties event-pos))) - "t")) - (throw 'found file)))))) - + (cl-labels + ((find-event-in + (file) + (org-check-agenda-file file) + (with-current-buffer (find-file-noselect file) + (let ((event-pos (org-find-entry-with-id uid))) + (when (and event-pos + (string= (cdr (assoc "ICAL_EVENT" + (org-entry-properties event-pos))) + "t")) + (throw 'found file)))))) (gnus-icalendar-find-if #'find-event-in files)))) @@ -566,22 +579,29 @@ is searched." (fill-region (point-min) (point-max)))) ;; update entry properties - (gmm-labels - ((update-org-entry (position property value) - (if (or (null value) - (string= value "")) - (org-entry-delete position property) - (org-entry-put position property value)))) + (cl-labels + ((update-org-entry + (position property value) + (if (or (null value) + (string= value "")) + (org-entry-delete position property) + (org-entry-put position property value)))) (update-org-entry event-pos "ORGANIZER" organizer) (update-org-entry event-pos "LOCATION" location) - (update-org-entry event-pos "PARTICIPATION_TYPE" (symbol-name participation-type)) - (update-org-entry event-pos "REQ_PARTICIPANTS" (gnus-icalendar--format-participant-list req-participants)) - (update-org-entry event-pos "OPT_PARTICIPANTS" (gnus-icalendar--format-participant-list opt-participants)) + (update-org-entry event-pos "PARTICIPATION_TYPE" + (symbol-name participation-type)) + (update-org-entry event-pos "REQ_PARTICIPANTS" + (gnus-icalendar--format-participant-list + req-participants)) + (update-org-entry event-pos "OPT_PARTICIPANTS" + (gnus-icalendar--format-participant-list + opt-participants)) (update-org-entry event-pos "RRULE" recur) - (update-org-entry event-pos "REPLY" - (if reply-status (capitalize (symbol-name reply-status)) - "Not replied yet"))) + (update-org-entry + event-pos "REPLY" + (if reply-status (capitalize (symbol-name reply-status)) + "Not replied yet"))) (save-buffer))))))))) @@ -714,30 +734,31 @@ These will be used to retrieve the RSVP information from ical events." ;; TODO: make the template customizable (cl-defmethod gnus-icalendar-event->gnus-calendar ((event gnus-icalendar-event) &optional reply-status) "Format an overview of EVENT details." - (gmm-labels ((format-header (x) - (format "%-12s%s" - (propertize (concat (car x) ":") 'face 'bold) - (cadr x)))) + (cl-labels + ((format-header (x) + (format "%-12s%s" + (propertize (concat (car x) ":") 'face 'bold) + (cadr x)))) (with-slots (organizer summary description location recur uid method rsvp participation-type) event (let ((headers `(("Summary" ,summary) - ("Location" ,(or location "")) - ("Time" ,(gnus-icalendar-event:org-timestamp event)) - ("Organizer" ,organizer) - ("Attendance" ,(if (eq participation-type 'non-participant) - "You are not listed as an attendee" - (capitalize (symbol-name participation-type)))) - ("Method" ,method)))) - - (when (and (not (gnus-icalendar-event-reply-p event)) rsvp) - (setq headers (append headers - `(("Status" ,(or reply-status "Not replied yet")))))) - - (concat - (mapconcat #'format-header headers "\n") - "\n\n" - description))))) + ("Location" ,(or location "")) + ("Time" ,(gnus-icalendar-event:org-timestamp event)) + ("Organizer" ,organizer) + ("Attendance" ,(if (eq participation-type 'non-participant) + "You are not listed as an attendee" + (capitalize (symbol-name participation-type)))) + ("Method" ,method)))) + + (when (and (not (gnus-icalendar-event-reply-p event)) rsvp) + (setq headers (append headers + `(("Status" ,(or reply-status "Not replied yet")))))) + + (concat + (mapconcat #'format-header headers "\n") + "\n\n" + description))))) (defmacro gnus-icalendar-with-decoded-handle (handle &rest body) "Execute BODY in buffer containing the decoded contents of HANDLE." @@ -793,11 +814,13 @@ These will be used to retrieve the RSVP information from ical events." (current-buffer) status (gnus-icalendar-identities))))) (when reply - (gmm-labels ((fold-icalendar-buffer () - (goto-char (point-min)) - (while (re-search-forward "^\\(.\\{72\\}\\)\\(.+\\)$" nil t) - (replace-match "\\1\n \\2") - (goto-char (line-beginning-position))))) + (cl-labels + ((fold-icalendar-buffer + () + (goto-char (point-min)) + (while (re-search-forward "^\\(.\\{72\\}\\)\\(.+\\)$" nil t) + (replace-match "\\1\n \\2") + (goto-char (line-beginning-position))))) (let ((subject (concat (capitalize (symbol-name status)) ": " (gnus-icalendar-event:summary event)))) @@ -867,13 +890,15 @@ These will be used to retrieve the RSVP information from ical events." (setq gnus-icalendar-reply-status nil) (when event - (gmm-labels ((insert-button-group (buttons) - (when buttons - (mapc (lambda (x) - (apply 'gnus-icalendar-insert-button x) - (insert " ")) - buttons) - (insert "\n\n")))) + (cl-labels + ((insert-button-group + (buttons) + (when buttons + (mapc (lambda (x) + (apply 'gnus-icalendar-insert-button x) + (insert " ")) + buttons) + (insert "\n\n")))) (insert-button-group (gnus-icalendar-event:inline-reply-buttons event handle)) diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index 1a12a0f..22ff7b9 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -1727,7 +1727,7 @@ score in `gnus-newsgroup-scored' by SCORE." nil) (defun gnus-score-decode-text-parts () - (gmm-labels + (cl-labels ((mm-text-parts (handle) (cond ((stringp (car handle)) @@ -1751,7 +1751,7 @@ score in `gnus-newsgroup-scored' by SCORE." (mm-display-inline handle) (goto-char (point-max)))))) - (let (;(mm-text-html-renderer 'w3m-standalone) + (let ( ;(mm-text-html-renderer 'w3m-standalone) (handles (mm-dissect-buffer t))) (save-excursion (article-goto-body) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 284f094..6ca0de3 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1748,12 +1748,11 @@ Sizes are in pixels." image))) image))) -(eval-when-compile (require 'gmm-utils)) (defun gnus-recursive-directory-files (dir) "Return all regular files below DIR. The first found will be returned if a file has hard or symbolic links." (let (files attr attrs) - (gmm-labels + (cl-labels ((fn (directory) (dolist (file (directory-files directory t)) (setq attr (file-attributes (file-truename file))) commit d919f56c242980cc0ba667c8e60c188462409bc6 Author: Lars Ingebrigtsen Date: Sat Feb 13 16:29:13 2016 +1100 Remove compat code from canlock.el * lisp/gnus/canlock.el (defmacro): Remove diff --git a/lisp/gnus/canlock.el b/lisp/gnus/canlock.el index b73d863..27b00da 100644 --- a/lisp/gnus/canlock.el +++ b/lisp/gnus/canlock.el @@ -70,13 +70,6 @@ buffer does not look like a news message." :type 'boolean :group 'canlock) -(eval-when-compile - (defmacro canlock-string-as-unibyte (string) - "Return a unibyte string with the same individual bytes as STRING." - (if (fboundp 'string-as-unibyte) - (list 'string-as-unibyte string) - string))) - (defun canlock-sha1 (message) "Make a SHA-1 digest of MESSAGE as a unibyte string of length 20 bytes." (let (sha1-maximum-internal-length) @@ -97,7 +90,7 @@ buffer does not look like a news message." (canlock-sha1 (concat opad (canlock-sha1 - (concat ipad (canlock-string-as-unibyte message-id)))))))) + (concat ipad (string-as-unibyte message-id)))))))) (defun canlock-narrow-to-header () "Narrow the buffer to the head of the message." commit 97d76d9b6c9b189c6a69afc191dd7b6a35332ce1 Author: Lars Ingebrigtsen Date: Sat Feb 13 16:28:26 2016 +1100 Remove compat code from auth-source * lisp/gnus/auth-source.el (auth-source-read-char-choice): Remove compat code. diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index 32b39b9..b9341f5 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -372,11 +372,7 @@ with \"[a/b/c] \" if CHOICES is \(?a ?b ?c)." k) (while (not (memq k choices)) - (setq k (cond - ((fboundp 'read-char-choice) - (read-char-choice full-prompt choices)) - (t (message "%s" full-prompt) - (setq k (read-char)))))) + (setq k (read-char-choice full-prompt choices))) k))) ;; (auth-source-pick nil :host "any" :port 'imap :user "joe") commit 8a18bb111a0253ed0d4a92a1e16d859aad27c33e Author: Lars Ingebrigtsen Date: Sat Feb 13 16:20:34 2016 +1100 Fix gnus-group.el compilation warnings about unprefixed variables * lisp/gnus/gnus-group.el (gnus-group-update-eval-form): Avoid compilation warnings by passing in the dynamic variables as explicit lexical parameters to `eval'. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 3b37f3c..2a39b88 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1612,48 +1612,32 @@ if it is a string, only list groups matching REGEXP." (defun gnus-group-update-eval-form (group list) "Eval `car' of each element of LIST, and return the first that return t. Some value are bound so the form can use them." - (defvar group-age) (defvar ticked) (defvar score) (defvar level) - (defvar mailp) (defvar total) (defvar unread) (when list (let* ((entry (gnus-group-entry group)) - (unread (if (numberp (car entry)) (car entry) 0)) (active (gnus-active group)) - (total (if active (1+ (- (cdr active) (car active))) 0)) (info (nth 2 entry)) - (method (inline (gnus-server-get-method group (gnus-info-method info)))) + (method (inline (gnus-server-get-method + group (gnus-info-method info)))) (marked (gnus-info-marks info)) - (mailp (apply 'append - (mapcar - (lambda (x) - (memq x (assoc (symbol-name - (car (or method gnus-select-method))) - gnus-valid-select-methods))) - '(mail post-mail)))) - (level (or (gnus-info-level info) gnus-level-killed)) - (score (or (gnus-info-score info) 0)) - (ticked (gnus-range-length (cdr (assq 'tick marked)))) - (group-age (gnus-group-timestamp-delta group))) - ;; FIXME: http://thread.gmane.org/gmane.emacs.gnus.general/65451/focus=65465 - ;; ====================================================================== - ;; From: Richard Stallman - ;; Subject: Re: Rewriting gnus-group-highlight-line (was: [...]) - ;; Cc: ding@gnus.org - ;; Date: Sat, 27 Oct 2007 19:41:20 -0400 - ;; Message-ID: - ;; - ;; [...] - ;; The kludge is that the alist elements contain expressions that refer - ;; to local variables with short names. Perhaps write your own tiny - ;; evaluator that handles just `and', `or', and numeric comparisons - ;; and just a few specific variables. - ;; ====================================================================== - ;; - ;; Similar for other evaluated variables. Grep for risky-local-variable - ;; to find them! -- rsteib - ;; - ;; Eval the cars of the lists until we find a match. + (env + (list + (cons 'unread (if (numberp (car entry)) (car entry) 0)) + (cons 'total (if active (1+ (- (cdr active) (car active))) 0)) + (cons 'mailp (apply + 'append + (mapcar + (lambda (x) + (memq x (assoc + (symbol-name + (car (or method gnus-select-method))) + gnus-valid-select-methods))) + '(mail post-mail)))) + (cons 'level (or (gnus-info-level info) gnus-level-killed)) + (cons 'score (or (gnus-info-score info) 0)) + (cons 'ticked (gnus-range-length (cdr (assq 'tick marked)))) + (cons 'group-age (gnus-group-timestamp-delta group))))) (while (and list - (not (eval (caar list)))) + (not (eval (caar list) env))) (setq list (cdr list))) list))) commit b806a0556b3c3cef8254492de2ccb7d2d9d1618d Author: Lars Ingebrigtsen Date: Sat Feb 13 16:05:32 2016 +1100 Fix the :tracker slot name * lisp/gnus/registry.el (registry-lookup-secondary): The `tracker' slot is called `tracker', not `:tracker'. diff --git a/lisp/gnus/registry.el b/lisp/gnus/registry.el index 6684c25..e8bc6f5 100644 --- a/lisp/gnus/registry.el +++ b/lisp/gnus/registry.el @@ -179,7 +179,7 @@ Returns an alist of the key followed by the entry in a list, not a cons cell." &optional create) "Search for TRACKSYM in the registry-db THIS. When CREATE is not nil, create the secondary index hashtable if needed." - (let ((h (gethash tracksym (oref db :tracker)))) + (let ((h (gethash tracksym (oref db tracker)))) (if h h (when create commit f6d71b509722f07db92d0b2cdfce2d6b71b098cf Author: Lars Ingebrigtsen Date: Sat Feb 13 15:58:24 2016 +1100 Fix compilation warnings in gnus-art.el * lisp/gnus/gnus-art.el (rfc1843-decode-region): Autoload. (gnus-article-hide): Avoid compilation warnings. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 920544d..0ac475d 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2671,13 +2671,11 @@ If READ-CHARSET, ask for a coding system." (point-min) (point-max) (mm-charset-to-coding-system charset nil t))))))) -(eval-when-compile - (require 'rfc1843)) +(autoload 'rfc1843-decode-region "rfc1843") (defun article-decode-HZ () "Translate a HZ-encoded article." (interactive) - (require 'rfc1843) (save-excursion (let ((inhibit-read-only t)) (rfc1843-decode-region (point-min) (point-max))))) @@ -6303,7 +6301,7 @@ Provided for backwards compatibility." (not (with-current-buffer gnus-summary-buffer gnus-have-all-headers))) (not gnus-inhibit-hiding)) - (gnus-article-hide-headers))) + (article-hide-headers))) (declare-function shr-put-image "shr" (data alt &optional flags)) @@ -6971,10 +6969,11 @@ This means that signatures, cited text and (some) headers will be hidden. If given a prefix, show the hidden text instead." (interactive (append (gnus-article-hidden-arg) (list 'force))) - (gnus-article-hide-headers arg) - (gnus-article-hide-list-identifiers arg) - (gnus-article-hide-citation-maybe arg force) - (gnus-article-hide-signature arg)) + (gnus-with-article-buffer + (article-hide-headers arg) + (article-hide-list-identifiers) + (gnus-article-hide-citation-maybe arg force) + (article-hide-signature arg))) (defun gnus-check-group-server () ;; Make sure the connection to the server is alive. @@ -7278,7 +7277,8 @@ groups." (when (and (not force) (gnus-group-read-only-p)) (error "The current newsgroup does not support article editing")) - (gnus-article-date-original) + (gnus-with-article-buffer + (article-date-original)) (gnus-article-edit-article 'ignore `(lambda (no-highlight) commit bd1f4a493c9bdad18b8ee323817c0cc0c4994689 Author: Lars Ingebrigtsen Date: Sat Feb 13 15:20:16 2016 +1100 Fix compilation warning in gnus-score.el * lisp/gnus/gnus-score.el (gnus-art): Require to silence byte compiler. diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index 82a8049..1a12a0f 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -29,6 +29,7 @@ (require 'gnus) (require 'gnus-sum) +(require 'gnus-art) (require 'gnus-range) (require 'gnus-win) (require 'message) commit 5a327bd99c1a9e52059b0216904ba30da210d711 Author: Andreas Schwab Date: Sun Feb 7 13:29:16 2016 +0100 Revert "Fix gnus-group-get-new-news-this-group on group with closed server" This reverts commit 9dc77e37aa84c6df9b3ddb4609f3c09201b0580e. This makes nnimap groups not be activated. diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 8921a9c..c6f54da 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1829,9 +1829,7 @@ Return the server's response to the SELECT or EXAMINE command." (let ((open-result t)) (when (and server (not (nnimap-server-opened server))) - (let ((method (gnus-server-to-method server))) - (setq open-result (nnimap-open-server (nth 1 method) (nthcdr 2 method) - no-reconnect)))) + (setq open-result (nnimap-open-server server nil no-reconnect))) (cond ((not open-result) nil) commit 46ef01fc88964d7283b923354f4ba814d98e80a0 Author: Lars Ingebrigtsen Date: Sat Feb 13 14:31:53 2016 +1100 Fix encoding problem introduced by previous patch series * lisp/gnus/rfc2047.el: Ditto (bug#22648). * lisp/gnus/rfc2231.el: Fix problem created by the mm-replace-in-string conversion. diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el index e23fb1a..b441750 100644 --- a/lisp/gnus/mml-sec.el +++ b/lisp/gnus/mml-sec.el @@ -949,8 +949,8 @@ If no one is selected, symmetric encryption will be performed. " (if (eq 'OpenPGP protocol) (epg-sign-string context (buffer-string) mode) (epg-sign-string context - (replace-regexp-in-string (buffer-string) - "\n" "\r\n") + (replace-regexp-in-string + "\n" "\r\n" (buffer-string)) t)) mml-secure-secret-key-id-list nil) (error diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el index e7ee6e7..f7cf71a 100644 --- a/lisp/gnus/mml-smime.el +++ b/lisp/gnus/mml-smime.el @@ -424,7 +424,7 @@ Content-Disposition: attachment; filename=smime.p7m (mm-set-handle-multipart-parameter mm-security-handle 'gnus-info "Corrupted") (throw 'error handle)) - (setq part (replace-regexp-in-string part "\n" "\r\n") + (setq part (replace-regexp-in-string "\n" "\r\n" part) context (epg-make-context 'CMS)) (condition-case error (setq plain (epg-verify-string context (mm-get-part signature) part)) diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index ca9b377..309f1a7 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el @@ -926,7 +926,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (mm-set-handle-multipart-parameter mm-security-handle 'gnus-info "Corrupted") (throw 'error handle)) - (setq part (replace-regexp-in-string part "\n" "\r\n") + (setq part (replace-regexp-in-string "\n" "\r\n" part) signature (mm-get-part signature) context (epg-make-context)) (condition-case error diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el index 2862bb3..b05dfc1 100644 --- a/lisp/gnus/rfc2047.el +++ b/lisp/gnus/rfc2047.el @@ -554,7 +554,7 @@ Dynamically bind `rfc2047-encoding-type' to change that." (if (or debug-on-quit debug-on-error) (signal (car err) (cdr err)) (error "Invalid data for rfc2047 encoding: %s" - (replace-regexp-in-string orig-text "[ \t\n]+" " ")))))))) + (replace-regexp-in-string "[ \t\n]+" " " orig-text)))))))) (unless dont-fold (rfc2047-fold-region b (point))) (goto-char (point-max)))) @@ -699,8 +699,8 @@ Point moves to the end of the region." (setq eword (rfc2047-encode-1 (- b (point-at-bol)) (replace-regexp-in-string - (buffer-substring-no-properties b e) - "\n\\([ \t]?\\)" "\\1") + "\n\\([ \t]?\\)" "\\1" + (buffer-substring-no-properties b e)) cs (or (cdr (assq encoding rfc2047-encode-function-alist)) diff --git a/lisp/gnus/rfc2231.el b/lisp/gnus/rfc2231.el index f5f0c81..128779a 100644 --- a/lisp/gnus/rfc2231.el +++ b/lisp/gnus/rfc2231.el @@ -63,13 +63,13 @@ must never cause a Lisp error." (let (mod) (when (and (string-match "\\\\\"" string) (not (string-match "\\`\"\\|[^\\]\"" string))) - (setq string (replace-regexp-in-string string "\\\\\"" "\"") + (setq string (replace-regexp-in-string "\\\\\"" "\"" string) mod t)) (when (and (string-match "\\\\(" string) (string-match "\\\\)" string) (not (string-match "\\`(\\|[^\\][()]" string))) - (setq string (replace-regexp-in-string string - "\\\\\\([()]\\)" "\\1") + (setq string (replace-regexp-in-string + "\\\\\\([()]\\)" "\\1" string) mod t)) (or (and mod (ignore-errors commit 1279f93176495759bfecf4070d0e3593e30baa50 Author: Lars Ingebrigtsen Date: Sat Feb 13 14:00:06 2016 +1100 Revert "Avoid defvarring prefix-less variables" This reverts commit 303390bda34f98b400798d5383cf0d722e35ba19. The defvars are needed if we're doing lexical-binding diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index b702e2f..3b37f3c 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1612,6 +1612,8 @@ if it is a string, only list groups matching REGEXP." (defun gnus-group-update-eval-form (group list) "Eval `car' of each element of LIST, and return the first that return t. Some value are bound so the form can use them." + (defvar group-age) (defvar ticked) (defvar score) (defvar level) + (defvar mailp) (defvar total) (defvar unread) (when list (let* ((entry (gnus-group-entry group)) (unread (if (numberp (car entry)) (car entry) 0)) @@ -1631,6 +1633,25 @@ Some value are bound so the form can use them." (score (or (gnus-info-score info) 0)) (ticked (gnus-range-length (cdr (assq 'tick marked)))) (group-age (gnus-group-timestamp-delta group))) + ;; FIXME: http://thread.gmane.org/gmane.emacs.gnus.general/65451/focus=65465 + ;; ====================================================================== + ;; From: Richard Stallman + ;; Subject: Re: Rewriting gnus-group-highlight-line (was: [...]) + ;; Cc: ding@gnus.org + ;; Date: Sat, 27 Oct 2007 19:41:20 -0400 + ;; Message-ID: + ;; + ;; [...] + ;; The kludge is that the alist elements contain expressions that refer + ;; to local variables with short names. Perhaps write your own tiny + ;; evaluator that handles just `and', `or', and numeric comparisons + ;; and just a few specific variables. + ;; ====================================================================== + ;; + ;; Similar for other evaluated variables. Grep for risky-local-variable + ;; to find them! -- rsteib + ;; + ;; Eval the cars of the lists until we find a match. (while (and list (not (eval (caar list)))) (setq list (cdr list))) @@ -1641,8 +1662,8 @@ Some value are bound so the form can use them." GROUP is current group, and the line to highlight starts at BEG and ends at END." (let ((face (cdar (gnus-group-update-eval-form - group - gnus-group-highlight)))) + group + gnus-group-highlight)))) (unless (eq face (gnus-get-text-property-excluding-characters-with-faces beg 'face)) (let ((inhibit-read-only t)) (gnus-put-text-property-excluding-characters-with-faces commit c68b6c05d56a0eb0af9f52e4017464a7243a2619 Author: Glenn Morris Date: Fri Feb 12 21:18:13 2016 -0500 * test/lisp/url/url-auth-tests.el (url-auth-test-digest-auth): Make it pass. diff --git a/test/lisp/url/url-auth-tests.el b/test/lisp/url/url-auth-tests.el index 0f221b2..bc30f35 100644 --- a/test/lisp/url/url-auth-tests.el +++ b/test/lisp/url/url-auth-tests.el @@ -223,8 +223,10 @@ test and cannot be passed by arguments to `url-digest-auth'." (progn ;; We don't know these, just check that they exists. (should (string-match-p ".*response=\".*?\".*" auth)) - (should (string-match-p ".*nc=\".*?\".*" auth)) - (should (string-match-p ".*cnonce=\".*?\".*" auth))) + ;; url-digest-auth doesn't return these AFAICS. +;;; (should (string-match-p ".*nc=\".*?\".*" auth)) +;;; (should (string-match-p ".*cnonce=\".*?\".*" auth)) + ) (should (string-match ".*response=\"\\(.*?\\)\".*" auth)) (should (string= (match-string 1 auth) (plist-get challenge :expected-response)))) commit cd90b902b117508ce7b47bf6bb10e0d627d45d40 Author: Glenn Morris Date: Fri Feb 12 18:19:45 2016 -0500 ; * test/lisp/url/url-auth-tests.el: More whitespace. diff --git a/test/lisp/url/url-auth-tests.el b/test/lisp/url/url-auth-tests.el index 1fafaa1..0f221b2 100644 --- a/test/lisp/url/url-auth-tests.el +++ b/test/lisp/url/url-auth-tests.el @@ -202,11 +202,12 @@ test and cannot be passed by arguments to `url-digest-auth'." (list "example.org:80" (cons (or (plist-get challenge :realm) "/") (cons (plist-get challenge :username) - (url-digest-auth-create-key (plist-get challenge :username) - (plist-get challenge :password) - (plist-get challenge :realm) - (plist-get challenge :method) - (plist-get challenge :uri))))))) + (url-digest-auth-create-key + (plist-get challenge :username) + (plist-get challenge :password) + (plist-get challenge :realm) + (plist-get challenge :method) + (plist-get challenge :uri))))))) (setq auth (url-digest-auth (url-generic-parse-url url) nil nil (plist-get challenge :realm) attrs)) (should auth) @@ -227,7 +228,7 @@ test and cannot be passed by arguments to `url-digest-auth'." (should (string-match ".*response=\"\\(.*?\\)\".*" auth)) (should (string= (match-string 1 auth) (plist-get challenge :expected-response)))) - ))) + ))) (ert-deftest url-auth-test-digest-auth-opaque () "Check that `opaque' value is added to result when presented by commit 2439753301018456203d71f96c0be65d910028f3 Author: Glenn Morris Date: Fri Feb 12 18:16:58 2016 -0500 ; * test/lisp/url/url-auth-tests.el: Whitespace. diff --git a/test/lisp/url/url-auth-tests.el b/test/lisp/url/url-auth-tests.el index 1735ad0..1fafaa1 100644 --- a/test/lisp/url/url-auth-tests.el +++ b/test/lisp/url/url-auth-tests.el @@ -115,10 +115,12 @@ Essential is how realms and paths are matched." ;; authentication information shouldn't be found. ;; non-existent server - (list :url "http://other.com/path" :realm nil :expected-user nil) + (list :url "http://other.com/path" + :realm nil :expected-user nil) ;; unmatched port - (list :url "http://example.org:444/path" :realm nil :expected-user nil) + (list :url "http://example.org:444/path" + :realm nil :expected-user nil) ;; root, no realm (list :url "http://example.org/" commit 3991bf0ae0e896fbd695c045431b8cb02b757518 Author: Glenn Morris Date: Fri Feb 12 18:15:10 2016 -0500 * test/lisp/url/url-auth-tests.el (url-auth-test-digest-auth-retrieve-cache): Fix obvious typo. ; How do people add tests without, y'know, testing them? diff --git a/test/lisp/url/url-auth-tests.el b/test/lisp/url/url-auth-tests.el index e767b05..1735ad0 100644 --- a/test/lisp/url/url-auth-tests.el +++ b/test/lisp/url/url-auth-tests.el @@ -118,8 +118,7 @@ Essential is how realms and paths are matched." (list :url "http://other.com/path" :realm nil :expected-user nil) ;; unmatched port - (list :url "http://example.org:444/path" :realm nil :expected-user -il) + (list :url "http://example.org:444/path" :realm nil :expected-user nil) ;; root, no realm (list :url "http://example.org/"