From ef955c13df5f269818995075861aea681d52989a Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 28 Jul 2021 02:20:02 +0100 Subject: notmuch: better image toggling for w3m --- lib/net/jao-notmuch.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/net') 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) -- cgit v1.2.3