From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: bug-reference and revisions Date: Fri, 28 Dec 2012 00:45:30 +0200 Organization: JURTA Message-ID: <87han7cdl6.fsf_-_@mail.jurta.org> References: <87ip7nqroz.fsf@yandex.ru> <87y5gjgu8e.fsf@mail.jurta.org> <87k3s3rwhc.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1356648981 7609 80.91.229.3 (27 Dec 2012 22:56:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Dec 2012 22:56:21 +0000 (UTC) Cc: Sam Steingold , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 27 23:56:37 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ToMNQ-0002nf-OL for ged-emacs-devel@m.gmane.org; Thu, 27 Dec 2012 23:56:36 +0100 Original-Received: from localhost ([::1]:45111 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ToMNC-0008Pu-CJ for ged-emacs-devel@m.gmane.org; Thu, 27 Dec 2012 17:56:22 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ToMNA-0008Oy-EY for emacs-devel@gnu.org; Thu, 27 Dec 2012 17:56:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ToMN9-0002kg-8H for emacs-devel@gnu.org; Thu, 27 Dec 2012 17:56:20 -0500 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:57680 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ToMN9-0002kR-2r; Thu, 27 Dec 2012 17:56:19 -0500 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 88BE9451C308; Thu, 27 Dec 2012 14:56:16 -0800 (PST) In-Reply-To: <87k3s3rwhc.fsf@yandex.ru> (Dmitry Gutov's message of "Thu, 27 Dec 2012 20:55:27 -0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 69.163.218.105 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:155949 Archived-At: >>>> - 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.