]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: More functionality for `notmuch-wash-tidy-citations'.
authorDavid Edmondson <dme@dme.org>
Tue, 4 May 2010 14:53:29 +0000 (15:53 +0100)
committerCarl Worth <cworth@cworth.org>
Fri, 4 Jun 2010 01:17:03 +0000 (18:17 -0700)
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.

emacs/notmuch-wash.el

index 46e182435ea24163aafbbf3b436baf7a963002ad..26a3f881163f8c6e4b50604faea685b54e66bc93 100644 (file)
@@ -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")))
 
 ;;