]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/debbugs/debbugs-gnu.el
Make the `t' "tag" command persist over reordering
[gnu-emacs-elpa] / packages / debbugs / debbugs-gnu.el
index f5d6ae8af8784b9b44000869182c01c0243e62f7..03a83238286867d6714cb732c608cc7468e669ac 100644 (file)
@@ -1,12 +1,12 @@
 ;;; debbugs-gnu.el --- interface for the GNU bug tracker
 
-;; Copyright (C) 2011-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2014 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;         Michael Albinus <michael.albinus@gmx.org>
 ;; Keywords: comm, hypermedia, maint
 ;; Package: debbugs
-;; Version: 0.5
+;; Version: 0.6
 
 ;; This file is not part of GNU Emacs.
 
   ;; <http://debbugs.gnu.org/Packages.html>
   ;; <http://debbugs.gnu.org/cgi/pkgindex.cgi>
   :group 'debbugs-gnu
-  :type '(set (const "automake")
+  :type '(set (const "auctex")
+             (const "automake")
              (const "cc-mode")
              (const "coreutils")
+             (const "cppi")
              (const "debbugs.gnu.org")
              (const "diffutils")
              (const "emacs")
              (const "guile")
              (const "guix")
              (const "gzip")
+             (const "idutils")
              (const "libtool")
-             (const "ns")
+             (const "mh-e")
              (const "org-mode")
              (const "parted")
-             (const "w32")
+             (const "vc-dwim")
              (const "woodchuck"))
   :version "24.4")
 
@@ -425,7 +428,7 @@ marked as \"client-side filter\"."
 
 ;;;###autoload
 (defun debbugs-gnu (severities &optional packages archivedp suppress tags)
-  "List all outstanding Emacs bugs."
+  "List all outstanding bugs."
   (interactive
    (let (severities archivedp)
      (list
@@ -464,6 +467,9 @@ marked as \"client-side filter\"."
       (add-to-list 'debbugs-gnu-current-query (cons 'package package))))
   (when archivedp
     (add-to-list 'debbugs-gnu-current-query '(archive . "1")))
+  (when suppress
+    (add-to-list 'debbugs-gnu-current-query '(status . "open"))
+    (add-to-list 'debbugs-gnu-current-query '(status . "forwarded")))
   (dolist (tag (if (consp tags) tags (list tags)))
     (when (not (zerop (length tag)))
       (add-to-list 'debbugs-gnu-current-query (cons 'tag tag))))
@@ -950,7 +956,9 @@ Subject fields."
     (forward-line 1)))
 
 (defun debbugs-gnu-toggle-tag ()
-  "Toggle tag of the report in the current line."
+  "Toggle the local tag of the report in the current line.
+If a report is tagged locally, it is presumed to be of little
+interest to you."
   (interactive)
   (save-excursion
     (beginning-of-line)
@@ -963,9 +971,22 @@ Subject fields."
        (add-to-list 'debbugs-gnu-local-tags id)
        (put-text-property
         (+ (point) (- 5 (length (number-to-string id)))) (+ (point) 5)
-        'face 'debbugs-gnu-tagged))))
+        'face 'debbugs-gnu-tagged)
+       (debbugs-gnu--update-tag-face id))))
   (debbugs-gnu-dump-persistency-file))
 
+(defun debbugs-gnu--update-tag-face (id)
+  (dolist (entry tabulated-list-entries)
+    (when (equal (cdr (assq 'id (car entry))) id)
+      (aset (cadr entry) 0
+           (propertize
+            (format "%5d" id)
+            'face
+            ;; Mark tagged bugs.
+            (if (memq id debbugs-gnu-local-tags)
+                'debbugs-gnu-tagged
+              'default))))))
+
 (defun debbugs-gnu-toggle-suppress ()
   "Suppress bugs marked in `debbugs-gnu-suppress-bugs'."
   (interactive)