branch: externals/debbugs
commit 2efa3a7b7b83dfd25a79032bf20f2fcbda42f4d3
Author: Robert Pluim <[email protected]>
Commit: Robert Pluim <[email protected]>
Improve bug id guessing for multi-bug mailboxes
* debbugs-gnu.el (debbugs-gnu-guess-current-id): Search backwards
rather than from point-min for bug id.
---
debbugs-gnu.el | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/debbugs-gnu.el b/debbugs-gnu.el
index 3dbd2f2..5789d80 100644
--- a/debbugs-gnu.el
+++ b/debbugs-gnu.el
@@ -1576,14 +1576,13 @@ MERGED is the list of bugs merged with this one."
(setq subject ,debbugs-gnu-subject))))))))
(defun debbugs-gnu-guess-current-id ()
- "Guess the ID based on \"#23\"."
+ "Guess the ID based on \"#23\".
+Looks at current line and then backwards from point."
(save-excursion
(beginning-of-line)
(and
(or (re-search-forward "#\\([0-9]+\\)" (line-end-position) t)
- (progn
- (goto-char (point-min))
- (re-search-forward "#\\([0-9]+\\)" nil t)))
+ (re-search-backward "#\\([0-9]+\\)" nil t))
(string-to-number (match-string 1)))))
(defun debbugs-gnu-proper-bug-number (id)