unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: make header line in notmuch-show buffers optional
@ 2022-01-08 17:40 jao
  2022-01-09 23:23 ` David Bremner
  0 siblings, 1 reply; 3+ messages in thread
From: jao @ 2022-01-08 17:40 UTC (permalink / raw)
  To: notmuch; +Cc: 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] emacs: make header line in notmuch-show buffers optional
  2022-01-08 17:40 [PATCH] emacs: make header line in notmuch-show buffers optional jao
@ 2022-01-09 23:23 ` David Bremner
  2022-01-10  3:06   ` Jose Antonio Ortega Ruiz
  0 siblings, 1 reply; 3+ messages in thread
From: David Bremner @ 2022-01-09 23:23 UTC (permalink / raw)
  To: jao, notmuch

jao <jao@gnu.org> writes:

> 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).
>

No objections, provided you link the docstring into the
notmuch-show-mode doc in the same way as notmuch-message-headers{-visible}

d

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] emacs: make header line in notmuch-show buffers optional
  2022-01-09 23:23 ` David Bremner
@ 2022-01-10  3:06   ` Jose Antonio Ortega Ruiz
  0 siblings, 0 replies; 3+ messages in thread
From: Jose Antonio Ortega Ruiz @ 2022-01-10  3:06 UTC (permalink / raw)
  To: David Bremner, notmuch

On Sun, Jan 09 2022, David Bremner wrote:

> jao <jao@gnu.org> writes:
>
>> 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).
>>
>
> No objections, provided you link the docstring into the
> notmuch-show-mode doc in the same way as notmuch-message-headers{-visible}

v2 send, thanks!

jao
-- 
To kill time is not murder, it's suicide. -William James (1842-1910)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-10  3:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-08 17:40 [PATCH] emacs: make header line in notmuch-show buffers optional jao
2022-01-09 23:23 ` David Bremner
2022-01-10  3:06   ` Jose Antonio Ortega Ruiz

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).