diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/jao-notmuch.el | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el index bb57f57..97e34f5 100644 --- a/lib/net/jao-notmuch.el +++ b/lib/net/jao-notmuch.el @@ -108,28 +108,30 @@ (jao-notmuch-goto-message-buffer)) (notmuch-show-browse-urls))) +(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))))) + (defun jao-notmuch-toggle-mime-parts () (interactive) (when (jao-notmuch-goto-message-buffer) (goto-char (point-min)) - (let ((notmuch-show-text/html-blocked-images nil) - (shr-inhibit-images nil) - (shr-blocked-images nil)) - (save-excursion - (when (re-search-forward "\\[ multipart/alternative \\]" nil t) - (while (forward-button 1 nil nil t) - (notmuch-show-toggle-part-invisibility))))) + (jao-notmuch--toggle-mime) (jao-notmuch-goto-tree-buffer))) -(defun jao-notmuch-toggle-images () +(defun jao-notmuch-show-images () (interactive) (save-window-excursion (jao-notmuch-goto-message-buffer) (when (derived-mode-p 'notmuch-show-mode) - (let ((notmuch-show-text/html-blocked-images nil) - (shr-inhibit-images nil) - (shr-blocked-images nil)) - (notmuch-refresh-this-buffer))))) + (setq-local mm-w3m-safe-url-regexp nil + notmuch-show-text/html-blocked-images nil + shr-inhibit-images nil + shr-blocked-images nil) + (notmuch-refresh-this-buffer)))) ;; Keeping track of unread messages in current tree view |