guix-commits
[Top][All Lists]
Advanced

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

branch master updated: .dir-locals.el: Update bug-reference configuratio


From: guix-commits
Subject: branch master updated: .dir-locals.el: Update bug-reference configuration and document it.
Date: Sun, 17 Sep 2023 16:44:40 -0400

This is an automated email from the git hooks/post-receive script.

apteryx pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new fc1b4756e3 .dir-locals.el: Update bug-reference configuration and 
document it.
fc1b4756e3 is described below

commit fc1b4756e36857e66986a30a6652ee988f8f30fd
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Mon Sep 11 22:31:56 2023 -0400

    .dir-locals.el: Update bug-reference configuration and document it.
    
    (nil) <bug-reference-url-format>: Update URL.  Add comment.
    * doc/contributing.texi (The Perfect Setup): New "Viewing bugs within Emacs"
    subsection.
    
    Co-authored-by: Brian Cully <bjc@spork.org>
---
 .dir-locals.el        |  6 +++--
 doc/contributing.texi | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 68 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..156a6cb19e 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -379,6 +379,70 @@ copyright-update}.  If you want to do it automatically 
after each buffer
 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 top-most, first expression
+;;; provided to 'or') 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
+      (rx (group (or (seq word-boundary
+                          (or (seq (char "Bb") "ug"
+                                   (zero-or-one " ")
+                                   (zero-or-one "#"))
+                              (seq (char "Pp") "atch"
+                                   (zero-or-one " ")
+                                   "#")
+                              (seq (char "Ff") "ixes"
+                                   (zero-or-one ":")
+                                   (zero-or-one " ") "#")
+                              (seq "RFE"
+                                   (zero-or-one " ") "#")
+                              (seq "PR "
+                                   (one-or-more (char "a-z+-")) "/"))
+                          (group (one-or-more (char "0-9"))
+                                 (zero-or-one
+                                  (seq "#" (one-or-more
+                                            (char "0-9"))))))
+                     (seq "<https://bugs.gnu.org/";
+                          (group-n 2 (one-or-more (char "0-9")))
+                          ">")))))
+
+;; The following allows Emacs Debbugs user to open the issue directly within
+;; Emacs.
+(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))
+@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
 



reply via email to

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