From: Tassilo Horn <tsdh@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Bug-reference auto-setup for Rmail (please test)
Date: Sun, 16 May 2021 11:58:25 +0200 [thread overview]
Message-ID: <8735un560o.fsf@gnu.org> (raw)
In-Reply-To: <83h7j3ujcc.fsf@gnu.org>
Eli Zaretskii <eliz@gnu.org> writes:
>> With the default value of `bug-reference-setup-from-mail-alist', the
>> user-visible effect would be that bug reference (bug#12345) would be
>> fontified and clickable and browse that bug report on debbugs.gnu.org
>> in terms of `browse-url'.
>
> OK, but what is this supposed to do for other forums, like
> emacs-devel? what is the relevant URL there?
The default value sets
bug-reference-bug-regexp = "\\([Bb]ug ?#?\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)"
bug-reference-url-format = "https://debbugs.gnu.org/%s"
if some considered mail header (To, From, Cc, List-ID) matches something
emacs-related including emacs-devel@gnu.org (or some auctex, org-mode,
tramp) mailing list address or list-id.
For my job, I have
(add-to-list 'bug-reference-setup-from-mail-alist
`("SHD" ;; all my work groups/maildirs have SHD in their name
nil ;; no header matching needed
,(concat "\\b\\(\\("
(regexp-opt '("ARCA" "BRI" "ECOJ" "KASE" "MOBA"
"PORC" "LOWE"))
"-[0-9]\\{1,6\\}\\)\\)\\b")
"http://srvjira-and.shd.lan:8080/browse/%s"))
which would highlight and clickify bug numbers like ECOJ-18292 and
browse them at our internal JIRA tracker.
>> Gnus and Mu4e create a fresh buffer with their viewing mode when
>> viewing another mail just like you'd get another buffer when finding
>> another file.
>
> Then yes, this should be set up when showing a message, not when
> turning on the Rmail mode.
Right, the question is just what is the best way to do it. It has been
my design intention that
1. there is no special setup needed (just enable `bug-reference-mode'
where you like, and it'll work),
2. it does never interfere with explicit user settings. Therefore,
the auto-setup runs in `bug-reference-mode's :after-hook, so if the
2 variables are already set by file/dir-local variables or a hook
function, it won't do anything.
So the alternative of having some special `bug-reference-rmail-setup'
function rmail users can add to `rmail-show-message-hook' would go
against 1 whereas the alternative of adding special handling in rmail
would possibly go against 2 because we couldn't know if bug-regexp &
url-format have been set by the previous auto-setup or if it has been an
explicit user setting, so resetting them to nil could be a violation of
that rule.
I don't know how Rmail users work but guess that some users have one
mbox file per mailinglist and use rmail-mode-hook to activate & setup
bug-reference explitly looking at the name of the mbox file. In that
case, nuking the values and re-setting would be wrong.
So as it stands, I'd go with the special `bug-reference-rmail-setup'
function and document that in the Rmail info docs.
Bye,
Tassilo
next prev parent reply other threads:[~2021-05-16 9:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-16 7:23 Bug-reference auto-setup for Rmail (please test) Tassilo Horn
2021-05-16 8:52 ` Eli Zaretskii
2021-05-16 8:53 ` Tassilo Horn
2021-05-16 9:19 ` Eli Zaretskii
2021-05-16 9:58 ` Tassilo Horn [this message]
2021-05-16 11:04 ` Eli Zaretskii
2021-05-16 14:23 ` Tassilo Horn
2021-05-16 14:53 ` Tassilo Horn
2021-05-16 15:39 ` Tassilo Horn
2021-05-16 18:05 ` Eli Zaretskii
2021-05-16 18:53 ` Tassilo Horn
2021-05-16 10:02 ` Eli Zaretskii
2021-05-16 10:28 ` Tassilo Horn
2021-05-16 10:59 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8735un560o.fsf@gnu.org \
--to=tsdh@gnu.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).