From 1bdcf80a11af8b1b7c0eac8bb704cc4b55330ca1 Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 6 Jun 2021 22:14:31 +0100 Subject: notmuch: better "and click" on message buffers --- email.org | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'email.org') diff --git a/email.org b/email.org index 88fa6c7..669607d 100644 --- a/email.org +++ b/email.org @@ -390,12 +390,14 @@ (defun jao-notmuch-refresh-hello () (interactive) - (when (derived-mode-p 'notmuch-hello-mode) - (when (not (string-blank-p jao-notmuch-minibuffer-string)) - (let ((notmuch-hello-auto-refresh nil)) (notmuch-hello))) - (let ((inhibit-message t)) - (beginning-of-buffer) - (widget-forward 2)))) + (ignore-errors + (when (and (string= "Mail" (jao-afio-current-frame)) + (derived-mode-p 'notmuch-hello-mode)) + (when (not (string-blank-p jao-notmuch-minibuffer-string)) + (let ((notmuch-hello-auto-refresh nil)) (notmuch-hello))) + (let ((inhibit-message t)) + (beginning-of-buffer) + (widget-forward 2))))) (defun jao-notmuch-open-enclosure (add) (interactive "P") @@ -433,12 +435,15 @@ (let ((b (current-buffer))) (select-window notmuch-tree-message-window) (setq-local jao-notmuch--tree-buffer b) - (when (and and-click (button-at (point))) (push-button)) - t))) + (or (not and-click) + (cond ((eww--url-at-point) (shr-browse-url) 'url) + ((button-at (point)) (push-button) 'button)))))) (defun jao-notmuch-click-message-buffer () (interactive) - (save-window-excursion (jao-notmuch-goto-message-buffer t))) + (let ((b (current-buffer))) + (unless (eq 'url (jao-notmuch-goto-message-buffer t)) + (pop-to-buffer b)))) (defun jao-notmuch-goto-index-buffer () (interactive) -- cgit v1.2.3