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

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

[elpa] externals/debbugs b5a6432 019/311: (debbugs-toggle-sort): Allow s


From: Stefan Monnier
Subject: [elpa] externals/debbugs b5a6432 019/311: (debbugs-toggle-sort): Allow sorting from the final line.
Date: Sun, 29 Nov 2020 18:41:32 -0500 (EST)

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

    (debbugs-toggle-sort): Allow sorting from the final line.
---
 ChangeLog      | 1 +
 debbugs-gnu.el | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 81678d4..d90daad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
        entry, so that we don't have to rely on subject header mangling,
        which is fragile.
        (debbugs-emacs): Display multiple merges prettier.
+       (debbugs-toggle-sort): Allow sorting from the final line.
 
 2011-07-02  Michael Albinus  <michael.albinus@gmx.de>
 
diff --git a/debbugs-gnu.el b/debbugs-gnu.el
index 4de2c80..b18efce 100644
--- a/debbugs-gnu.el
+++ b/debbugs-gnu.el
@@ -244,7 +244,8 @@ The following commands are available:
   (interactive)
   (beginning-of-line)
   (let ((buffer-read-only nil)
-       (current-bug (buffer-substring (point) (+ (point) 5))))
+       (current-bug (and (not (eobp))
+                         (buffer-substring (point) (+ (point) 5)))))
     (goto-char (point-min))
     (setq debbugs-sort-state
          (if (eq debbugs-sort-state 'number)
@@ -258,8 +259,10 @@ The following commands are available:
         (or (cdr (assq (get-text-property (+ (point) 7) 'face)
                        debbugs-state-preference))
             10))))
-    (goto-char (point-min))
-    (re-search-forward (concat "^" current-bug) nil t)))
+    (if (not current-bug)
+       (goto-char (point-max))
+      (goto-char (point-min))
+      (re-search-forward (concat "^" current-bug) nil t))))
 
 (defvar debbugs-bug-number nil)
 



reply via email to

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