Re: bug related to ical

Subject: Re: bug related to ical

Date: Wed, 26 Sep 2012 02:36:34 -0400

To: Robert Horn, notmuch@notmuchmail.org

Cc:

From: Aaron Ecay


The problem is in the ‘notmuch-show-insert-part-text/calendar’
function.  The call to ‘icalendar--convert-ical-to-diary’ does not
create a buffer visiting the temp file, so the call to ‘set-buffer’
fails.  The following patch fixes the problem.

The ical->diary conversion also doesn’t seem to work – the calendar
attachment shows up as an empty part – but I guess that’s a separate
issue (and not addressed by the patch).

I guess that part insertion handlers should be called inside a
‘condition-case’, so that an error inside of one can be recovered from,
and doesn’t entirely derail the insertion of the messages in the buffer.
(I actually made this patch because I was so annoyed that Olivier’s
buggy test attachment made it impossible for me to read Tomi’s reply.)

----- 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 -----

-- 
Aaron Ecay

Thread: