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

2020-08-15 Thread David Bremner
Teemu Likonen  writes:

> 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.
>
> This change also modifies tests so that they expect this new output
> format:
> test/emacs-show.expected-output/notmuch-show-indent-thread-content-off

Applied to master

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


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

2020-08-15 Thread 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.

This change also modifies tests so that they expect this new output
format:
test/emacs-show.expected-output/notmuch-show-indent-thread-content-off
---
 emacs/notmuch-show.el|  5 -
 .../notmuch-show-indent-thread-content-off   | 12 ++--
 2 files changed, 10 insertions(+), 7 deletions(-)


* 2020-08-12 20:38:06-03, David Bremner wrote:
> the test "notmuch-show: disable indentation of thread content (w/
> notmuch-show-toggle-thread-indentation)" in T450-emacs-show needs to be
> adjusted for this change (i.e. it fails as is).

Thanks. This version has updated test output files.


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
diff --git 
a/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off 
b/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off
index 1a06374d..0bb58330 100644
--- a/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off
+++ b/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off
@@ -31,8 +31,8 @@ Cheers,
 [ application/pgp-signature ]
 [ text/plain ]
 [ 4-line signature. Click/Enter to show. ]
- Mikhail Gusarov  (2009-11-17) (inbox signed unread)
-  Lars Kellogg-Stedman  (2009-11-17) (inbox signed)
+Mikhail Gusarov  (2009-11-17) (inbox signed unread)
+Lars Kellogg-Stedman  (2009-11-17) (inbox signed)
 Subject: Re: [notmuch] Working with Maildir storage?
 To: Mikhail Gusarov 
 Cc: notmuch@notmuchmail.org
@@ -57,9 +57,9 @@ It doesn't look like the patch is in git yet.
 [ application/pgp-signature ]
 [ text/plain ]
 [ 4-line signature. Click/Enter to show. ]
-   Mikhail Gusarov  (2009-11-17) (inbox unread)
-   Keith Packard  (2009-11-17) (inbox unread)
-Lars Kellogg-Stedman  (2009-11-18) (inbox signed 
unread)
+Mikhail Gusarov  (2009-11-17) (inbox unread)
+Keith Packard  (2009-11-17) (inbox unread)
+Lars Kellogg-Stedman  (2009-11-18) (inbox signed unread)
 Subject: Re: [notmuch] Working with Maildir storage?
 To: Keith Packard 
 Cc: notmuch@notmuchmail.org
@@ -79,4 +79,4 @@ missing "#include " (for the uint32_t on line 466).
 [ application/pgp-signature ]
 [ text/plain ]
 [ 4-line signature. Click/Enter to show. ]
- Carl Worth  (2009-11-18) (inbox unread)
+Carl Worth  (2009-11-18) (inbox unread)
-- 
2.20.1
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org