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

David Edmondson dme at dme.org
Thu Dec 12 13:17:43 PST 2019


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



More information about the notmuch mailing list