diff options
author | jao <jao@gnu.org> | 2021-07-10 02:23:24 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-07-10 02:23:24 +0100 |
commit | 0fdce9f23b433ce694c1c6a1e3baca80eb4628ed (patch) | |
tree | 7e978c317abf88c1de44ea8fa68732943aff47a1 /lib/net/jao-notmuch.el | |
parent | 6c1ad29239091c29f8e71847b7d9e14795de0d52 (diff) | |
download | elibs-0fdce9f23b433ce694c1c6a1e3baca80eb4628ed.tar.gz elibs-0fdce9f23b433ce694c1c6a1e3baca80eb4628ed.tar.bz2 |
notmuch
Diffstat (limited to 'lib/net/jao-notmuch.el')
-rw-r--r-- | lib/net/jao-notmuch.el | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el index 9aecd7d..1de94dc 100644 --- a/lib/net/jao-notmuch.el +++ b/lib/net/jao-notmuch.el @@ -80,11 +80,11 @@ (defvar-local jao-notmuch--tree-buffer nil) -(defun jao-notmuch-goto-message-buffer (&optional and-click) +(defun jao-notmuch-goto-message-buffer (&optional and-click no-record) (interactive "P") (when (window-live-p notmuch-tree-message-window) (let ((b (current-buffer))) - (select-window notmuch-tree-message-window) + (select-window notmuch-tree-message-window no-record) (setq-local jao-notmuch--tree-buffer b) (or (not and-click) (cond ((eww--url-at-point) (shr-browse-url) 'url) @@ -93,13 +93,13 @@ (defun jao-notmuch-click-message-buffer () (interactive) (let ((b (current-buffer))) - (unless (eq 'url (jao-notmuch-goto-message-buffer t)) + (unless (eq 'url (jao-notmuch-goto-message-buffer t t)) (pop-to-buffer b)))) -(defun jao-notmuch-goto-tree-buffer () +(defun jao-notmuch-goto-tree-buffer (&optional no-record) (interactive) (if (buffer-live-p jao-notmuch--tree-buffer) - (pop-to-buffer jao-notmuch--tree-buffer) + (pop-to-buffer jao-notmuch--tree-buffer nil no-record) (user-error "No tree view for this buffer"))) (defun jao-notmuch-browse-urls () @@ -111,24 +111,28 @@ (defun jao-notmuch--toggle-mime () (save-excursion (goto-char (point-min)) - (when (re-search-forward "\\[ multipart/alternative \\]" nil t) - (while (forward-button 1 nil nil t) - (notmuch-show-toggle-part-invisibility))))) + (when (forward-button 1 nil nil t) + (when (looking-at-p "\\[ multipart/alternative") + (when (looking-at-p "\\[ multipart/alternative (hidden)") + (push-button)) + (while (forward-button 1 nil nil t) + (notmuch-show-toggle-part-invisibility)))))) (defun jao-notmuch-toggle-mime-parts () (interactive) - (when (jao-notmuch-goto-message-buffer) + (when (jao-notmuch-goto-message-buffer nil t) (goto-char (point-min)) (jao-notmuch--toggle-mime) - (jao-notmuch-goto-tree-buffer) + (jao-notmuch-goto-tree-buffer t) (jao-notmuch--tree-update-buffer-name))) (defun jao-notmuch-show-images () (interactive) (save-window-excursion - (jao-notmuch-goto-message-buffer) - (when (derived-mode-p 'notmuch-show-mode) - (when (or mm-w3m-safe-url-regexp notmuch-show-text/html-blocked-images) + (when (and (jao-notmuch-goto-message-buffer nil t) + (derived-mode-p 'notmuch-show-mode)) + (when (or mm-w3m-safe-url-regexp + notmuch-show-text/html-blocked-images) (setq-local mm-w3m-safe-url-regexp nil notmuch-show-text/html-blocked-images nil shr-inhibit-images nil |