From 85ebb62ddafcf0c6a79d108138cb6ffdf0f5bdc3 Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Thu, 27 Sep 2012 02:36:34 +2000 Subject: [PATCH] Re: bug related to ical --- 21/941e85451db60a16fcbfd178b99cc3ec343a1b | 109 ++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 21/941e85451db60a16fcbfd178b99cc3ec343a1b diff --git a/21/941e85451db60a16fcbfd178b99cc3ec343a1b b/21/941e85451db60a16fcbfd178b99cc3ec343a1b new file mode 100644 index 000000000..a1a9dfdba --- /dev/null +++ b/21/941e85451db60a16fcbfd178b99cc3ec343a1b @@ -0,0 +1,109 @@ +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 7899F431FC4 + for ; Tue, 25 Sep 2012 23:36:39 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 CE7ttRLH2KIg for ; + Tue, 25 Sep 2012 23:36:39 -0700 (PDT) +Received: from mail-qa0-f46.google.com (mail-qa0-f46.google.com + [209.85.216.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id ECE47431FAF + for ; Tue, 25 Sep 2012 23:36:38 -0700 (PDT) +Received: by qadc26 with SMTP id c26so3014521qad.5 + for ; Tue, 25 Sep 2012 23:36:37 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:subject:in-reply-to:references:user-agent:date:message-id + :mime-version:content-type:content-transfer-encoding; + bh=LQ/zwrAUVVpvjd2m3STftlNq7fSU/oHXoV0mdTG5Ohc=; + b=f4DDAbGtsRNHxCdw8Ov2wHzNlAuTpx+gFUxYOd15YoT0BUdKLOzaSZittKzrcA/jjp + 6Tm+5XvCkzDo1fH3M1d8QjUEejc2FvV2QTJXdRPBESyCF9jJF5z/+Rnq98MBDOEmc4Jc + 5jBlutBV7i7Kc1euK3FBhPTJjAbqLnwuVTQ8ZpYKFHP64H5fnuGb4H1P2nvS266kFVZl + 8zo5b2KhMOAHHjI4ctkxCkwzeiMFFXfHNvuyRS/xKGnIzgNp1Bik5gxLyvBrKBzQjRcr + 7kCwVhoE7nN4N+krupxNx64ZzzG5M8iBZ9qZwwbcd9h4kBSTzay1qeu1It1oR1LJm+gz + SOlg== +Received: by 10.229.105.100 with SMTP id s36mr12780276qco.88.1348641397295; + Tue, 25 Sep 2012 23:36:37 -0700 (PDT) +Received: from localhost (c-68-80-94-73.hsd1.pa.comcast.net. [68.80.94.73]) + by mx.google.com with ESMTPS id k6sm3744152qac.0.2012.09.25.23.36.35 + (version=TLSv1/SSLv3 cipher=OTHER); + Tue, 25 Sep 2012 23:36:36 -0700 (PDT) +From: Aaron Ecay +To: Robert Horn , notmuch@notmuchmail.org +Subject: Re: bug related to ical +In-Reply-To: +References: +User-Agent: Notmuch/0.14+25~g0721c93 (http://notmuchmail.org) Emacs/24.2.50.4 + (x86_64-unknown-linux-gnu) +Date: Wed, 26 Sep 2012 02:36:34 -0400 +Message-ID: <87d319b899.fsf@gmail.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable +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, 26 Sep 2012 06:36:39 -0000 + +The problem is in the =E2=80=98notmuch-show-insert-part-text/calendar=E2=80= +=99 +function. The call to =E2=80=98icalendar--convert-ical-to-diary=E2=80=99 d= +oes not +create a buffer visiting the temp file, so the call to =E2=80=98set-buffer= +=E2=80=99 +fails. The following patch fixes the problem. + +The ical->diary conversion also doesn=E2=80=99t seem to work =E2=80=93 the = +calendar +attachment shows up as an empty part =E2=80=93 but I guess that=E2=80=99s a= + separate +issue (and not addressed by the patch). + +I guess that part insertion handlers should be called inside a +=E2=80=98condition-case=E2=80=99, so that an error inside of one can be rec= +overed from, +and doesn=E2=80=99t entirely derail the insertion of the messages in the bu= +ffer. +(I actually made this patch because I was so annoyed that Olivier=E2=80=99s +buggy test attachment made it impossible for me to read Tomi=E2=80=99s repl= +y.) + +----- cut here ----- + +diff --git i/emacs/notmuch-show.el w/emacs/notmuch-show.el +index ce5ea6f..4c89d7e 100644 +--- i/emacs/notmuch-show.el ++++ w/emacs/notmuch-show.el +@@ -746,7 +746,7 @@ message at DEPTH in the current thread." + (icalendar--convert-ical-to-diary + (icalendar--read-element nil nil) + file t) +- (set-buffer (get-file-buffer file)) ++ (set-buffer (find-file-noselect file)) + (setq result (buffer-substring (point-min) (point-max))) + (set-buffer-modified-p nil) + (kill-buffer (current-buffer)) + +----- cut here ----- + +--=20 +Aaron Ecay -- 2.26.2