[PATCH v2] Emacs: Indent first header line only when indentation is turned on

Subject: [PATCH v2] Emacs: Indent first header line only when indentation is turned on

Date: Mon, 10 Aug 2020 17:37:57 +0300

To: David Edmondson, notmuch@notmuchmail.org

Cc: Teemu Likonen

From: Teemu Likonen


Previously in message-show mode message's first header line (From
header) was always indented, even if user had turned thread
indentation off with "<" (notmuch-show-toggle-thread-indentation)
command.

This change modifies notmuch-show-insert-headerline function so that
it doesn't indent the first header line if notmuch-show-indent-content
variable is nil.
---
 emacs/notmuch-show.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


* 2020-08-10 11:19:10+01, David Edmondson wrote:
>> +    (insert (notmuch-show-spaces-n
>> +	     (if notmuch-show-indent-content
>> +		 (* notmuch-show-indent-messages-width depth)
>> +	       0))
>
> Couldn't you also elide the call to `notmuch-show-spaces-n'?

Indeed.



diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 0eb27e33..444b2a45 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -474,7 +474,10 @@ message at DEPTH in the current thread."
       ;; invisible U+200E LEFT-TO-RIGHT MARK character which forces
       ;; the header paragraph as left-to-right text.
       (insert (propertize (string ?\x200e) 'invisible t)))
-    (insert (notmuch-show-spaces-n (* notmuch-show-indent-messages-width depth))
+    (insert (if notmuch-show-indent-content
+		(notmuch-show-spaces-n (* notmuch-show-indent-messages-width
+					  depth))
+	      "")
 	    from
 	    " ("
 	    date
-- 
2.20.1
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: