From b9b5607fbf155d2652329176fc1cad349dd1b595 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 28 Apr 2018 21:52:33 -0400 Subject: mail: Add notmuch-visit-github-url command --- lisp/km-mail.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lisp') 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 -- cgit v1.2.3