aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-01-10 03:05:23 +0000
committerDavid Bremner <david@tethera.net>2022-01-10 08:03:40 -0400
commit332b3b639ebd797eac6980fc7bd547f6cd064e84 (patch)
tree9cfaa08762fded8926f199252cb70a7e1aa780f8
parent63d3b2b5cf8702b5fecea77392ce46f8a8249175 (diff)
emacs: make header line in notmuch-show buffers optional
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).
-rw-r--r--doc/notmuch-emacs.rst3
-rw-r--r--emacs/notmuch-show.el16
2 files changed, 14 insertions, 5 deletions
diff --git a/doc/notmuch-emacs.rst b/doc/notmuch-emacs.rst
index 22aee340..fed619b7 100644
--- a/doc/notmuch-emacs.rst
+++ b/doc/notmuch-emacs.rst
@@ -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
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)