1 Return-Path: <dme@dme.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 6BE2940DEF8
\r
6 for <notmuch@notmuchmail.org>; Wed, 17 Nov 2010 05:35:32 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5
\r
12 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id gKTqf3mhqNXl for <notmuch@notmuchmail.org>;
\r
16 Wed, 17 Nov 2010 05:35:19 -0800 (PST)
\r
17 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com
\r
18 [74.125.82.45]) by olra.theworths.org (Postfix) with ESMTP id B85C140DEF5 for
\r
19 <notmuch@notmuchmail.org>; Wed, 17 Nov 2010 05:35:18 -0800 (PST)
\r
20 Received: by wwb18 with SMTP id 18so144449wwb.2
\r
21 for <notmuch@notmuchmail.org>; Wed, 17 Nov 2010 05:35:14 -0800 (PST)
\r
22 Received: by 10.227.138.147 with SMTP id a19mr9337926wbu.225.1290000912431;
\r
23 Wed, 17 Nov 2010 05:35:12 -0800 (PST)
\r
24 Received: from ut.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com
\r
26 by mx.google.com with ESMTPS id x59sm1148377weq.38.2010.11.17.05.35.11
\r
27 (version=TLSv1/SSLv3 cipher=RC4-MD5);
\r
28 Wed, 17 Nov 2010 05:35:11 -0800 (PST)
\r
29 Received: by ut.hh.sledj.net (Postfix, from userid 1000)
\r
30 id AC678594058; Wed, 17 Nov 2010 13:32:34 +0000 (GMT)
\r
31 From: David Edmondson <dme@dme.org>
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH] emacs: Remove over-eager regular expressions from
\r
34 notmuch-wash-tidy-citations.
\r
35 Date: Wed, 17 Nov 2010 13:32:33 +0000
\r
36 Message-Id: <1290000753-20274-1-git-send-email-dme@dme.org>
\r
37 X-Mailer: git-send-email 1.7.2.3
\r
38 In-Reply-To: <87eialdot9.fsf@yoom.home.cworth.org>
\r
39 References: <87eialdot9.fsf@yoom.home.cworth.org>
\r
40 X-BeenThere: notmuch@notmuchmail.org
\r
41 X-Mailman-Version: 2.1.13
\r
43 List-Id: "Use and development of the notmuch mail system."
\r
44 <notmuch.notmuchmail.org>
\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
48 List-Post: <mailto:notmuch@notmuchmail.org>
\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
52 X-List-Received-Date: Wed, 17 Nov 2010 13:35:32 -0000
\r
54 The removed expressions, which were used to ensure that citations were
\r
55 both preceded and followed by a blank line, were poorly implemented
\r
56 and caused a regexp stack overflow on messages more than a few
\r
57 thousand lines long.
\r
60 Carl, I was not able to find a version of the regular expressions that
\r
61 didn't easily overflow. For now, this patch removes the problematic
\r
62 expressions and I'll look for a better solution.
\r
64 emacs/notmuch-wash.el | 14 ++------------
\r
65 1 files changed, 2 insertions(+), 12 deletions(-)
\r
67 diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
\r
68 index cfcfb21..c4a7a41 100644
\r
69 --- a/emacs/notmuch-wash.el
\r
70 +++ b/emacs/notmuch-wash.el
\r
71 @@ -190,7 +190,7 @@ is what to put on the button."
\r
72 (defun notmuch-wash-tidy-citations (depth)
\r
73 "Improve the display of cited regions of a message.
\r
75 -Perform four transformations on the message body:
\r
76 +Perform several transformations on the message body:
\r
78 - Remove lines of repeated citation leaders with no other
\r
80 @@ -214,17 +214,7 @@ Perform four transformations on the message body:
\r
82 (goto-char (point-min))
\r
83 (while (re-search-forward "\\(^>[> ]*\n\\)\\(^$\\|^[^>].*\\)" nil t)
\r
84 - (replace-match "\\2"))
\r
86 - ;; Insert a blank line before a citation if there isn't one.
\r
87 - (goto-char (point-min))
\r
88 - (while (re-search-forward "\\(^[^>]+\\)\n>" nil t)
\r
89 - (replace-match "\\1\n\n>"))
\r
91 - ;; Insert a blank line after a citation if there isn't one.
\r
92 - (goto-char (point-min))
\r
93 - (while (re-search-forward "\\(^>.+\\)\n\\([^>]\\)" nil t)
\r
94 - (replace-match "\\1\n\n\\2")))
\r
95 + (replace-match "\\2")))
\r