[PATCH] emacs: More functionality for `notmuch-wash-tidy-citations'.
David Edmondson
dme at dme.org
Tue May 4 07:53:29 PDT 2010
Add:
- Insert a blank line before a citation if there isn't one,
- Insert a blank line after a citation if there isn't one.
---
Better than the last version.
emacs/notmuch-wash.el | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 46e1824..26a3f88 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -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")))
;;
--
1.7.0
More information about the notmuch
mailing list