summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/net/jao-notmuch.el9
-rw-r--r--notmuch.org14
2 files changed, 21 insertions, 2 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el
index 918171f..48ba775 100644
--- a/lib/net/jao-notmuch.el
+++ b/lib/net/jao-notmuch.el
@@ -176,6 +176,15 @@
(button-at (point)))
(notmuch-show-toggle-part-invisibility))))
+(defun jao-notmuch--show-hidden-html ()
+ (when (save-excursion
+ (goto-char (point-min))
+ (re-search-forward "^\\[ text/html (hidden) \\]" nil t))
+ (jao-notmuch--toggle-mime)))
+
+(defun jao-notmuch-show-prefer-html ()
+ (add-hook 'notmuch-show-hook #'jao-notmuch--show-hidden-html))
+
(defun jao-notmuch-toggle-mime-parts ()
(interactive)
(when (jao-notmuch-goto-message-buffer nil t)
diff --git a/notmuch.org b/notmuch.org
index eaf488e..e2584e8 100644
--- a/notmuch.org
+++ b/notmuch.org
@@ -263,8 +263,18 @@
(advice-add 'notmuch-tree-format-field
:around #'jao-notmuch--format-field)
- (defun jao-notmuch--adjust-header () (setq header-line-format nil))
- (add-hook 'notmuch-show-hook #'jao-notmuch--adjust-header)
+ (defun jao-notmuch-show-setup ()
+ (setq header-line-format nil))
+
+ (add-hook 'notmuch-show-hook #'jao-notmuch-show-setup)
+ (jao-notmuch-show-prefer-html)
+
+ (defun jao-notmuch-tree-setup ()
+ (setq-local scroll-preserve-screen-position nil
+ scroll-margin 2
+ scroll-step 1))
+
+ (add-hook 'notmuch-tree-mode-hook #'jao-notmuch-tree-setup)
:bind (:map notmuch-tree-mode-map
(("C" . jao-notmuch-echo-count)