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