diff options
-rw-r--r-- | lib/net/jao-notmuch.el | 30 | ||||
-rw-r--r-- | notmuch.org | 5 |
2 files changed, 20 insertions, 15 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 diff --git a/notmuch.org b/notmuch.org index 4cfd416..76e484c 100644 --- a/notmuch.org +++ b/notmuch.org @@ -74,11 +74,12 @@ ,(jao-notmuch--q "bigml" "bug" "bb") ,@(jao-notmuch--mboxes-search "bigml" "inbox" "support") ,@(jao-notmuch--mboxes-search "jao") - ,(jao-notmuch--q "jao" "papers" "jp" '("tag:papers" "tag:new")) + ,(jao-notmuch--q "feeds" "papers" "fp" '("tag:papers" "tag:new")) ,(jao-notmuch--q "local" nil "l" '("tag:local" "tag:new")) ,(jao-notmuch--q "gmane" "emacs" "e") ,(jao-notmuch--q "gmane" nil "g" - '("tag:gmane" "tag:new" "not tag:emacs")) + '("tag:gmane" "tag:new" + "not tag:emacs" "not tag:papers")) ,@(jao-notmuch--mboxes-search "feeds") ,(jao-notmuch--q "bml" "today" "tb" '("tag:bigml" "date:1d..") t) ,(jao-notmuch--q "jao" "today" "tj" |