- (concat "[" (number-to-string (count-lines beg-sub (point)))
- " quoted lines.]")))))
- (if (looking-at "--[ ]?$")
- (let ((overlay (make-overlay beg-sub end)))
- (overlay-put overlay 'invisible 'notmuch-show-signature)
- (overlay-put overlay 'before-string
- (concat "[" (number-to-string (count-lines beg-sub (point)))
- "-line signature.]"))
- (goto-char end)))
- (next-line))))
+ (concat indent
+ "[" (number-to-string (count-lines beg-sub (point)))
+ "-line citation. Press 'c' to show.]\n")))))
+ (if (looking-at "[[:space:]]*-- ?$")
+ (let ((sig-lines (- (count-lines beg-sub end) 1)))
+ (if (<= sig-lines notmuch-show-signature-lines-max)
+ (progn
+ (overlay-put (make-overlay beg-sub end)
+ 'invisible 'notmuch-show-signature)
+ (overlay-put (make-overlay beg (- beg-sub 1))
+ 'after-string
+ (concat "\n" indent
+ "[" (number-to-string sig-lines)
+ "-line signature. Press 's' to show.]"))
+ (goto-char end)))))
+ (forward-line))))
+
+(defun notmuch-show-markup-part (beg end depth)
+ (if (re-search-forward notmuch-show-part-begin-regexp nil t)
+ (progn
+ (forward-line)
+ (let ((beg (point-marker)))
+ (re-search-forward notmuch-show-part-end-regexp)
+ (let ((end (copy-marker (match-beginning 0))))
+ (indent-rigidly beg end depth)
+ (notmuch-show-markup-citations-region beg end depth)
+ ; Advance to the next part (if any) (so the outer loop can
+ ; determine whether we've left the current message.
+ (re-search-forward notmuch-show-part-begin-regexp nil t))))
+ (goto-char end)))
+
+(defun notmuch-show-markup-parts-region (beg end depth)
+ (save-excursion
+ (goto-char beg)
+ (while (< (point) end)
+ (notmuch-show-markup-part beg end depth))))