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

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

[elpa] externals/debbugs 04f0926 230/311: Avoid double entries in debbug


From: Stefan Monnier
Subject: [elpa] externals/debbugs 04f0926 230/311: Avoid double entries in debbugs
Date: Sun, 29 Nov 2020 18:42:18 -0500 (EST)

branch: externals/debbugs
commit 04f09262906cfd3fe0aeb231cd96e904dac98799
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Avoid double entries in debbugs
    
    * packages/debbugs/debbugs-gnu.el (debbugs-gnu-show-reports):
    Avoid double entries.
---
 debbugs-gnu.el | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/debbugs-gnu.el b/debbugs-gnu.el
index 4abf3b7..f9383bc 100644
--- a/debbugs-gnu.el
+++ b/debbugs-gnu.el
@@ -706,12 +706,8 @@ are taken from the cache instead."
                            (sort ids '<))
                        (debbugs-gnu-get-bugs debbugs-gnu-local-query)))))
       (let* ((id (cdr (assq 'id status)))
-            (words
-             (mapconcat
-              'identity
-              (cons (cdr (assq 'severity status))
-                    (cdr (assq 'keywords status)))
-              ","))
+            (words (cons (cdr (assq 'severity status))
+                         (cdr (assq 'keywords status))))
             (address (if (cdr (assq 'originator status))
                          (mail-header-parse-address
                           (decode-coding-string (cdr (assq 'originator status))
@@ -725,19 +721,21 @@ are taken from the cache instead."
                                                'utf-8)))
             merged)
        (unless (equal (cdr (assq 'pending status)) "pending")
-         (setq words (concat words "," (cdr (assq 'pending status)))))
+         (setq words (append words (list (cdr (assq 'pending status))))))
        (let ((packages (cdr (assq 'package status))))
          (dolist (elt packages)
            (when (member elt debbugs-gnu-default-packages)
              (setq packages (delete elt packages))))
-         (when packages
-           (setq words (concat words "," (mapconcat 'identity packages ",")))))
+         (setq words (append words packages)))
        (when (setq merged (cdr (assq 'mergedwith status)))
-         (setq words (format "%s,%s"
-                             (if (numberp merged)
-                                 merged
-                               (mapconcat 'number-to-string merged ","))
-                             words)))
+         (setq words (cons (if (numberp merged)
+                               merged
+                             (mapconcat 'number-to-string merged ","))
+                           words)))
+       ;; `words' could contain the same word twice, for example
+       ;; "fixed" from keywords and pending.
+       (setq words
+             (mapconcat 'identity (delete-duplicates words :test 'equal) ","))
        (when (or (not merged)
                  (not (let ((found nil))
                         (dolist (id (if (listp merged)



reply via email to

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