Commit 86fc29f9 authored by Glenn Morris's avatar Glenn Morris
Browse files

From Ulf Jasper <ulf.jasper@web.de>:

(icalendar-version): Increase to 0.11.
(icalendar-export-file, icalendar-export-region)
(icalendar-import-file, icalendar-import-buffer): Add autoload cookies.
(icalendar--convert-ical-to-diary): Fix problem with DURATION.
parent ad708ae5
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
;;; Code: ;;; Code:
(defconst icalendar-version 0.10 (defconst icalendar-version 0.11
"Version number of icalendar.el.") "Version number of icalendar.el.")
;; ====================================================================== ;; ======================================================================
...@@ -415,8 +415,10 @@ FIXME: multiple comma-separated values should be allowed!" ...@@ -415,8 +415,10 @@ FIXME: multiple comma-separated values should be allowed!"
"Return ISODURATIONSTRING in format like `decode-time'. "Return ISODURATIONSTRING in format like `decode-time'.
Converts from ISO-8601 to Emacs representation. If ISODURATIONSTRING Converts from ISO-8601 to Emacs representation. If ISODURATIONSTRING
specifies UTC time (trailing letter Z) the decoded time is given in specifies UTC time (trailing letter Z) the decoded time is given in
the local time zone! FIXME: TZID-attributes are ignored....! FIXME: the local time zone!
multiple comma-separated values should be allowed!"
FIXME: TZID-attributes are ignored....!
FIXME: multiple comma-separated values should be allowed!"
(if isodurationstring (if isodurationstring
(save-match-data (save-match-data
(string-match (string-match
...@@ -672,7 +674,7 @@ would be \"pm\"." ...@@ -672,7 +674,7 @@ would be \"pm\"."
;; Export -- convert emacs-diary to icalendar ;; Export -- convert emacs-diary to icalendar
;; ====================================================================== ;; ======================================================================
;; User function ;;;###autoload
(defun icalendar-export-file (diary-filename ical-filename) (defun icalendar-export-file (diary-filename ical-filename)
"Export diary file to iCalendar format. "Export diary file to iCalendar format.
All diary entries in the file DIARY-FILENAME are converted to iCalendar All diary entries in the file DIARY-FILENAME are converted to iCalendar
...@@ -686,7 +688,7 @@ Finto iCalendar file: ") ...@@ -686,7 +688,7 @@ Finto iCalendar file: ")
(defalias 'icalendar-convert-diary-to-ical 'icalendar-export-file) (defalias 'icalendar-convert-diary-to-ical 'icalendar-export-file)
(make-obsolete 'icalendar-convert-diary-to-ical 'icalendar-export-file) (make-obsolete 'icalendar-convert-diary-to-ical 'icalendar-export-file)
;; User function ;;;###autoload
(defun icalendar-export-region (min max ical-filename) (defun icalendar-export-region (min max ical-filename)
"Export region in diary file to iCalendar format. "Export region in diary file to iCalendar format.
All diary entries in the region from MIN to MAX in the current buffer are All diary entries in the region from MIN to MAX in the current buffer are
...@@ -1112,7 +1114,7 @@ FExport diary data into iCalendar file: ") ...@@ -1112,7 +1114,7 @@ FExport diary data into iCalendar file: ")
;; Import -- convert icalendar to emacs-diary ;; Import -- convert icalendar to emacs-diary
;; ====================================================================== ;; ======================================================================
;; User function ;;;###autoload
(defun icalendar-import-file (ical-filename diary-filename (defun icalendar-import-file (ical-filename diary-filename
&optional non-marking) &optional non-marking)
"Import a iCalendar file and append to a diary file. "Import a iCalendar file and append to a diary file.
...@@ -1129,7 +1131,7 @@ p") ...@@ -1129,7 +1131,7 @@ p")
(set-buffer (find-file ical-filename)) (set-buffer (find-file ical-filename))
(icalendar-import-buffer diary-filename t non-marking))) (icalendar-import-buffer diary-filename t non-marking)))
;; User function ;;;###autoload
(defun icalendar-import-buffer (&optional diary-file do-not-ask (defun icalendar-import-buffer (&optional diary-file do-not-ask
non-marking) non-marking)
"Extract iCalendar events from current buffer. "Extract iCalendar events from current buffer.
...@@ -1423,10 +1425,7 @@ written into the buffer ` *icalendar-errors*'." ...@@ -1423,10 +1425,7 @@ written into the buffer ` *icalendar-errors*'."
((not (string= start-d end-d)) ((not (string= start-d end-d))
(icalendar--dmsg "non-recurring event") (icalendar--dmsg "non-recurring event")
(let ((ds (icalendar--datetime-to-diary-date dtstart)) (let ((ds (icalendar--datetime-to-diary-date dtstart))
(de (icalendar--datetime-to-diary-date (de (icalendar--datetime-to-diary-date dtend)))
(icalendar--decode-isodatetime
(icalendar--get-event-property e 'DTEND)
-1))))
(setq diary-string (setq diary-string
(format "%%%%(and (diary-block %s %s))" (format "%%%%(and (diary-block %s %s))"
ds de))) ds de)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment