GNU bug report logs - #72735
31.0.50; [PATCH] Make more bug-reference variables customizeable

Previous Next

Package: emacs;

Reported by: Björn Bidar <bjorn.bidar <at> thaodan.de>

Date: Tue, 20 Aug 2024 15:36:02 UTC

Severity: wishlist

Found in version 31.0.50

Full log


Message #59 received at 72735 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Björn Bidar <bjorn.bidar <at> thaodan.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 72735 <at> debbugs.gnu.org
Subject: Re: bug#72735: 31.0.50; [PATCH] Make more bug-reference variables
 customizeable
Date: Wed, 12 Feb 2025 10:56:53 +0100
Tassilo Horn <tsdh <at> gnu.org> writes:

> Oh, and with bug-reference-setup-from-vc-alist there's only a
> URL-FORMAT-FN which must be a function.

I've changed that now so that URL-FORMAT-FN became URL-FORMAT which can
be string or function.  The string variant suffices in many situations
like my own below.

> And adding you company's tracker is quite easy, too.  That's what I use:
>
> --8<---------------cut here---------------start------------->8---
> (let ((shd-jira-regexp (concat "\\b\\(\\("
>                                (regexp-opt '("ARCA" "BRI" "ECOJ" "KASE" "MOBA"
>                                              "PORC" "LOWE" "SABA"))
>                                "-[0-9]\\{1,6\\}\\)\\)\\b")))
>   (add-to-list 'bug-reference-setup-from-vc-alist
>                `("srv-upsource\\.shd\\.lan"
>                  ,shd-jira-regexp
>                  ,(lambda (_)
>                     :dont-hl-value-as-docstring
>                     "http://srvjira-and.shd.lan/browse/%s")))
>
>   (add-to-list 'bug-reference-setup-from-mail-alist
>                `("SHD" nil ,shd-jira-regexp
>                  "http://srvjira-and.shd.lan/browse/%s"))
> --8<---------------cut here---------------end--------------->8---

With my latest change, the first add-to-list can now be written as

  (add-to-list 'bug-reference-setup-from-mail-alist
               `("SHD" nil ,shd-jira-regexp
                 "http://srvjira-and.shd.lan/browse/%s"))

So now all three variables bug-reference-setup-from-*-alist may contain
entries with only simple strings, none strictly requires a function
(unless you need to derive the bug URL from the VC URL).  As such, they
could become defcustoms (of course, those must allow functions where
applicable, too) that could be customized at least for the simple cases
(like my dayjob config above).  I wouldn't reject a patch in this regard
(although I'm not convinced that many users would prefer that).

As Stefan K. already said: setting up bug-reference using a
.dir-locals.el is probably the better & easier approach for many cases.

Bye,
Tassilo




This bug report was last modified 120 days ago.

Previous Next


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