]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-show.el
notmuch-show.el: import calendar data with public function after CR removal
[notmuch] / emacs / notmuch-show.el
index 5b3e70eedb01bc28a7cf13b9b0142433c43f5b86..ac7e644f623da76bd784ce95a9d2cd994c466c28 100644 (file)
@@ -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)