unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: Add notmuch-wash-citation-lines-elided-min and use it
@ 2019-12-12 21:17 David Edmondson
  2019-12-12 21:47 ` Tomi Ollila
  2019-12-14 11:39 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: David Edmondson @ 2019-12-12 21:17 UTC (permalink / raw)
  To: notmuch

When collapsing citations, if the collapsed region is less than
`notmuch-wash-citation-lines-elided-min' lines long, don't bother
collapsing it and simply show all of the lines.
---
 emacs/notmuch-wash.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 54108d93..556fd2ab 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -117,6 +117,13 @@ collapse the remaining lines into a button."
   :type 'integer
   :group 'notmuch-wash)
 
+(defcustom notmuch-wash-citation-lines-elided-min 1
+  "When collapsing a citation would remove less than
+`notmuch-wash-citation-lines-elided-min' lines, no collapsing
+takes place."
+  :type 'integer
+  :group 'notmuch-wash)
+
 (defcustom notmuch-wash-wrap-lines-length nil
   "Wrap line after at most this many characters.
 
@@ -241,7 +248,7 @@ that PREFIX should not include a newline."
       (overlay-put (make-overlay cite-start cite-end) 'face 'notmuch-wash-cited-text)
       (when (> cite-lines (+ notmuch-wash-citation-lines-prefix
 			     notmuch-wash-citation-lines-suffix
-			     1))
+			     notmuch-wash-citation-lines-elided-min))
 	(goto-char cite-start)
 	(forward-line notmuch-wash-citation-lines-prefix)
 	(let ((hidden-start (point-marker)))
-- 
2.24.0

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

* Re: [PATCH] emacs: Add notmuch-wash-citation-lines-elided-min and use it
  2019-12-12 21:17 [PATCH] emacs: Add notmuch-wash-citation-lines-elided-min and use it David Edmondson
@ 2019-12-12 21:47 ` Tomi Ollila
  2019-12-14 11:39 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: Tomi Ollila @ 2019-12-12 21:47 UTC (permalink / raw)
  To: notmuch

On Thu, Dec 12 2019, David Edmondson wrote:

> When collapsing citations, if the collapsed region is less than
> `notmuch-wash-citation-lines-elided-min' lines long, don't bother
> collapsing it and simply show all of the lines.

LGTM.

Tomi


> ---
>  emacs/notmuch-wash.el | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
> index 54108d93..556fd2ab 100644
> --- a/emacs/notmuch-wash.el
> +++ b/emacs/notmuch-wash.el
> @@ -117,6 +117,13 @@ collapse the remaining lines into a button."
>    :type 'integer
>    :group 'notmuch-wash)
>  
> +(defcustom notmuch-wash-citation-lines-elided-min 1
> +  "When collapsing a citation would remove less than
> +`notmuch-wash-citation-lines-elided-min' lines, no collapsing
> +takes place."
> +  :type 'integer
> +  :group 'notmuch-wash)
> +
>  (defcustom notmuch-wash-wrap-lines-length nil
>    "Wrap line after at most this many characters.
>  
> @@ -241,7 +248,7 @@ that PREFIX should not include a newline."
>        (overlay-put (make-overlay cite-start cite-end) 'face 'notmuch-wash-cited-text)
>        (when (> cite-lines (+ notmuch-wash-citation-lines-prefix
>  			     notmuch-wash-citation-lines-suffix
> -			     1))
> +			     notmuch-wash-citation-lines-elided-min))
>  	(goto-char cite-start)
>  	(forward-line notmuch-wash-citation-lines-prefix)
>  	(let ((hidden-start (point-marker)))
> -- 
> 2.24.0
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH] emacs: Add notmuch-wash-citation-lines-elided-min and use it
  2019-12-12 21:17 [PATCH] emacs: Add notmuch-wash-citation-lines-elided-min and use it David Edmondson
  2019-12-12 21:47 ` Tomi Ollila
@ 2019-12-14 11:39 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2019-12-14 11:39 UTC (permalink / raw)
  To: David Edmondson, notmuch

David Edmondson <dme@dme.org> writes:

> When collapsing citations, if the collapsed region is less than
> `notmuch-wash-citation-lines-elided-min' lines long, don't bother
> collapsing it and simply show all of the lines.

Merged to master,

d

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

end of thread, other threads:[~2019-12-14 11:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-12 21:17 [PATCH] emacs: Add notmuch-wash-citation-lines-elided-min and use it David Edmondson
2019-12-12 21:47 ` Tomi Ollila
2019-12-14 11:39 ` David Bremner

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