X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-wash.el;h=cfcfb21c01d4982ad2482ea3133708cfd6af40b2;hb=2b433736a56ec1ccac67ada9cc81337a157a45a2;hp=46e182435ea24163aafbbf3b436baf7a963002ad;hpb=229292a4b25cc776349ab1c461392a69301733c7;p=notmuch diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index 46e18243..cfcfb21c 100644 --- a/emacs/notmuch-wash.el +++ b/emacs/notmuch-wash.el @@ -145,7 +145,7 @@ is what to put on the button." (re-search-forward notmuch-wash-signature-regexp nil t)) (let* ((sig-start (match-beginning 0)) (sig-end (match-end 0)) - (sig-lines (1- (count-lines sig-start (point-max))))) + (sig-lines (count-lines sig-start (point-max)))) (if (<= sig-lines notmuch-wash-signature-lines-max) (let ((sig-start-marker (make-marker)) (sig-end-marker (make-marker))) @@ -214,7 +214,17 @@ Perform four transformations on the message body: ;; text. (goto-char (point-min)) (while (re-search-forward "\\(^>[> ]*\n\\)\\(^$\\|^[^>].*\\)" nil t) - (replace-match "\\2"))) + (replace-match "\\2")) + + ;; Insert a blank line before a citation if there isn't one. + (goto-char (point-min)) + (while (re-search-forward "\\(^[^>]+\\)\n>" nil t) + (replace-match "\\1\n\n>")) + + ;; Insert a blank line after a citation if there isn't one. + (goto-char (point-min)) + (while (re-search-forward "\\(^>.+\\)\n\\([^>]\\)" nil t) + (replace-match "\\1\n\n\\2"))) ;;