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 068F9431FB6 for ; Wed, 7 Nov 2012 07:54:41 -0800 (PST) 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 hKmX0YbpCboC for ; Wed, 7 Nov 2012 07:54:39 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 51187431FAE for ; Wed, 7 Nov 2012 07:54:39 -0800 (PST) Received: by guru.guru-group.fi (Postfix, from userid 501) id BD5B010009D; Wed, 7 Nov 2012 17:54:38 +0200 (EET) From: Tomi Ollila To: notmuch@notmuchmail.org Subject: [PATCH 1/1] notmuch-show.el: extended icalendar unfolding with single CR removal Date: Wed, 7 Nov 2012 17:54:36 +0200 Message-Id: <1352303676-21920-1-git-send-email-tomi.ollila@iki.fi> X-Mailer: git-send-email 1.8.0 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: Wed, 07 Nov 2012 15:54:41 -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 fails and next method of inserting the content is used (if any), usually providing less readable output. In this change the input calendar content is unfolded extending the unfolding code used in `icalendar--get-unfolded-buffer` with single CRs removal. --- This obsoletes id:1349333712-18347-1-git-send-email-tomi.ollila@iki.fi Commit message is changed to reflect change in pushed patch id:1350826509-12119-1-git-send-email-tomi.ollila@iki.fi also, '\\r?' part in regexp was removed. Note the difference how id:87d31artti.fsf@inf-8657.int-evry.fr is inserted before and after this change. emacs/notmuch-show.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index d061367..d51345e 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\\|\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.8.0