From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Bug-reference auto-configuration Date: Wed, 17 Jun 2020 22:34:17 +0200 Message-ID: <87d05xxwhi.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="74718"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 17 22:35:15 2020 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 1jlemB-000JLF-Ep for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Jun 2020 22:35:15 +0200 Original-Received: from localhost ([::1]:56774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlemA-0002c0-Hj for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Jun 2020 16:35:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlelJ-0002Aa-3n for emacs-devel@gnu.org; Wed, 17 Jun 2020 16:34:22 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51418) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlelI-0003k5-R4 for emacs-devel@gnu.org; Wed, 17 Jun 2020 16:34:20 -0400 Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:43575) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1jlelI-00039i-B0 for emacs-devel@gnu.org; Wed, 17 Jun 2020 16:34:20 -0400 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id F12AB27C0054 for ; Wed, 17 Jun 2020 16:34:19 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 17 Jun 2020 16:34:19 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudejvddgudehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfgfgggtsehttdertd dtredtnecuhfhrohhmpefvrghsshhilhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhr gheqnecuggftrfgrthhtvghrnheptedvgfefvdfhieffueelvddvffduvdethfejkeehle fhheduteehleetjeettdehnecukfhppeelfedrvdefiedrudefhedrleejnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomhgvsh hmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdelkedq thhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: from thinkpad-t440p (p5dec8761.dip0.t-ipconnect.de [93.236.135.97]) by mail.messagingengine.com (Postfix) with ESMTPA id 1F188328005D for ; Wed, 17 Jun 2020 16:34:18 -0400 (EDT) Mail-Followup-To: emacs-devel@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:252286 Archived-At: Hi all, I've just pushed a feature for bug-reference.el. When `bug-reference-mode' or `bug-reference-prog-mode' is activated and after running its hook still no `bug-reference-url-format' is set, it'll try to guess suitable values. Currently, there are 2 such guessing function in place: - `bug-reference-try-setup-from-vc' tries to guess the right values from the URL of the file's version control repository. - Savannah git projects get our GNU debbugs URL. - GitHub and Gitlab get their issue trackers set with standard #18 bug references (and !17 merge requests for Gitlab) and also cross-project references such as namespace/project#19 are supported. - It is easy to add new rules by adding entries to `bug-reference-setup-from-vc-alist'. - `bug-reference-try-setup-from-gnus' tries to guess the right values in Gnus summary and article buffers by matching against the group name and mail header values From, To, Cc, and List-ID. - Currently, there's just one rule that should set the GNU debbugs URL in any Emacs, Gnus, AUCTeX, or Tramp related group or article. - Again, it's easy to add new rules by adding entries to `bug-reference-setup-from-mail-alist'. As the name suggests, that variable is not Gnus-related but I hope someone volunteers to add similar setup functions for rmail and other emacs mail clients which can use that variable, too. Basically, the only MUA-specific thing that needs to be done is to somehow get the mail-folder/newsgroup name and/or the interesting mail header values From, To, Cc, and List-ID and call `bug-reference--maybe-setup-from-mail'. I'd welcome some more testing. You just have to enable `bug-reference-mode' or `bug-reference-prog-mode' and cross fingers, e.g., ;; Enable in prog mode buffers. (add-hook 'prog-mode-hook #'bug-reference-prog-mode) and (for Gnus users) ;; Enable in Gnus summary and article buffers. (add-hook 'gnus-summary-mode-hook #'bug-reference-mode) (add-hook 'gnus-article-mode-hook #'bug-reference-mode) Bye, Tassilo