[PATCH 1/1] notmuch-show.el: extended icalendar unfolding with single CR removal
authorTomi Ollila <tomi.ollila@iki.fi>
Wed, 7 Nov 2012 15:54:36 +0000 (17:54 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:50:25 +0000 (09:50 -0800)
c9/e66097df4001c23ebd368a89348a5a7c01ab56 [new file with mode: 0644]

diff --git a/c9/e66097df4001c23ebd368a89348a5a7c01ab56 b/c9/e66097df4001c23ebd368a89348a5a7c01ab56
new file mode 100644 (file)
index 0000000..2876029
--- /dev/null
@@ -0,0 +1,90 @@
+Return-Path: <too@guru-group.fi>\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 068F9431FB6\r
+       for <notmuch@notmuchmail.org>; Wed,  7 Nov 2012 07:54:41 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\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 hKmX0YbpCboC for <notmuch@notmuchmail.org>;\r
+       Wed,  7 Nov 2012 07:54:39 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 51187431FAE\r
+       for <notmuch@notmuchmail.org>; Wed,  7 Nov 2012 07:54:39 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id BD5B010009D; Wed,  7 Nov 2012 17:54:38 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/1] notmuch-show.el: extended icalendar unfolding with single\r
+       CR removal\r
+Date: Wed,  7 Nov 2012 17:54:36 +0200\r
+Message-Id: <1352303676-21920-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.8.0\r
+Cc: tomi.ollila@iki.fi\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, 07 Nov 2012 15:54:41 -0000\r
+\r
+In case text/calendar content contained "folded" data (i.e. line\r
+continues to next line which begins with whitespace...\r
+\r
+or\r
+\r
+The text/calendar content is inside separate (application/octet-stream)\r
+content and the text/calendar entry there contains carriage returns...\r
+\r
+... The parsing of text/calendar content fails and next method of\r
+inserting the content is used (if any), usually providing less readable\r
+output.\r
+\r
+In this change the input calendar content is unfolded extending the\r
+unfolding code used in `icalendar--get-unfolded-buffer` with single CRs\r
+removal.\r
+---\r
+\r
+This obsoletes id:1349333712-18347-1-git-send-email-tomi.ollila@iki.fi\r
+Commit message is changed to reflect change in pushed patch \r
+id:1350826509-12119-1-git-send-email-tomi.ollila@iki.fi\r
+also, '\\r?' part in regexp was removed.\r
+\r
+Note the difference how id:87d31artti.fsf@inf-8657.int-evry.fr\r
+is inserted before and after this change.\r
+\r
+ emacs/notmuch-show.el | 5 +++++\r
+ 1 file changed, 5 insertions(+)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index d061367..d51345e 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -750,6 +750,11 @@ message at DEPTH in the current thread."\r
+           (goto-char (point-min))\r
+           (let ((file (make-temp-file "notmuch-ical"))\r
+                 result)\r
++            ;; `icalendar--get-unfolded-buffer' unfolds with "\r?\n[ \t]".\r
++            ;; This unfolding extends that by removing other CRs too.\r
++            (while (re-search-forward "\\(\r\\|\n[ \t]\\)" nil t)\r
++              (replace-match "" nil nil))\r
++            (goto-char (point-min))\r
+             (icalendar--convert-ical-to-diary\r
+              (icalendar--read-element nil nil)\r
+              file t)\r
+-- \r
+1.8.0\r
+\r