GNU bug report logs - #65883
[PATCH] .dir-locals.el: Update bug-reference configuration and document it.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Tue, 12 Sep 2023 03:45:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#65883: closed ([PATCH] .dir-locals.el: Update bug-reference
 configuration and document it.)
Date: Sun, 17 Sep 2023 20:46:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 17 Sep 2023 16:45:22 -0400
with message-id <87fs3c7cm5.fsf <at> gmail.com>
and subject line Re: [bug#65883] [PATCH] .dir-locals.el: Update bug-reference configuration and document it.
has caused the debbugs.gnu.org bug report #65883,
regarding [PATCH] .dir-locals.el: Update bug-reference configuration and document it.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
65883: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65883
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <at> gnu.org,
	maxim.cournoyer <at> gmail.com
Subject: [PATCH] .dir-locals.el: Update bug-reference configuration and
 document it.
Date: Mon, 11 Sep 2023 23:44:31 -0400
(nil) <bug-reference-url-format>: Update URL.  Add comment.
* doc/contributing.texi (The Perfect Setup): New "Viewing bugs within Emacs"
subsection.
---
 .dir-locals.el        |  6 ++++--
 doc/contributing.texi | 45 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/.dir-locals.el b/.dir-locals.el
index 36714c1aa4..c63262848c 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -5,10 +5,12 @@
      (tab-width   .  8)
      (sentence-end-double-space . t)
 
-     ;; For use with 'bug-reference-prog-mode'.
+     ;; For use with 'bug-reference-prog-mode'.  Extra bug-reference
+     ;; configuration should be done in your Emacs user configuration file;
+     ;; refer to (info (guix) The Perfect Setup).
      (bug-reference-bug-regexp
       . "\\(<https?://\\bugs\\.gnu\\.org/\\([0-9]+\\)>\\)")
-     (bug-reference-url-format . "https://bugs.gnu.org/%s")
+     (bug-reference-url-format . "https://issues.guix.gnu.org/%s")
 
      (eval . (add-to-list 'completion-ignored-extensions ".go"))
 
diff --git a/doc/contributing.texi b/doc/contributing.texi
index a0da871f1a..608da89a2c 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -379,6 +379,51 @@ The Perfect Setup
 save then add @code{(add-hook 'after-save-hook 'copyright-update)} in
 Emacs.
 
+@subsection Viewing Bugs within Emacs
+
+Emacs has a nice minor mode called @code{bug-reference}, which, when
+combined with @samp{emacs-debbugs} (the Emacs package), can be used to
+open links such as @samp{<https://bugs.gnu.org/58697>} or
+@samp{<https://issues.guix.gnu.org/58697>} as bug report buffers.  From
+there you can easily consult the email thread via the Gnus interface,
+reply or modify the bug status, all without leaving the comfort of
+Emacs!  Below is a sample configuration to add to your @file{~/.emacs}
+configuration file:
+
+@lisp
+;;; Bug references.
+(add-hook 'prog-mode-hook #'bug-reference-prog-mode)
+(add-hook 'gnus-mode-hook #'bug-reference-mode)
+(add-hook 'erc-mode-hook #'bug-reference-mode)
+(add-hook 'bug-reference-mode-hook 'debbugs-browse-mode)
+(add-hook 'bug-reference-prog-mode-hook 'debbugs-browse-mode)
+(add-hook 'gnus-summary-mode-hook 'bug-reference-mode)
+(add-hook 'gnus-article-mode-hook 'bug-reference-mode)
+
+;;; This extends the default expression (the first complicated blob) to also
+;;; match URLs such as <https://issues.guix.gnu.org/58697> or
+;;; <https://bugs.gnu.org/58697>.  It is also extended to detect "Fixes:
+;;; #NNNNN" git trailers.
+(setq bug-reference-bug-regexp
+      (concat
+       "\\("
+       "\\(?:\\b\\(?:[Bb]ug ?#?\\|[Pp]atch ?#\\|[Ff]ixes:? ?#\\|\
+RFE ?#\\|PR [a-z+-]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)\\)"
+       "\\|"
+       "\\(?:<https://bugs\\.gnu\\.org/\\(?2:[0-9]+\\)>\\)"
+       "\\)"))
+(setq bug-reference-url-format "https://bugs.gnu.org/%s")
+;; The following allows Emacs Debbugs user to open the issue directly within
+;; Emacs.
+(setq debbugs-browse-url-regexp
+      "^https?://\\(debbugs\\|\\(issues\\.guix\\|bugs\\)\\)\\.gnu\\.org/\
+\\(cgi/bugreport\\.cgi\\?bug=\\)?\\(?3:[[:digit:]]+\\)$")
+@end lisp
+
+For more information, refer to @ref{Bug Reference,,, emacs, The GNU
+Emacs Manual} and @ref{Minor Mode,,, debbugs-ug, The Debbugs User
+Guide}.
+
 @node Packaging Guidelines
 @section Packaging Guidelines
 

base-commit: 2a7f031ca9d6d16fe0264023d8beca02b3ac0050
-- 
2.41.0



[Message part 3 (message/rfc822, inline)]
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: brian <bjc <at> spork.org>
Cc: ludo <at> gnu.org, 65883-done <at> debbugs.gnu.org
Subject: Re: [bug#65883] [PATCH] .dir-locals.el: Update bug-reference
 configuration and document it.
Date: Sun, 17 Sep 2023 16:45:22 -0400
Hi,

brian <bjc <at> spork.org> writes:

> Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:
>
>> +(setq debbugs-browse-url-regexp
>> +      "^https?://\\(debbugs\\|\\(issues\\.guix\\|bugs\\)\\)\\.gnu\\.org/\
>> +\\(cgi/bugreport\\.cgi\\?bug=\\)?\\(?3:[[:digit:]]+\\)$")
>> +@end lisp
>
> While I'm at it, here's the ‘rx’ form of the above:
>
> (setq debbugs-browse-url-regexp
>       (rx
>        line-start
>        "http" (zero-or-one "s") "://"
>        (or "debbugs" "issues.guix" "bugs")
>        ".gnu.org" (one-or-more "/")
>        (group (zero-or-one "cgi/bugreport.cgi?bug="))
>        (group-n 3 (one-or-more digit))
>        line-end))

Installed with your changes!

-- 
Thanks,
Maxim


This bug report was last modified 1 year and 243 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.