summaryrefslogtreecommitdiffhomepage
path: root/lib/net
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-10-02 01:55:51 +0100
committerjao <jao@gnu.org>2021-10-02 01:55:51 +0100
commitbbe892c1810cc6f9d66355d5cabf89889c6668b2 (patch)
tree6fd6b71309b0c6d57af5616139e93951cad349b9 /lib/net
parent3b4761074d0d513ff1c262d30da003f753ef4c7a (diff)
downloadelibs-bbe892c1810cc6f9d66355d5cabf89889c6668b2.tar.gz
elibs-bbe892c1810cc6f9d66355d5cabf89889c6668b2.tar.bz2
notmuch: my old M-g command
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/jao-notmuch.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el
index d5e239e..d93ebdb 100644
--- a/lib/net/jao-notmuch.el
+++ b/lib/net/jao-notmuch.el
@@ -108,15 +108,18 @@
(when (stringp url) (cl-pushnew url res :test #'string=))))
(seq-uniq res #'string=))))
+(defun jao-notmuch-message-urls ()
+ (save-window-excursion
+ (when (or (derived-mode-p 'notmuch-show-mode)
+ (jao-notmuch-goto-message-buffer))
+ (jao-notmuch--page-urls (notmuch-show--gather-urls)))))
+
(defun jao-notmuch-browse-urls (&optional external)
(interactive "P")
- (when (or (derived-mode-p 'notmuch-show-mode)
- (jao-notmuch-goto-message-buffer))
- (let ((urls (jao-notmuch--page-urls (notmuch-show--gather-urls)))
- (fn (if external browse-url-secondary-browser-function #'browse-url)))
- (if urls
- (funcall fn (completing-read "Browse URL: " urls))
- (message "No URLs in this message")))))
+ (if-let ((urls (jao-notmuch-message-urls)))
+ (funcall (if external browse-url-secondary-browser-function #'browse-url)
+ (completing-read "Browse URL: " urls))
+ (message "No URLs in this message")))
;;;; Navigating URLs