summaryrefslogtreecommitdiffhomepage
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
parent09f80946134beb4048c7a8dc84e5ab1de2df533c (diff)
downloadelibs-ef955c13df5f269818995075861aea681d52989a.tar.gz
elibs-ef955c13df5f269818995075861aea681d52989a.tar.bz2
notmuch: better image toggling for w3m
-rw-r--r--init.org6
-rw-r--r--lib/net/jao-notmuch.el10
-rw-r--r--notmuch.org9
3 files changed, 20 insertions, 5 deletions
diff --git a/init.org b/init.org
index e3b0c7d..77fc22f 100644
--- a/init.org
+++ b/init.org
@@ -995,11 +995,15 @@
(setq line-move-visual t)
- (use-package iscroll :ensure t :diminish)
+ (use-package iscroll
+ :ensure t
+ :diminish)
(with-eval-after-load "gnus-art"
(add-hook 'gnus-article-mode-hook #'iscroll-mode))
(with-eval-after-load "eww"
(add-hook 'eww-mode-hook #'iscroll-mode))
+ (with-eval-after-load "notmuch-show"
+ (add-hook 'notmuch-show-mode #'iscroll-mode))
#+end_src
*** Splitting and switch
#+begin_src emacs-lisp
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)
diff --git a/notmuch.org b/notmuch.org
index 728851d..9a7772f 100644
--- a/notmuch.org
+++ b/notmuch.org
@@ -88,7 +88,9 @@
,(jao-notmuch--qn "emacs" "devel" "ed" '("tag:emacs-devel"))
,(jao-notmuch--qn "emacs" "bugs" "eb" '("tag:emacs-bugs"))
,(jao-notmuch--qn "emacs" "diffs" "ec" '("tag:emacs-diffs"))
- ,@(jao-notmuch--mboxes-search "feeds" "emacs")
+ ,(jao-notmuch--qn "feeds" "lobsters" "fl" '("tag:lobsters"))
+ ,(jao-notmuch--qn "feeds" "prog" "fp" '("tag:prog" "not tag:lobsters"))
+ ,@(jao-notmuch--mboxes-search "feeds" "emacs" "prog")
,(jao-notmuch--q "bml" "today" "tb" '("tag:bigml" "date:1d..") t)
,(jao-notmuch--q "jao" "today" "tj"
'("tag:jao" "date:1d.."
@@ -102,7 +104,8 @@
(defun jao-notmuch-widen-searches (searches)
(mapcar (lambda (s)
(let ((q (plist-get s :query)))
- (plist-put s :query (string-replace jao-notmuch--newa "" q))))
+ (plist-put (copy-sequence s)
+ :query (string-replace jao-notmuch--newa "" q))))
searches))
(defvar jao-notmuch-widened-searches
@@ -229,7 +232,7 @@
:config (setq jao-notmuch-mailboxes (jao-mailbox-folders)))
#+end_src
-* tree view
+* views
#+begin_src emacs-lisp
(use-package notmuch-tree
:config