aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Tomi Ollila <tomi.ollila@iki.fi>2012-11-08 14:07:59 +0200
committerGravatar David Bremner <bremner@debian.org>2012-11-25 11:06:12 -0400
commit60b5bff53d16a6e78bd989179076f7450d63c2e3 (patch)
tree5464182010aefd865f98a885ccf8b08435c1cb97 /emacs
parent3bd8494da0dfef973c1328b16cd848f144e3ac27 (diff)
notmuch-show.el: import calendar data with public function after CR removal
notmuch-get-bodypart-content provides raw data to its caller so that it can be stored verbatim whenever needed. icalendar functions expect Emacs to do EOL conversion for the data given to these. Therefore it the CRLF -> LF conversion is now done explicitly. The calls to private functions icalendar--convert-ical-to-diary and icalendar--read-element are replaced with call to public function icalendar-import-buffer.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch-show.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 5b3e70ee..ac7e644f 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -747,12 +747,14 @@ message at DEPTH in the current thread."
(notmuch-show-insert-part-header nth declared-type content-type (plist-get part :filename))
(insert (with-temp-buffer
(insert (notmuch-get-bodypart-content msg part nth notmuch-show-process-crypto))
+ ;; notmuch-get-bodypart-content provides "raw", non-converted
+ ;; data. Replace CRLF with LF before icalendar can use it.
(goto-char (point-min))
+ (while (re-search-forward "\r\n" nil t)
+ (replace-match "\n" nil nil))
(let ((file (make-temp-file "notmuch-ical"))
result)
- (icalendar--convert-ical-to-diary
- (icalendar--read-element nil nil)
- file t)
+ (icalendar-import-buffer file t)
(set-buffer (get-file-buffer file))
(setq result (buffer-substring (point-min) (point-max)))
(set-buffer-modified-p nil)