From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Bug-reference auto-setup for Rmail (please test) Date: Sun, 16 May 2021 14:04:01 +0300 Message-ID: <83bl9buehq.fsf@gnu.org> References: <87eee75d8n.fsf@gnu.org> <83o8dbukk9.fsf@gnu.org> <878s4f59u9.fsf@gnu.org> <83h7j3ujcc.fsf@gnu.org> <8735un560o.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17100"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 16 13:05:31 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1liEaQ-0004HV-TB for ged-emacs-devel@m.gmane-mx.org; Sun, 16 May 2021 13:05:30 +0200 Original-Received: from localhost ([::1]:42510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liEaP-0002Om-R4 for ged-emacs-devel@m.gmane-mx.org; Sun, 16 May 2021 07:05:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liEYz-0001hl-3p for emacs-devel@gnu.org; Sun, 16 May 2021 07:04:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47226) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liEYy-0003EI-SR for emacs-devel@gnu.org; Sun, 16 May 2021 07:04:00 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4600 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liEYy-0007o3-8l; Sun, 16 May 2021 07:04:00 -0400 In-Reply-To: <8735un560o.fsf@gnu.org> (message from Tassilo Horn on Sun, 16 May 2021 11:58:25 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:269351 Archived-At: > From: Tassilo Horn > Cc: emacs-devel@gnu.org > Date: Sun, 16 May 2021 11:58:25 +0200 > > > 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. At least for Emacs, when we mention bug#NNNNN on emacs-devel, we always mean debbugs, so the URL seems independent of the forum. > > 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. We could add an Rmail-specific defcustom in bug-reference.el, which, if non-nil, will tell Rmail to run bug-reference-rmail-setup when showing a message. > 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. The new defcustom could accept values that are alists, with separate values for each inbox.