Function: diary-icalendar-export-file
diary-icalendar-export-file is an autoloaded, interactive and
byte-compiled function defined in diary-icalendar.el.gz.
Signature
(diary-icalendar-export-file DIARY-FILENAME FILENAME &optional ERASE)
Documentation
Export DIARY-FILENAME to iCalendar format in FILENAME.
The diary entries in DIARY-FILENAME will be exported to iCalendar format and the resulting calendar will be saved to FILENAME.
If FILENAME exists and is not empty, this function asks whether to erase its contents first. If ERASE is non-nil, the contents of FILENAME will always be erased without asking. Otherwise the exported data will be appended to the end of FILENAME.
The export depends on a number of user-customizable variables. Before
running this command for the first time, you may especially wish to
check the values of:
diary-file
diary-date-forms
calendar-date-style
as well as variables in the customization group diary-icalendar-export.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/diary-icalendar.el.gz
;;;###autoload
(defun di:export-file (diary-filename filename &optional erase)
"Export DIARY-FILENAME to iCalendar format in FILENAME.
The diary entries in DIARY-FILENAME will be exported to iCalendar format
and the resulting calendar will be saved to FILENAME.
If FILENAME exists and is not empty, this function asks whether to erase
its contents first. If ERASE is non-nil, the contents of FILENAME will
always be erased without asking. Otherwise the exported data will be
appended to the end of FILENAME.
The export depends on a number of user-customizable variables. Before
running this command for the first time, you may especially wish to
check the values of:
`diary-file'
`diary-date-forms'
`calendar-date-style'
as well as variables in the customization group `diary-icalendar-export'."
(interactive (list
(read-file-name "Diary file: "
(when diary-file (file-name-directory diary-file))
(cons diary-file diary-included-files)
'confirm)
(read-file-name "iCalendar file: "
(when diary-file (file-name-directory diary-file))
(when diary-file
(concat
(file-name-sans-extension diary-file)
".ics")))))
(when (and (null erase)
(file-exists-p filename)
(< 0 (file-attribute-size (file-attributes filename)))
(y-or-n-p (format "Delete existing contents of %s?" filename)))
(setq erase t))
(with-current-buffer (find-file-noselect diary-filename)
(di:export-region (point-min) (point-max) filename erase)))