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

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

[elpa] externals/debbugs f6146fe 088/311: Make sorting respect the curre


From: Stefan Monnier
Subject: [elpa] externals/debbugs f6146fe 088/311: Make sorting respect the current narrowing.
Date: Sun, 29 Nov 2020 18:41:46 -0500 (EST)

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

    Make sorting respect the current narrowing.
---
 debbugs-gnu.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/debbugs-gnu.el b/debbugs-gnu.el
index 265da20..363f4e9 100644
--- a/debbugs-gnu.el
+++ b/debbugs-gnu.el
@@ -656,6 +656,9 @@ Used instead of `tabulated-list-print-entry'."
        (title            (aref cols 3))
        (title-length     (nth 1 (aref tabulated-list-format 3))))
     (when (and
+          ;; We may have a narrowing in effect.
+          (or (not debbugs-gnu-current-limit)
+              (memq (cdr (assq 'id list-id)) debbugs-gnu-current-limit))
           ;; Filter suppressed bugs.
           (or (not (widget-get debbugs-gnu-current-widget :suppress))
               (not (catch :suppress
@@ -749,6 +752,7 @@ Used instead of `tabulated-list-print-entry'."
     (goto-char pos)))
 
 (defvar debbugs-gnu-sort-state 'number)
+(defvar debbugs-gnu-current-limit nil)
 
 (define-derived-mode debbugs-gnu-mode tabulated-list-mode "Debbugs"
   "Major mode for listing bug reports.
@@ -759,8 +763,8 @@ All normal editing commands are switched off.
 The following commands are available:
 
 \\{debbugs-gnu-mode-map}"
-  (set (make-local-variable 'debbugs-gnu-sort-state)
-       'number)
+  (set (make-local-variable 'debbugs-gnu-sort-state) 'number)
+  (set (make-local-variable 'debbugs-gnu-current-limit) nil)
   (setq tabulated-list-format [("Id"         5 debbugs-gnu-sort-id)
                               ("State"     20 debbugs-gnu-sort-state)
                               ("Submitter" 25 t)
@@ -850,6 +854,7 @@ The following commands are available:
        (buffer-read-only nil))
     (tabulated-list-init-header)
     (tabulated-list-print)
+    (setq debbugs-gnu-current-limit nil)
     (when id
       (debbugs-gnu-goto id))))
 
@@ -868,6 +873,7 @@ The following commands are available:
               (not (string-match string (cdr (assq 'originator status))))
               (not (string-match string (cdr (assq 'subject status)))))
          (delete-region (point) (progn (forward-line 1) (point)))
+       (push (cdr (assq 'id status)) debbugs-gnu-current-limit)
        (forward-line 1)))
     (when id
       (debbugs-gnu-goto id))))



reply via email to

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