From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: Bug-reference auto-setup for Rmail (please test) Date: Sun, 16 May 2021 11:58:25 +0200 Message-ID: <8735un560o.fsf@gnu.org> References: <87eee75d8n.fsf@gnu.org> <83o8dbukk9.fsf@gnu.org> <878s4f59u9.fsf@gnu.org> <83h7j3ujcc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1747"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.13; emacs 28.0.50 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 16 12:27:47 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 1liDzv-0000Fa-2V for ged-emacs-devel@m.gmane-mx.org; Sun, 16 May 2021 12:27:47 +0200 Original-Received: from localhost ([::1]:47596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liDzs-00007a-Vr for ged-emacs-devel@m.gmane-mx.org; Sun, 16 May 2021 06:27:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liDyW-0007DT-Nb for emacs-devel@gnu.org; Sun, 16 May 2021 06:26:22 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46594) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liDyV-0005eg-NO for emacs-devel@gnu.org; Sun, 16 May 2021 06:26:20 -0400 Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:48595) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liDyU-0005L6-Db; Sun, 16 May 2021 06:26:18 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id EF7CE27C0054; Sun, 16 May 2021 06:26:17 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 16 May 2021 06:26:17 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdeifedgvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvufffjgfkgggtsehttdertddtredtnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnhepff dtheehudehudehgeffhfeiteduudeiieffheffudekleelleeuheefvdevtdeknecuffho mhgrihhnpehgnhhurdhorhhgpdhshhgurdhlrghnnecukfhppeekjedrudeifedrfedurd duheegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep thhhohhrnhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejke egqdeifeehvdelkedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: from thinkpad-t440p (p57a31f9a.dip0.t-ipconnect.de [87.163.31.154]) by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 16 May 2021 06:26:17 -0400 (EDT) In-reply-to: <83h7j3ujcc.fsf@gnu.org> 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:269346 Archived-At: Eli Zaretskii 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