mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
notmuch.el: Consider an entire line of underscores as a signature separator.
This is the default separator used by mailman, so there's a lot of clutter in thread displays without this. Also, we not provide a nice variable to the user (notmuch-show-signature-regexp) for configuring this.
This commit is contained in:
parent
ea484f0ebf
commit
057b3060e8
1 changed files with 12 additions and 1 deletions
13
notmuch.el
13
notmuch.el
|
@ -57,6 +57,16 @@
|
||||||
"Keymap for \"notmuch show\" buffers.")
|
"Keymap for \"notmuch show\" buffers.")
|
||||||
(fset 'notmuch-show-mode-map notmuch-show-mode-map)
|
(fset 'notmuch-show-mode-map notmuch-show-mode-map)
|
||||||
|
|
||||||
|
(defvar notmuch-show-signature-regexp "\\(-- ?\\|_+\\)$"
|
||||||
|
"Pattern to match a line that separates content from signature.
|
||||||
|
|
||||||
|
The regexp can (and should) include $ to match the end of the
|
||||||
|
line, but should not include ^ to match the beginning of the
|
||||||
|
line. This is because notmuch may have inserted additional space
|
||||||
|
for indentation at the beginning of the line. But notmuch will
|
||||||
|
move past the indentation when testing this pattern, (so that the
|
||||||
|
pattern can still test against the entire line).")
|
||||||
|
|
||||||
(defvar notmuch-show-signature-lines-max 12
|
(defvar notmuch-show-signature-lines-max 12
|
||||||
"Maximum length of signature that will be hidden by default.")
|
"Maximum length of signature that will be hidden by default.")
|
||||||
|
|
||||||
|
@ -443,7 +453,8 @@ which this thread was originally shown."
|
||||||
(concat indent
|
(concat indent
|
||||||
"[" (number-to-string (count-lines beg-sub (point)))
|
"[" (number-to-string (count-lines beg-sub (point)))
|
||||||
"-line citation. Press 'c' to show.]\n")))))
|
"-line citation. Press 'c' to show.]\n")))))
|
||||||
(if (looking-at "[[:space:]]*-- ?$")
|
(move-to-column depth)
|
||||||
|
(if (looking-at notmuch-show-signature-regexp)
|
||||||
(let ((sig-lines (- (count-lines beg-sub end) 1)))
|
(let ((sig-lines (- (count-lines beg-sub end) 1)))
|
||||||
(if (<= sig-lines notmuch-show-signature-lines-max)
|
(if (<= sig-lines notmuch-show-signature-lines-max)
|
||||||
(progn
|
(progn
|
||||||
|
|
Loading…
Reference in a new issue