Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 93FBC4196F0 for ; Tue, 4 May 2010 06:44:38 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fk+NaJWd0E4i for ; Tue, 4 May 2010 06:44:37 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) by olra.theworths.org (Postfix) with ESMTP id B5922431FC1 for ; Tue, 4 May 2010 06:44:37 -0700 (PDT) Received: by wyf28 with SMTP id 28so2319220wyf.26 for ; Tue, 04 May 2010 06:44:36 -0700 (PDT) Received: by 10.227.129.139 with SMTP id o11mr1180680wbs.113.1272980676736; Tue, 04 May 2010 06:44:36 -0700 (PDT) Received: from ut.hh.sledj.net (gmp-ea-fw-1.sun.com [192.18.1.36]) by mx.google.com with ESMTPS id u8sm49866826wbc.5.2010.05.04.06.44.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 May 2010 06:44:35 -0700 (PDT) Received: by ut.hh.sledj.net (Postfix, from userid 1000) id 4056D594121; Tue, 4 May 2010 14:45:15 +0100 (BST) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH] emacs: More functionality for `notmuch-wash-tidy-citations'. Date: Tue, 4 May 2010 14:45:14 +0100 Message-Id: <1272980714-11315-1-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 May 2010 13:44:38 -0000 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 | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index 46e1824..5347ddc 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