emacs-devel
[Top][All Lists]
Advanced

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

bug-reference and revisions


From: Juri Linkov
Subject: bug-reference and revisions
Date: Fri, 28 Dec 2012 00:45:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)

>>>> -  from 109911 (see the new test).
>>>> +  from Bug#109911 (see the new test).
>>>
>>> This change is inaccurate. 109911 is a Bazaar revision, not a bug number.
>>
>> To avoid ambiguity and misunderstanding revisions should have a prefix
>> similar to bug numbers, e.g. revno#109911 or revno:109911.
>
> Thanks, will do next time.
> I guess I'm used to Git, where you don't usually prefix commit ids with
> anything.

Support for links to revision numbers could be added to bug-reference.el
to fontify strings like "revno:109911" where clicking on them will open
http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/109911

This is possible with a small patch that adds these formats:

revno#109911
revno:109911
revision#109911
revision:109911

=== modified file 'lisp/progmodes/bug-reference.el'
--- lisp/progmodes/bug-reference.el     2012-10-06 20:30:27 +0000
+++ lisp/progmodes/bug-reference.el     2012-12-27 22:43:01 +0000
@@ -69,7 +69,7 @@ (put 'bug-reference-url-format 'safe-loc
                 (get s 'bug-reference-url-format)))))
 
 (defcustom bug-reference-bug-regexp
-  "\\([Bb]ug ?#\\|[Pp]atch ?#\\|RFE ?#\\|PR 
[a-z-+]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)"
+  "\\([Bb]ug ?#\\|[Pp]atch ?#\\|[Rr]ev\\(?:no\\|ision\\) ?[#:]\\|RFE ?#\\|PR 
[a-z-+]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)"
   "Regular expression matching bug references.
 The second subexpression should match the bug reference (usually a number)."
   :type 'string


Then evaluating this will open the link:
(setq bug-reference-url-format
      "http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/%s";)

but unfortunately it will override "http://debbugs.gnu.org/%s";.

To handle two URL types requires customizing `bug-reference-url-format'
to a function that would decide which URL format to use.



reply via email to

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