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 F2730431FB6 for ; Wed, 3 Oct 2012 23:55:11 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled 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 Ap6ptv8mRRkr for ; Wed, 3 Oct 2012 23:55:11 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 2CE60431FAE for ; Wed, 3 Oct 2012 23:55:11 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id 7772B100257; Thu, 4 Oct 2012 09:55:14 +0300 (EEST) From: Tomi Ollila To: notmuch@notmuchmail.org Subject: [PATCH 1/1] notmuch-show.el: extended icalendar unfolding with single CR removal Date: Thu, 4 Oct 2012 09:55:12 +0300 Message-Id: <1349333712-18347-1-git-send-email-tomi.ollila@iki.fi> X-Mailer: git-send-email 1.7.1 Cc: tomi.ollila@iki.fi 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: Thu, 04 Oct 2012 06:55:12 -0000 In case text/calendar content contained "folded" data (i.e. line continues to next line which begins with whitespace... or The text/calendar content is inside separate (application/octet-stream) content and the text/calendar entry there contains carriage returns... ... The parsing of text/calendar content failed so badly that in addition to just not showing the calendar content the rest of content handling of the thread aborted. In this change the input calendar content is unfolded extending the unfolding code used in `icalendar--get-unfolded-buffer` with single CRs removal. --- emacs/notmuch-show.el | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 86130ce..2a07e28 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -750,6 +750,11 @@ message at DEPTH in the current thread." (goto-char (point-min)) (let ((file (make-temp-file "notmuch-ical")) result) + ;; `icalendar--get-unfolded-buffer' unfolds with "\r?\n[ \t]". + ;; This unfolding extends that by removing other CRs too. + (while (re-search-forward "\\(\r\\|\r?\n[ \t]\\)" nil t) + (replace-match "" nil nil)) + (goto-char (point-min)) (icalendar--convert-ical-to-diary (icalendar--read-element nil nil) file t) -- 1.7.1