--- /dev/null
+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 F2730431FB6\r
+ for <notmuch@notmuchmail.org>; Wed, 3 Oct 2012 23:55:11 -0700 (PDT)\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 Ap6ptv8mRRkr for <notmuch@notmuchmail.org>;\r
+ Wed, 3 Oct 2012 23:55:11 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 2CE60431FAE\r
+ for <notmuch@notmuchmail.org>; Wed, 3 Oct 2012 23:55:11 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id 7772B100257; Thu, 4 Oct 2012 09:55:14 +0300 (EEST)\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: Thu, 4 Oct 2012 09:55:12 +0300\r
+Message-Id: <1349333712-18347-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.7.1\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: Thu, 04 Oct 2012 06:55:12 -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 failed so badly that in\r
+addition to just not showing the calendar content the rest of content\r
+handling of the thread aborted.\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
+ emacs/notmuch-show.el | 5 +++++\r
+ 1 files changed, 5 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 86130ce..2a07e28 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\\|\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.7.1\r
+\r