From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Emacs and URLs in Git commit messages
Date: Tue, 20 Apr 2021 23:09:23 -0400 [thread overview]
Message-ID: <87bla8e3ks.fsf@gmail.com> (raw)
In-Reply-To: <87y2g24x27.fsf@gnu.org> ("Ludovic Courtès"'s message of "Fri, 05 Feb 2021 11:40:32 +0100")
Hi,
Ludovic Courtès <ludo@gnu.org> writes:
[...]
> I have this helper for debbugs.el:
>
> (defun ludo-copy-debbugs-url ()
> "Add to the kill ring the URL of the Debbugs issue at point."
> (interactive)
> (let ((url1 (concat "https://bugs.gnu.org/"
> (number-to-string (debbugs-gnu-current-id))))
> (url2 (concat "https://issues.guix.gnu.org/"
> (number-to-string (debbugs-gnu-current-id)))))
> (kill-new url1)
> (kill-new url2)
> (message "Copied %s and %s" url1 url2)))
>
> (define-key debbugs-gnu-mode-map (kbd "C-w") 'ludo-copy-debbugs-url)
>
> That way I can C-w on a bug in *Guix Bugs* and I get the two URLs in the
> clipboard (I normally use “bugs.gnu.org” as the canonical bug URL.)
Oh, that's perhaps nicer than what I had here (I like the
debbugs-gnu-current-id function):
(defun buffer-string-match (regexp)
"Return the string matching the first group, else nil"
(let ((text (buffer-substring-no-properties (point-min) (point-max))))
(and (string-match regexp text)
(match-string 1 text))))
(defun guix-get-debbugs-bug-number ()
(interactive)
(or (buffer-string-match "\\([[:digit:]]+\\)@debbugs.gnu.org")
(buffer-string-match "bug#\\([[:digit:]]+\\)")))
(defun guix-get-mumi-link (bug-number)
(interactive (list (guix-get-debbugs-bug-number)))
"Parse the current buffer for a Debbugs issues number and
return a link for it in the MUMI Guix tracker."
(let ((url (concat "https://issues.guix.gnu.org/" bug-number)))
(kill-new url)
(message "%s" url)))
Maxim
next prev parent reply other threads:[~2021-04-21 3:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-04 8:38 Emacs and URLs in Git commit messages Chris Marusich
2021-02-04 9:15 ` Maxime Devos
2021-02-06 5:00 ` Chris Marusich
2021-02-04 13:16 ` zimoun
2021-02-04 19:12 ` Bengt Richter
2021-02-05 10:40 ` Ludovic Courtès
2021-04-21 3:09 ` Maxim Cournoyer [this message]
2021-05-07 9:20 ` Alexey Abramov
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bla8e3ks.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=guix-devel@gnu.org \
--cc=ludo@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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).