[Org] Remove old diary file before exporting new one

This commit is contained in:
Daniel - 2018-10-07 19:19:33 +02:00
parent 356bc7e044
commit 93fc26e426
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 3 additions and 0 deletions

View File

@ -845,6 +845,9 @@ This is done only if the value of this variable is not null."
;; actual export; calls `org-release-buffers and may thus close
;; buffers we want to keep around … which is why we set
;; `org-agenda-new-buffers to nil
(when (file-exists-p org-icalendar-combined-agenda-file)
(delete-file org-icalendar-combined-agenda-file)
(sit-for 3))
(org-icalendar-combine-agenda-files)
(message "Exporting diary ... done.")))))))