summaryrefslogtreecommitdiffhomepage
path: root/attic/elisp/misc.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2026-11-15 23:55:17 +0000
committerjao <jao@gnu.org>2026-11-15 23:55:17 +0000
commitb6b536bb84a12fd46e91f50ab96ef9473e99b588 (patch)
treec676a038eac0b03c51ed812d3224455f348f5207 /attic/elisp/misc.el
parentb27733acd4caadb399f889ba9fe5fe22de120f44 (diff)
downloadelibs-b6b536bb84a12fd46e91f50ab96ef9473e99b588.tar.gz
elibs-b6b536bb84a12fd46e91f50ab96ef9473e99b588.tar.bz2
notmuch
Diffstat (limited to 'attic/elisp/misc.el')
-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)))