"\\(^[[:space:]]*>.*\n\\)+"
"Pattern to match citation lines.")
+(defvar notmuch-wash-original-regexp "^\\(--+\s?[oO]riginal [mM]essage\s?--+\\)$"
+ "Pattern to match a line that separates original message from reply in top-posted message.")
+
(defvar notmuch-wash-button-signature-hidden-format
"[ %d-line signature. Click/Enter to show. ]"
"String used to construct button text for hidden signatures.
"String used to construct button text for visible citations.
Can use up to one integer format parameter, i.e. %d")
+(defvar notmuch-wash-button-original-hidden-format
+ "[ %d-line hidden original message. Click/Enter to show. ]"
+ "String used to construct button text for hidden citations.
+Can use up to one integer format parameter, i.e. %d")
+
+(defvar notmuch-wash-button-original-visible-format
+ "[ %d-line original message. Click/Enter to hide. ]"
+ "String used to construct button text for visible citations.
+Can use up to one integer format parameter, i.e. %d")
+
(defvar notmuch-wash-signature-lines-max 12
"Maximum length of signature that will be hidden by default.")
'help-echo "mouse-1, RET: Show signature"
:supertype 'notmuch-wash-button-invisibility-toggle-type)
+(define-button-type 'notmuch-wash-button-original-toggle-type
+ 'help-echo "mouse-1, RET: Show original message"
+ :supertype 'notmuch-wash-button-invisibility-toggle-type)
+
(defun notmuch-wash-region-isearch-show (overlay)
(remove-from-invisibility-spec (overlay-get overlay 'invisible)))
"Excerpt citations and up to one signature."
(goto-char (point-min))
(beginning-of-line)
+ (if (and (< (point) (point-max))
+ (re-search-forward notmuch-wash-original-regexp nil t))
+ (let* ((msg-start (match-beginning 0))
+ (msg-end (point-max))
+ (msg-lines (count-lines msg-start msg-end)))
+ (notmuch-wash-region-to-button
+ msg-start msg-end "original" "\n")))
(while (and (< (point) (point-max))
(re-search-forward notmuch-wash-citation-regexp nil t))
(let* ((cite-start (match-beginning 0))