summaryrefslogtreecommitdiff
path: root/lisp/mail
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2017-01-04 00:40:45 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2017-01-04 00:40:45 -0500
commit2ec41c415f39990561cc9da4c9bad0b69bfad489 (patch)
tree01a5234df9caa1e9db39d76bf31ba8a3a622298c /lisp/mail
parentf49f8c1454e19123572a071bf582271c70d28f01 (diff)
downloademacs-2ec41c415f39990561cc9da4c9bad0b69bfad489.tar.gz
Avoid add-to-list on local variables
* lisp/gnus/nnir.el: Use lexical-binding and cl-lib. (nnir-retrieve-headers): Use pcase. (nnir-search-thread): Avoid add-to-list on local variables. * lisp/gnus/smime.el: Use lexical-binding and cl-lib. (smime-verify-region): Avoid add-to-list on local variables. * lisp/mail/undigest.el: Use lexical-binding and cl-lib. (rmail-digest-parse-mime, rmail-digest-rfc1153) (rmail-digest-parse-rfc934): Avoid add-to-list on local variable. * lisp/net/ldap.el (ldap-search): Move init into declaration. * lisp/net/newst-backend.el (newsticker--cache-add): Avoid add-to-list on local variables; Simplify code with `assq'. * lisp/net/zeroconf.el: Use lexical-binding and cl-lib. (dbus-debug): Remove declaration, unused. (zeroconf-service-add-hook, zeroconf-service-remove-hook) (zeroconf-service-browser-handler, zeroconf-publish-service): Avoid add-to-list and *-hook on local variables. * lisp/org/org-archive.el (org-all-archive-files): * lisp/org/org-agenda.el (org-agenda-get-restriction-and-command): Avoid add-to-list on local variables. * lisp/org/ox-publish.el (org-publish--run-functions): New function. (org-publish-projects): Use it to avoid run-hooks on a local variable. (org-publish-cache-file-needs-publishing): Avoid add-to-list on local variables. * lisp/progmodes/ada-prj.el: Use setq instead of (set '...). (ada-prj-load-from-file): Avoid add-to-list on local variables. * lisp/progmodes/ada-xref.el (ada-initialize-runtime-library): Simplify. (ada-gnat-parse-gpr, ada-parse-prj-file-1) (ada-xref-find-in-modified-ali): Avoid add-to-list on local variables. * lisp/progmodes/idlw-shell.el (idlwave-shell-update-bp-overlays): Avoid add-to-list on local variables.
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/undigest.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/mail/undigest.el b/lisp/mail/undigest.el
index c9200745e06..73d7464bc13 100644
--- a/lisp/mail/undigest.el
+++ b/lisp/mail/undigest.el
@@ -1,4 +1,4 @@
-;;; undigest.el --- digest-cracking support for the RMAIL mail reader
+;;; undigest.el --- digest-cracking support for the RMAIL mail reader -*- lexical-binding:t -*-
;; Copyright (C) 1985-1986, 1994, 1996, 2001-2017 Free Software
;; Foundation, Inc.
@@ -28,6 +28,7 @@
;;; Code:
+(eval-when-compile (require 'cl-lib))
(require 'rmail)
(defcustom rmail-forward-separator-regex
@@ -59,7 +60,8 @@ each undigestified message as markers.")
(re-search-forward
(concat
"^Content-type: multipart/digest;"
- "\\s-* boundary=\"?\\([^\";\n]+\\)[\";\n]") head-end t)
+ "\\s-* boundary=\"?\\([^\";\n]+\\)[\";\n]")
+ head-end t)
(search-forward (match-string 1) nil t)))
;; Ok, prolog separator found
(let ((start (make-marker))
@@ -69,7 +71,8 @@ each undigestified message as markers.")
(while (search-forward separator nil t)
(move-marker start (match-beginning 0))
(move-marker end (match-end 0))
- (add-to-list 'result (cons (copy-marker start) (copy-marker end t))))
+ (cl-pushnew (cons (copy-marker start) (copy-marker end t))
+ result :test #'equal))
;; Return the list of marker pairs
(nreverse result))))
@@ -117,8 +120,8 @@ See rmail-digest-methods."
(while (search-forward separator nil t)
(move-marker start (match-beginning 0))
(move-marker end (match-end 0))
- (add-to-list 'result
- (cons (copy-marker start) (copy-marker end t))))
+ (cl-pushnew (cons (copy-marker start) (copy-marker end t))
+ result :test #'equal))
;; Undo masking of separators inside digestified messages
(goto-char (point-min))
(while (search-forward
@@ -139,7 +142,8 @@ See rmail-digest-methods."
(while (search-forward separator nil t)
(move-marker start (match-beginning 0))
(move-marker end (match-end 0))
- (add-to-list 'result (cons (copy-marker start) (copy-marker end t))))
+ (cl-pushnew (cons (copy-marker start) (copy-marker end t))
+ result :test #'equal))
;; Undo masking of separators inside digestified messages
(goto-char (point-min))
(while (search-forward "\n- -" nil t)