From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Tassilo Horn <tsdh@gnu.org>
Cc: ding@gnus.org
Subject: Re: Summary minor mode for Emacs-hacking groups?
Date: Sat, 02 May 2020 14:21:32 -0700 [thread overview]
Message-ID: <87a72qqbhf.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <871ro2n6sh.fsf@gnu.org> (Tassilo Horn's message of "Sat, 02 May 2020 09:18:54 +0200")
Tassilo Horn <tsdh@gnu.org> writes:
> Tassilo Horn <tsdh@gnu.org> 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)
next prev parent reply other threads:[~2020-05-02 21:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-01 19:06 Eric Abrahamsen
2020-05-01 19:24 ` Andreas Schwab
2020-05-01 19:32 ` Eric Abrahamsen
2020-05-01 22:34 ` Emanuel Berg
2020-05-01 23:31 ` Eric Abrahamsen
2020-05-05 2:44 ` Emanuel Berg
2020-05-02 6:58 ` Tassilo Horn
2020-05-02 7:18 ` Tassilo Horn
2020-05-02 15:15 ` Eric Abrahamsen
2020-05-02 21:21 ` Eric Abrahamsen [this message]
2020-05-07 19:03 ` Eric Abrahamsen
2020-05-11 16:09 ` Tassilo Horn
2020-05-14 0:28 ` Eric Abrahamsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a72qqbhf.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=ding@gnus.org \
--cc=tsdh@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).