]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: make header line in notmuch-show buffers optional
authorjao <jao@gnu.org>
Mon, 10 Jan 2022 03:05:23 +0000 (03:05 +0000)
committerDavid Bremner <david@tethera.net>
Mon, 10 Jan 2022 12:03:40 +0000 (08:03 -0400)
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).

doc/notmuch-emacs.rst
emacs/notmuch-show.el

index 22aee340c62061e31a582c3110468a019a6098d3..fed619b78720e106808ef2f4c0aa6adf7c3c8d18 100644 (file)
@@ -222,6 +222,9 @@ Display of messages can be controlled by the following variables
 :index:`notmuch-message-headers-visible`
        |docstring::notmuch-message-headers-visible|
 
+:index:`notmuch-show-header-line`
+       |docstring::notmuch-show-header-line|
+
 .. _show-copy:
 
 Copy to kill-ring
index 4de3e423bec077ab85b622ac05e40fef2582c494..7c1f02c92f1499be58df08929863d4e1aa013118 100644 (file)
@@ -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)