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

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

[elpa] externals/debbugs 4cc71d5 086/311: Add commands to narrow/widen t


From: Stefan Monnier
Subject: [elpa] externals/debbugs 4cc71d5 086/311: Add commands to narrow/widen the bug reports.
Date: Sun, 29 Nov 2020 18:41:46 -0500 (EST)

branch: externals/debbugs
commit 4cc71d52ba230301285f94666bdf2db03ff78b28
Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
Commit: Lars Magne Ingebrigtsen <larsi@gnus.org>

    Add commands to narrow/widen the bug reports.
---
 debbugs-gnu.el | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/debbugs-gnu.el b/debbugs-gnu.el
index bfb3611..6a8d588 100644
--- a/debbugs-gnu.el
+++ b/debbugs-gnu.el
@@ -717,6 +717,8 @@ Used instead of `tabulated-list-print-entry'."
     (define-key map "d" 'debbugs-gnu-display-status)
     (define-key map "g" 'debbugs-gnu-rescan)
     (define-key map "x" 'debbugs-gnu-toggle-suppress)
+    (define-key map "/" 'debbugs-gnu-narrow-to-status)
+    (define-key map "w" 'debbugs-gnu-widen)
     (define-key map "C" 'debbugs-gnu-send-control-message)
     map))
 
@@ -841,6 +843,39 @@ The following commands are available:
   (tabulated-list-init-header)
   (tabulated-list-print))
 
+(defun debbugs-gnu-widen ()
+  "Display all the currently selected bug reports."
+  (interactive)
+  (let ((id (debbugs-gnu-current-id t)))
+    (tabulated-list-init-header)
+    (tabulated-list-print)
+    (when id
+      (debbugs-gnu-goto id))))
+
+(defun debbugs-gnu-narrow-to-status (string)
+  "Only display the bugs matching STRING."
+  (interactive "sNarrow to: ")
+  (let ((id (debbugs-gnu-current-id t))
+       status)
+    (debbugs-gnu-widen)
+    (goto-char (point-min))
+    (while (not (eobp))
+      (setq status (debbugs-gnu-current-status))
+      (if (and (not (member string (assq 'keywords status)))
+              (not (member string (assq 'severity status)))
+              (not (string-match string (cdr (assq 'originator status))))
+              (not (string-match string (cdr (assq 'subject status)))))
+         (delete-region (point) (progn (forward-line 1) (point)))
+       (forward-line 1)))
+    (when id
+      (debbugs-gnu-goto id))))
+
+(defun debbugs-gnu-goto (id)
+  "Go to the line displaying bug ID."
+  (goto-char (point-min))
+  (while (not (equal (debbugs-gnu-current-id t) id))
+    (forward-line 1)))
+
 (defun debbugs-gnu-toggle-tag ()
   "Toggle tag of the report in the current line."
   (interactive)



reply via email to

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