diff options
author | David Edmondson <dme@dme.org> | 2010-05-04 15:53:29 +0100 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-06-03 18:17:03 -0700 |
commit | 5ebf5efcb0ed316139f9c44a10ddffc09637f596 (patch) | |
tree | 78943c30dcab03b7e1c886f82b94c9c92d2e1d27 /emacs/notmuch-wash.el | |
parent | 636925b40b20c60961660d14e0356f0970e97546 (diff) |
emacs: More functionality for `notmuch-wash-tidy-citations'.
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.
Diffstat (limited to 'emacs/notmuch-wash.el')
-rw-r--r-- | 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 46e18243..26a3f881 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"))) ;; |