diff options
-rw-r--r-- | lib/net/jao-notmuch.el | 23 | ||||
-rw-r--r-- | notmuch.org | 5 |
2 files changed, 26 insertions, 2 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el index 8ed14dc..b67c788 100644 --- a/lib/net/jao-notmuch.el +++ b/lib/net/jao-notmuch.el @@ -111,6 +111,28 @@ (message "No URLs in this message"))))) +;; Navigating URLs +(defun jao-notmuch-show-next-button () + (interactive) + (when (get-text-property (point) 'w3m-href-anchor) + (goto-char (next-single-property-change (point) 'w3m-href-anchor))) + (if-let (pos (next-single-property-change (point) 'w3m-href-anchor)) + (goto-char pos) + (forward-button 1))) + +(defun jao-notmuch-show-previous-button () + (interactive) + (if-let (pos (previous-single-property-change (point) 'w3m-href-anchor)) + (goto-char (previous-single-property-change pos 'w3m-href-anchor)) + (backward-button 1))) + +(defun jao-notmuch-show-ret () + (interactive) + (when-let (url (or (get-text-property (point) 'w3m-href-anchor) + (thing-at-point-url-at-point))) + (browse-url url))) + + ;; Toggling mime parts and images (defun jao-notmuch--toggle-mime () @@ -164,7 +186,6 @@ ;; fix w3m renderer keymap (defun jao-w3m-gnus-html-renderer (handle) (let ((w3m-message-silent t) - (mm-inline-text-html-with-w3m-keymap t) (mm-w3m-safe-url-regexp nil)) (condition-case nil (mm-inline-text-html-render-with-w3m handle) diff --git a/notmuch.org b/notmuch.org index 0cb6261..a0af9b5 100644 --- a/notmuch.org +++ b/notmuch.org @@ -272,7 +272,10 @@ :bind (:map notmuch-show-mode-map - (("h" . jao-notmuch-goto-tree-buffer)))) + (("h" . jao-notmuch-goto-tree-buffer) + ("TAB" . jao-notmuch-show-next-button) + ("S-TAB" . jao-notmuch-show-previous-button) + ("RET" . jao-notmuch-show-ret)))) #+end_src * search |