[PATCH] emacs: More functionality for `notmuch-wash-tidy-citations'.
authorDavid Edmondson <dme@dme.org>
Tue, 4 May 2010 14:53:29 +0000 (15:53 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:01 +0000 (09:37 -0800)
82/56b9de530d86e6ea72972c3f09b84633f7f7bd [new file with mode: 0644]

diff --git a/82/56b9de530d86e6ea72972c3f09b84633f7f7bd b/82/56b9de530d86e6ea72972c3f09b84633f7f7bd
new file mode 100644 (file)
index 0000000..a5207a3
--- /dev/null
@@ -0,0 +1,87 @@
+Return-Path: <dme@dme.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9943A4196F0\r
+       for <notmuch@notmuchmail.org>; Tue,  4 May 2010 07:52:53 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.9\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
+       tests=[BAYES_00=-1.9] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id ps2llohMKjuQ for <notmuch@notmuchmail.org>;\r
+       Tue,  4 May 2010 07:52:53 -0700 (PDT)\r
+Received: from mail-ww0-f53.google.com (mail-ww0-f53.google.com\r
+ [74.125.82.53])       by olra.theworths.org (Postfix) with ESMTP id C4381431FC1       for\r
+ <notmuch@notmuchmail.org>; Tue,  4 May 2010 07:52:52 -0700 (PDT)\r
+Received: by wwg30 with SMTP id 30so42986wwg.26\r
+       for <notmuch@notmuchmail.org>; Tue, 04 May 2010 07:52:52 -0700 (PDT)\r
+Received: by 10.227.154.19 with SMTP id m19mr1504203wbw.12.1272984771820;\r
+       Tue, 04 May 2010 07:52:51 -0700 (PDT)\r
+Received: from ut.hh.sledj.net (gmp-ea-fw-1.sun.com [192.18.1.36])\r
+       by mx.google.com with ESMTPS id z33sm29172669wbd.13.2010.05.04.07.52.50\r
+       (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
+       Tue, 04 May 2010 07:52:50 -0700 (PDT)\r
+Received: by ut.hh.sledj.net (Postfix, from userid 1000)\r
+       id 81ECC594121; Tue,  4 May 2010 15:53:30 +0100 (BST)\r
+From: David Edmondson <dme@dme.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: More functionality for `notmuch-wash-tidy-citations'.\r
+Date: Tue,  4 May 2010 15:53:29 +0100\r
+Message-Id: <1272984809-13086-1-git-send-email-dme@dme.org>\r
+X-Mailer: git-send-email 1.7.0\r
+In-Reply-To: <878w7zg3xf.fsf@ut.hh.sledj.net>\r
+References: <878w7zg3xf.fsf@ut.hh.sledj.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 04 May 2010 14:52:53 -0000\r
+\r
+Add:\r
+- Insert a blank line before a citation if there isn't one,\r
+- Insert a blank line after a citation if there isn't one.\r
+---\r
+\r
+Better than the last version.\r
+\r
+ emacs/notmuch-wash.el |   12 +++++++++++-\r
+ 1 files changed, 11 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el\r
+index 46e1824..26a3f88 100644\r
+--- a/emacs/notmuch-wash.el\r
++++ b/emacs/notmuch-wash.el\r
+@@ -214,7 +214,17 @@ Perform four transformations on the message body:\r
+   ;; text.\r
+   (goto-char (point-min))\r
+   (while (re-search-forward "\\(^>[> ]*\n\\)\\(^$\\|^[^>].*\\)" nil t)\r
+-    (replace-match "\\2")))\r
++    (replace-match "\\2"))\r
++\r
++  ;; Insert a blank line before a citation if there isn't one.\r
++  (goto-char (point-min))\r
++  (while (re-search-forward "\\(^[^>]+\\)\n>" nil t)\r
++    (replace-match "\\1\n\n>"))\r
++\r
++  ;; Insert a blank line after a citation if there isn't one.\r
++  (goto-char (point-min))\r
++  (while (re-search-forward "\\(^>.+\\)\n\\([^>]\\)" nil t)\r
++    (replace-match "\\1\n\n\\2")))\r
\r
+ ;;\r
\r
+-- \r
+1.7.0\r
+\r