From 08fabe62696da924e2bfe994e8cb1a1f4325c372 Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 1 Sep 2021 01:44:14 +0100 Subject: jao-notmuch: recovering tab/ret in show mode --- lib/net/jao-notmuch.el | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'lib/net') 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 @@ -110,6 +110,28 @@ (funcall fn (completing-read "Browse URL: " urls)) (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 @@ -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) -- cgit v1.2.3