From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 30192 invoked from network); 2 May 2020 21:23:56 -0000 Received: from lists1.math.uh.edu (129.7.128.208) by inbox.vuxu.org with ESMTPUTF8; 2 May 2020 21:23:56 -0000 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.92.3) (envelope-from ) id 1jUzbW-0003qU-7u; Sat, 02 May 2020 16:23:22 -0500 Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jUzbS-0003no-61 for ding@lists.math.uh.edu; Sat, 02 May 2020 16:23:18 -0500 Received: from quimby.gnus.org ([95.216.78.240]) by mx2.math.uh.edu with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jUza0-0001El-1l for ding@lists.math.uh.edu; Sat, 02 May 2020 16:23:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HxzsByDmPWhw5cZ5rcMM+R9SpedKhjIK+IUVHkQ//Bw=; b=bykjqdrB399YfFg45ko+I7XHSt 2shoSdW5pTb9nmBJ5nVNlvWiSzsvPuP7EKAgw5ng4PSogoQIoZkNoO1l30ta8cjSpfIdazBDGhKsD ZsunOxkjKD01+neJYSqhLSckhLx8y/w90n/lOPSIlyOTrwPqoeSIlyUXfeddTjRVF2WM=; Received: from ericabrahamsen.net ([52.70.2.18] helo=mail.ericabrahamsen.net) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jUzZq-0008M1-UY for ding@gnus.org; Sat, 02 May 2020 23:21:43 +0200 Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id E8C1AFA028; Sat, 2 May 2020 21:21:33 +0000 (UTC) From: Eric Abrahamsen To: Tassilo Horn Cc: ding@gnus.org Subject: Re: Summary minor mode for Emacs-hacking groups? References: <87wo5v8oh3.fsf@ericabrahamsen.net> <87pnbmrfga.fsf@gnu.org> <871ro2n6sh.fsf@gnu.org> Date: Sat, 02 May 2020 14:21:32 -0700 In-Reply-To: <871ro2n6sh.fsf@gnu.org> (Tassilo Horn's message of "Sat, 02 May 2020 09:18:54 +0200") Message-ID: <87a72qqbhf.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain List-ID: Precedence: bulk Tassilo Horn writes: > Tassilo Horn writes: > >> Wouldn't just activating bug-reference-mode in gnus-article-mode with >> >> (setq-local bug-reference-url-format >> "https://debbugs.gnu.org/cgi/bugreport.cgi?bug=%s") >> >> deal with at least emacs bug numbers (including all GNU package bug >> reports who also use GNU debbugs)? Of course, that would just produce >> clickable links and not Gnus buttons but it is readily available... I decided what I'd do is write the absolute minimum amount of code that did exactly what I want, and then see if it could be refactored into `bug-reference-mode'. The code below does pretty much everything, which is sort of amazing. It's terrible code in that everything's hard-coded and there's no error handling and no window management, but it works remarkably well. It remains to be seen if there are enough similarities with `bug-reference-mode' to try to add it in. `bug-reference-mode' is very much built around overlays containing urls. (defun gnus-buggy-open-bug (bug-str) "Open bug number BUG-STR." (let ((bug-num (string-to-number bug-str))) (unless (zerop bug-num) (debbugs-gnu-bugs bug-num)))) (defun gnus-buggy-visit-commit (commit) "Visit commit with hash COMMIT using `magit'." (magit-status source-directory) (magit-show-commit commit)) (push '("\\([Bb]ug#\\([[:digit:]]+\\)\\)" 1 (string-match-p "gmane\\.emacs" gnus-newsgroup-name) gnus-buggy-open-bug 2) gnus-button-alist) (push '("[0-9,a-f]\\{7,40\\}" 0 (string-match-p "gmane\\.emacs" gnus-newsgroup-name) gnus-buggy-visit-commit 0) gnus-button-alist)