From 31178148a2c35afcb8bd28d340999ea3a21406f5 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Mon, 14 May 2018 18:34:28 -0400 Subject: notmuch-visit-github-url: Copy URL when given a prefix argument --- lisp/km-mail.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/km-mail.el b/lisp/km-mail.el index ab1cb78..8511326 100644 --- a/lisp/km-mail.el +++ b/lisp/km-mail.el @@ -211,10 +211,14 @@ Tracking System, set '--in-reply-to' to the initial report and ;;;###autoload -(defun km/notmuch-visit-github-url () - "Visit the GitHub link associated with this message." - (interactive) - (browse-url +(defun km/notmuch-visit-github-url (&optional copy) + "Visit the GitHub link associated with this message. +If COPY is non-nil, copy the URL instead of visiting it." + (interactive "P") + (funcall + (if copy + (lambda (url) (kill-new (message url))) + #'browse-url) (km/notmuch-with-raw-message (notmuch-show-get-message-id) (if (re-search-forward (concat "Reply to this email directly or view it on GitHub:\n" -- cgit v1.2.3