emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 05/05: * packages/debbugs/debbugs-org.el: Miscellanous cleanups.


From: Stefan Monnier
Subject: [elpa] 05/05: * packages/debbugs/debbugs-org.el: Miscellanous cleanups. (debbugs-org-search): Remove unused var `date-format'. (debbugs-org-show-reports): Avoid add-to-list on local var. * packages/debbugs/debbugs.el (debbugs-get-usertag, debbugs-search-est): Avoid add-to-list on local var.
Date: Wed, 15 Oct 2014 19:35:27 +0000

monnier pushed a commit to branch master
in repository elpa.

commit 25c579d046f9cf38767c06253aa54802a6ca3c39
Author: Stefan Monnier <address@hidden>
Date:   Wed Oct 15 15:35:14 2014 -0400

    * packages/debbugs/debbugs-org.el: Miscellanous cleanups.
    (debbugs-org-search): Remove unused var `date-format'.
    (debbugs-org-show-reports): Avoid add-to-list on local var.
    * packages/debbugs/debbugs.el (debbugs-get-usertag, debbugs-search-est):
    Avoid add-to-list on local var.
---
 packages/debbugs/debbugs-org.el |   11 +++++------
 packages/debbugs/debbugs.el     |   20 ++++++++++++++------
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/packages/debbugs/debbugs-org.el b/packages/debbugs/debbugs-org.el
index dfe8684..8a98aec 100644
--- a/packages/debbugs/debbugs-org.el
+++ b/packages/debbugs/debbugs-org.el
@@ -148,11 +148,10 @@ returned."
   (interactive)
 
   (unwind-protect
-      (let ((date-format 
"\\([[:digit:]]\\{4\\}\\)-\\([[:digit:]]\\{1,2\\}\\)-\\([[:digit:]]\\{1,2\\}\\)")
-           key val1 val2 phrase severities packages archivedp)
+      ;; Check for the phrase.
+      (let ((phrase (read-string debbugs-gnu-phrase-prompt))
+            key val1 severities packages)
 
-       ;; Check for the phrase.
-       (setq phrase (read-string debbugs-gnu-phrase-prompt))
        (add-to-list 'debbugs-gnu-current-query (cons 'phrase phrase))
 
        ;; The other queries.
@@ -320,10 +319,10 @@ returned."
 
        ;; Handle tags.
        (when (string-match "^\\([0-9.]+\\); \\(.+\\)$" subject)
-         (add-to-list 'tags (match-string 1 subject))
+         (let ((x (match-string 1 subject))) (pushnew x tags :test #'equal))
          (setq subject (match-string 2 subject)))
        (when archived
-         (add-to-list 'tags "ARCHIVE"))
+          (pushnew "ARCHIVE" tags :test #'equal))
        (setq tags
              (mapcar
               ;; Replace all invalid TAG characters by "_".
diff --git a/packages/debbugs/debbugs.el b/packages/debbugs/debbugs.el
index 57c3ae0..725a394 100644
--- a/packages/debbugs/debbugs.el
+++ b/packages/debbugs/debbugs.el
@@ -372,12 +372,12 @@ Example:
                 (setq val user-mail-address))
               (when (string-match "<\\(.+\\)>" val)
                 (setq val (match-string 1 val)))
-              (add-to-list 'user val))
+              (pushnew val user :test #'equal))
           (error "Wrong %s: %s" key val)))
        ((:tag)
         ;; Value shall be one word.
         (if (string-match "\\`\\S-+\\'" val)
-            (add-to-list 'tags val)
+            (pushnew val tags :test #'equal)
           (error "Wrong %s: %s" key val)))
        (t (error "Unknown key: %s" kw))))
 
@@ -593,7 +593,9 @@ Examples:
                   (setcar elt user-mail-address))
                 (when (string-match "<\\(.+\\)>" (car elt))
                   (setcar elt (match-string 1 (car elt))))
-                (add-to-list 'val (pop elt) 'append))
+                 (let ((x (pop elt)))
+                   (unless (member x val)
+                     (setq val (append val (list x))))))
               (setq vec
                     (vconcat vec (list key (mapconcat 'identity val " "))))))
 
@@ -608,7 +610,9 @@ Examples:
               (while  (and (stringp (car elt))
                            (string-match
                             "\\`\\(done\\|forwarded\\|open\\)\\'" (car elt)))
-                (add-to-list 'val (pop elt) 'append))
+                (let ((x (pop elt)))
+                   (unless (member x val)
+                     (setq val (append val (list x))))))
               (setq vec
                     (vconcat vec (list key (mapconcat 'identity val " "))))))
 
@@ -621,7 +625,9 @@ Examples:
                 (setq vec (vconcat vec (list key "")))
               ;; Just a string.
               (while (stringp (car elt))
-                (add-to-list 'val (pop elt) 'append))
+                (let ((x (pop elt)))
+                   (unless (member x val)
+                     (setq val (append val (list x))))))
               (setq vec
                     (vconcat vec (list key (mapconcat 'identity val " "))))))
 
@@ -634,7 +640,9 @@ Examples:
                 (setq vec (vconcat vec (list key "")))
               ;; Just a number.
               (while (numberp (car elt))
-                (add-to-list 'val (pop elt) 'append))
+                 (let ((x (pop elt)))
+                   (unless (member x val)
+                     (setq val (append val (list x))))))
               (setq vec
                     (vconcat
                      vec (list key (mapconcat 'number-to-string val " "))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]