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

classic Classic list List threaded Threaded
3 messages Options
David Edmondson David Edmondson
Reply | Threaded
Open this post in threaded view
|

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

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

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Tomi Ollila-2 Tomi Ollila-2
Reply | Threaded
Open this post in threaded view
|

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

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
> [hidden email]
> https://notmuchmail.org/mailman/listinfo/notmuch
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

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

In reply to this post by David Edmondson
David Edmondson <[hidden email]> 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
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch