summaryrefslogtreecommitdiffhomepage
path: root/attic/elisp
diff options
context:
space:
mode:
Diffstat (limited to 'attic/elisp')
-rw-r--r--attic/elisp/misc.el25
1 files changed, 25 insertions, 0 deletions
diff --git a/attic/elisp/misc.el b/attic/elisp/misc.el
index 44728bc..1668251 100644
--- a/attic/elisp/misc.el
+++ b/attic/elisp/misc.el
@@ -1337,3 +1337,28 @@ It should be the title of the web page as returned by `rdrview'"
(if jao-exwm-use-afio
(setq minibuffer-follows-selected-frame nil)
(jao-exwm-no-afio-setup))
+;;; navigating URLs in notmuch rendered by w3m
+
+(require 'ffap)
+
+(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)
+ (or (forward-button 1 nil t t)
+ (ffap-next-guess))))
+
+(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))
+ (or (backward-button 1 nil t t)
+ (ffap-next-guess t))))
+
+(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)))