branch: master commit ebbbf8ae138a91bc588666a7bcca9f8bbef12697 Author: Robert Pluim <rpl...@gmail.com> Commit: Robert Pluim <rpl...@gmail.com>
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. --- packages/debbugs/debbugs-gnu.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/debbugs/debbugs-gnu.el b/packages/debbugs/debbugs-gnu.el index 3dbd2f2..5789d80 100644 --- a/packages/debbugs/debbugs-gnu.el +++ b/packages/debbugs/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)