summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-05-20 03:24:37 +0100
committerjao <jao@gnu.org>2022-05-20 03:24:37 +0100
commit5488d4d3b1c2f7a308a847cdd2d1edb574200697 (patch)
tree5df2cd7ab64b5e7f185e074d2a0cd92caf5545d0
parentf31dd593db474575fe0edc298916586039b21aab (diff)
downloadelibs-5488d4d3b1c2f7a308a847cdd2d1edb574200697.tar.gz
elibs-5488d4d3b1c2f7a308a847cdd2d1edb574200697.tar.bz2
working better in term mode: html emails with .mailcap
-rw-r--r--lib/net/jao-notmuch.el24
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el
index 53137be..bd48e8f 100644
--- a/lib/net/jao-notmuch.el
+++ b/lib/net/jao-notmuch.el
@@ -174,6 +174,20 @@
(jao-notmuch--toggle-mime)
(jao-notmuch-goto-tree-buffer t)))
+(defun jao-notmuch--view-html ()
+ "Open the text/html part of the current message using `notmuch-show-view-part'."
+ (interactive)
+ (save-excursion
+ (goto-char
+ (prop-match-beginning
+ (text-property-search-forward
+ :notmuch-part
+ "text/html"
+ (lambda (value notmuch-part)
+ (equal (plist-get notmuch-part :content-type)
+ value)))))
+ (notmuch-show-view-part)))
+
(defvar-local jao-notmuch--showing-images nil)
(defun jao-notmuch--shr-toggle-images ()
@@ -193,10 +207,12 @@
(defun jao-notmuch-toggle-images ()
(interactive)
- (if (eq mm-text-html-renderer 'w3m)
- (when (fboundp 'jao-notmuch--w3m-toggle-images)
- (jao-notmuch--w3m-toggle-images))
- (jao-notmuch--shr-toggle-images)))
+ (cond ((eq mm-text-html-renderer 'w3m)
+ (when (fboundp 'jao-notmuch--w3m-toggle-images)
+ (jao-notmuch--w3m-toggle-images)))
+ (window-system (jao-notmuch--shr-toggle-images))
+ (t (with-current-buffer notmuch-tree-message-buffer
+ (jao-notmuch--view-html)))))
;;;; Keeping track of unread messages in current tree view