X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-show.el;h=489e32c8bcafc1a9a3ef467ff45c8f098884f83d;hb=7611a72be2cf6488c4d57ac0545469ff7ae89760;hp=ac7e644f623da76bd784ce95a9d2cd994c466c28;hpb=60b5bff53d16a6e78bd989179076f7450d63c2e3;p=notmuch diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index ac7e644f..489e32c8 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -203,9 +203,10 @@ For example, if you wanted to remove an \"unread\" tag and add a (let ((id (notmuch-show-get-message-id))) (let ((buf (generate-new-buffer (concat "*notmuch-msg-" id "*")))) (with-current-buffer buf - (call-process notmuch-command nil t nil "show" "--format=raw" id) - ,@body) - (kill-buffer buf))))) + (let ((coding-system-for-read 'no-conversion)) + (call-process notmuch-command nil t nil "show" "--format=raw" id) + ,@body) + (kill-buffer buf)))))) (defun notmuch-show-turn-on-visual-line-mode () "Enable Visual Line mode." @@ -754,12 +755,15 @@ message at DEPTH in the current thread." (replace-match "\n" nil nil)) (let ((file (make-temp-file "notmuch-ical")) result) - (icalendar-import-buffer file t) - (set-buffer (get-file-buffer file)) - (setq result (buffer-substring (point-min) (point-max))) - (set-buffer-modified-p nil) - (kill-buffer (current-buffer)) - (delete-file file) + (unwind-protect + (progn + (unless (icalendar-import-buffer file t) + (error "Icalendar import error. See *icalendar-errors* for more information")) + (set-buffer (get-file-buffer file)) + (setq result (buffer-substring (point-min) (point-max))) + (set-buffer-modified-p nil) + (kill-buffer (current-buffer))) + (delete-file file)) result))) t)