[PATCH] emacs: make header line in notmuch-show buffers optional

Subject: [PATCH] emacs: make header line in notmuch-show buffers optional

Date: Sat, 8 Jan 2022 17:40:00 +0000

To: notmuch@notmuchmail.org

Cc: jao

From: jao


New notmuch-show-header-line customizable boolean to allow inhibiting
a header line in notmuch-show-mode buffers (for instance, because one
prefers to just include Subject in notmuch-message-headers).

Signed-off-by: jao <jao@gnu.org>
---
 emacs/notmuch-show.el | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 4de3e423..7c1f02c9 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -84,6 +84,11 @@ visible for any given message."
   :type 'boolean
   :group 'notmuch-show)
 
+(defcustom notmuch-show-header-line t
+  "Show a header line with the current message's subject."
+  :type 'boolean
+  :group 'notmuch-show)
+
 (defcustom notmuch-show-relative-dates t
   "Display relative dates in the message summary line."
   :type 'boolean
@@ -1345,11 +1350,12 @@ If no messages match the query return NIL."
       (notmuch-show-mapc
        (lambda () (notmuch-show-set-prop :orig-tags (notmuch-show-get-tags))))
       ;; Set the header line to the subject of the first message.
-      (setq header-line-format
-	    (replace-regexp-in-string "%" "%%"
-				      (notmuch-sanitize
-				       (notmuch-show-strip-re
-					(notmuch-show-get-subject)))))
+      (when notmuch-show-header-line
+	(setq header-line-format
+	      (replace-regexp-in-string "%" "%%"
+					(notmuch-sanitize
+					 (notmuch-show-strip-re
+					  (notmuch-show-get-subject))))))
       (run-hooks 'notmuch-show-hook)
       (if state
 	  (notmuch-show-apply-state state)
-- 
2.34.1

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: