Re: [PATCH v2] Emacs: Indent first header line only when indentation is turned on
Teemu Likonen writes: > 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 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). ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
Re: [PATCH v2] Emacs: Indent first header line only when indentation is turned on
On Monday, 2020-08-10 at 17:37:57 +03, Teemu Likonen wrote: > 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. Reviewed-by: David Edmondson > --- > 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 dme. -- I used to get mad at my school, the teachers who taught me weren't cool. ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org
[PATCH v2] Emacs: Indent first header line only when indentation is turned on
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-le...@notmuchmail.org