diff options
Diffstat (limited to 'custom')
-rw-r--r-- | custom/jao-custom-notmuch.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el index d65958f..5673242 100644 --- a/custom/jao-custom-notmuch.el +++ b/custom/jao-custom-notmuch.el @@ -541,6 +541,16 @@ ("M-g" . jao-notmuch-browse-url) ("M-u" . jao-notmuch-tree-reset-tags)))) +;;; browse-url +(defvar jao-notmuch-url-rx "^notmuch:\\(/+\\|id:\\)\\(.+\\)") + +(defun jao-notmuch-open-url (url &rest _) + (and (string-match jao-notmuch-url-rx url) + (notmuch-show (concat "id:" (match-string 2 url))))) + +(add-to-list 'browse-url-handlers + (cons jao-notmuch-url-rx 'jao-notmuch-open-url)) + ;;; org mode (defvar jao-org-notmuch-last-subject nil) (defun jao-org-notmuch-last-subject () jao-org-notmuch-last-subject) |