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: Bug-reference auto-setup for Rmail (please test) Date: Sun, 16 May 2021 09:23:21 +0200 Message-ID: <87eee75d8n.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="345"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.13; emacs 28.0.50 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 16 09:50:57 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 1liBY8-000AYr-QY for ged-emacs-devel@m.gmane-mx.org; Sun, 16 May 2021 09:50:56 +0200 Original-Received: from localhost ([::1]:59932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liBY6-0002ui-S3 for ged-emacs-devel@m.gmane-mx.org; Sun, 16 May 2021 03:50:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liBXZ-0002FB-3q for emacs-devel@gnu.org; Sun, 16 May 2021 03:50:21 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43558) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liBXY-000898-TJ for emacs-devel@gnu.org; Sun, 16 May 2021 03:50:20 -0400 Original-Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:44249) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liBXY-0003bG-NY for emacs-devel@gnu.org; Sun, 16 May 2021 03:50:20 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 9416827C0054 for ; Sun, 16 May 2021 03:50:19 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sun, 16 May 2021 03:50:19 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdeivddgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpegfhffvufffkfggtgesthdtredttd ertdenucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhg qeenucggtffrrghtthgvrhhnpeduvdeuveejfeekueffieffhfethfdviedutddtgfeivd dvhfevffelgfdujeetveenucfkphepkeejrdduieefrdefuddrudehgeenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnodhmvghsmh htphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedvleekqdht shguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: from thinkpad-t440p (p57a31f9a.dip0.t-ipconnect.de [87.163.31.154]) by mail.messagingengine.com (Postfix) with ESMTPA for ; Sun, 16 May 2021 03:50:18 -0400 (EDT) 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:269330 Archived-At: Hi all, I've just pushed a commit which should make bug-reference auto-setup work for Rmail messages. I'm no Rmail user, so I'd appreciate some testing from actual users. What you need to do is activate `bug-reference-mode' in Rmail, so probably: (add-hook 'rmail-mode-hook #'bug-reference-mode) and then it'll try to guess the right `bug-reference-bug-regexp' and `bug-reference-url-format' based on the List-Id, To, From, and Cc headers according to the customize option `bug-reference-setup-from-mail-alist' which should at least have a suitable default value for (some) emacs-related mailinglists including emacs-devel. There is one problem where I need implementation advice. The bug-reference auto-setup is a no-op if `bug-reference-bug-regexp' and `bug-reference-url-format' are already set (see `bug-reference--run-auto-setup'). So if you view an emacs-devel message first, it'll set those variables. When you move on to the next message (which might be completely unrelated to emacs), the variables are still set, so no new guesswork will be done. We'd need to nuke the buffer-local values and re-enable `bug-reference-mode' on switching messages, e.g., (add-hook 'rmail-show-message-hook #'rmail-bug-reference-setup) for a yet to be written rmail-bug-reference-setup which is a bit sad because for all other modes where I've added this auto-setup capability (Gnus, Mu4e [currently only in my ~/.emacs], rcirc, ERC, VC) the "normal" (add-hook '-hook #'bug-reference-mode) will do, that is, for Rmail the user would need to use a special function rather than just enabling `bug-reference-mode' in the mode of his choice. (Of course, this could be documented.) Alternatively, Rmail itself could check if `bug-reference-mode' is enabled, nuke the two variables, and call `bug-reference--run-auto-setup'. WDYT? Bye, Tassilo