[PATCH] emacs: Remove over-eager regular expressions from notmuch-wash-tidy-citations.
authorDavid Edmondson <dme@dme.org>
Wed, 17 Nov 2010 13:32:33 +0000 (13:32 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:32 +0000 (09:37 -0800)
0d/6142ba8eefaea30686be40297735329f7f9c6a [new file with mode: 0644]

diff --git a/0d/6142ba8eefaea30686be40297735329f7f9c6a b/0d/6142ba8eefaea30686be40297735329f7f9c6a
new file mode 100644 (file)
index 0000000..bd23f16
--- /dev/null
@@ -0,0 +1,101 @@
+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 6BE2940DEF8\r
+       for <notmuch@notmuchmail.org>; Wed, 17 Nov 2010 05:35:32 -0800 (PST)\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, RCVD_IN_DNSWL_NONE=-0.0001] 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 gKTqf3mhqNXl for <notmuch@notmuchmail.org>;\r
+       Wed, 17 Nov 2010 05:35:19 -0800 (PST)\r
+Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
+ [74.125.82.45])       by olra.theworths.org (Postfix) with ESMTP id B85C140DEF5       for\r
+ <notmuch@notmuchmail.org>; Wed, 17 Nov 2010 05:35:18 -0800 (PST)\r
+Received: by wwb18 with SMTP id 18so144449wwb.2\r
+       for <notmuch@notmuchmail.org>; Wed, 17 Nov 2010 05:35:14 -0800 (PST)\r
+Received: by 10.227.138.147 with SMTP id a19mr9337926wbu.225.1290000912431;\r
+       Wed, 17 Nov 2010 05:35:12 -0800 (PST)\r
+Received: from ut.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com\r
+       [81.149.164.25])\r
+       by mx.google.com with ESMTPS id x59sm1148377weq.38.2010.11.17.05.35.11\r
+       (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
+       Wed, 17 Nov 2010 05:35:11 -0800 (PST)\r
+Received: by ut.hh.sledj.net (Postfix, from userid 1000)\r
+       id AC678594058; Wed, 17 Nov 2010 13:32:34 +0000 (GMT)\r
+From: David Edmondson <dme@dme.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: Remove over-eager regular expressions from\r
+       notmuch-wash-tidy-citations.\r
+Date: Wed, 17 Nov 2010 13:32:33 +0000\r
+Message-Id: <1290000753-20274-1-git-send-email-dme@dme.org>\r
+X-Mailer: git-send-email 1.7.2.3\r
+In-Reply-To: <87eialdot9.fsf@yoom.home.cworth.org>\r
+References: <87eialdot9.fsf@yoom.home.cworth.org>\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: Wed, 17 Nov 2010 13:35:32 -0000\r
+\r
+The removed expressions, which were used to ensure that citations were\r
+both preceded and followed by a blank line, were poorly implemented\r
+and caused a regexp stack overflow on messages more than a few\r
+thousand lines long.\r
+---\r
+\r
+Carl, I was not able to find a version of the regular expressions that\r
+didn't easily overflow. For now, this patch removes the problematic\r
+expressions and I'll look for a better solution.\r
+\r
+ emacs/notmuch-wash.el |   14 ++------------\r
+ 1 files changed, 2 insertions(+), 12 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el\r
+index cfcfb21..c4a7a41 100644\r
+--- a/emacs/notmuch-wash.el\r
++++ b/emacs/notmuch-wash.el\r
+@@ -190,7 +190,7 @@ is what to put on the button."\r
+ (defun notmuch-wash-tidy-citations (depth)\r
+   "Improve the display of cited regions of a message.\r
\r
+-Perform four transformations on the message body:\r
++Perform several transformations on the message body:\r
\r
+ - Remove lines of repeated citation leaders with no other\r
+   content,\r
+@@ -214,17 +214,7 @@ 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
+-\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
++    (replace-match "\\2")))\r
\r
+ ;;\r
\r
+-- \r
+1.7.2.3\r
+\r