summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2018-04-28 21:52:33 -0400
committerKyle Meyer <kyle@kyleam.com>2018-04-28 21:52:33 -0400
commitb9b5607fbf155d2652329176fc1cad349dd1b595 (patch)
treecaede2839284aeb6a8a71efe5104ebbad651023f /lisp
parent6ddc4972208f923e9439c36e512286a89530df38 (diff)
downloademacs.d-b9b5607fbf155d2652329176fc1cad349dd1b595.tar.gz
mail: Add notmuch-visit-github-url command
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-mail.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/km-mail.el b/lisp/km-mail.el
index 7dad33d..ab1cb78 100644
--- a/lisp/km-mail.el
+++ b/lisp/km-mail.el
@@ -209,6 +209,20 @@ Tracking System, set '--in-reply-to' to the initial report and
(notmuch-show-stash-git-helper (list root-id) "--in-reply-to="))
" ")))))
+
+;;;###autoload
+(defun km/notmuch-visit-github-url ()
+ "Visit the GitHub link associated with this message."
+ (interactive)
+ (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"
+ "\\(https://github\.com/[^\n]+\\)$")
+ nil t)
+ (match-string-no-properties 1)
+ (user-error "No GitHub URL found")))))
+
;;; Mail sync