summaryrefslogtreecommitdiffhomepage
path: root/lib/net/jao-notmuch.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-07-28 02:20:02 +0100
committerjao <jao@gnu.org>2021-07-28 02:20:02 +0100
commitef955c13df5f269818995075861aea681d52989a (patch)
tree615b5a1e7bfd05ed3b4f9c52ab8b99f8946ec38e /lib/net/jao-notmuch.el
parent09f80946134beb4048c7a8dc84e5ab1de2df533c (diff)
downloadelibs-ef955c13df5f269818995075861aea681d52989a.tar.gz
elibs-ef955c13df5f269818995075861aea681d52989a.tar.bz2
notmuch: better image toggling for w3m
Diffstat (limited to 'lib/net/jao-notmuch.el')
-rw-r--r--lib/net/jao-notmuch.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el
index c470682..7fae647 100644
--- a/lib/net/jao-notmuch.el
+++ b/lib/net/jao-notmuch.el
@@ -153,6 +153,8 @@
(jao-notmuch-goto-tree-buffer t)
(jao-notmuch--tree-update-buffer-name)))
+(defvar-local jao-notmuch--showing-images nil)
+
(defun jao-notmuch-show-images ()
(interactive)
(save-window-excursion
@@ -163,7 +165,13 @@
(when (looking-at-p "(hidden)")
(notmuch-show-toggle-part-invisibility))
(forward-line 1)
- (w3m-toggle-inline-images)))))
+ (setq-local jao-notmuch--showing-images
+ (not jao-notmuch--showing-images)
+ w3m-ignored-image-url-regexp
+ (unless jao-notmuch--showing-images
+ notmuch-show-text/html-blocked-images))
+ (w3m-toggle-inline-images
+ (if jao-notmuch--showing-images t 'turnoff))))))
(defun jao-notmuch-show-ret ()
(interactive)