X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch.el;h=8894a8e194716f444489b1676c3630c545c82c95;hp=f1523ac0419c5dac502469339a26fac637502a6f;hb=dac31c9e01a18130f141994c98a48800cdb03efa;hpb=ea484f0ebf3f25fbc701b061f36e2fe167057cc3 diff --git a/notmuch.el b/notmuch.el index f1523ac0..8894a8e1 100644 --- a/notmuch.el +++ b/notmuch.el @@ -57,6 +57,16 @@ "Keymap for \"notmuch show\" buffers.") (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 "Maximum length of signature that will be hidden by default.") @@ -443,7 +453,8 @@ which this thread was originally shown." (concat indent "[" (number-to-string (count-lines beg-sub (point))) "-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))) (if (<= sig-lines notmuch-show-signature-lines-max) (progn @@ -780,7 +791,7 @@ global search. (goto-char (point-min)) (while (not (eobp)) (notmuch-search-markup-this-thread-id) - (next-line)))) + (forward-line)))) (defun notmuch-search-show-thread () (interactive)