[PATCH] emacs: Add notmuch-wash-citation-lines-elided-min and use it

Tomi Ollila tomi.ollila at iki.fi
Thu Dec 12 13:47:50 PST 2019


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 at notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list