[Org] Fix misplaced require when exporting calendar
This commit is contained in:
parent
ff607e439f
commit
305c358ca9
|
@ -804,28 +804,28 @@ _y_: ?y? year _q_: quit _L__l__c_: ?l?
|
||||||
"Export diary.org as ics file to the current value of `org-icalendar-combined-agenda-file’.
|
"Export diary.org as ics file to the current value of `org-icalendar-combined-agenda-file’.
|
||||||
This is done only if the value of this variable is not null."
|
This is done only if the value of this variable is not null."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(require 'ox-icalendar)
|
||||||
(if (null org-icalendar-combined-agenda-file)
|
(if (null org-icalendar-combined-agenda-file)
|
||||||
(message "`org-icalendar-combined-agenda-file’ not set, not exporting diary.")
|
(message "`org-icalendar-combined-agenda-file’ not set, not exporting diary.")
|
||||||
(progn
|
(progn
|
||||||
(require 'ox-icalendar)
|
(org-save-all-org-buffers)
|
||||||
(org-save-all-org-buffers)
|
(let ((org-agenda-files (list db/org-default-home-file
|
||||||
(let ((org-agenda-files (list db/org-default-home-file
|
db/org-default-work-file))
|
||||||
db/org-default-work-file))
|
(org-agenda-new-buffers nil))
|
||||||
(org-agenda-new-buffers nil))
|
;; check whether we need to do something
|
||||||
;; check whether we need to do something
|
(when (some (lambda (org-file)
|
||||||
(when (some (lambda (org-file)
|
(file-newer-than-file-p org-file
|
||||||
(file-newer-than-file-p org-file
|
org-icalendar-combined-agenda-file))
|
||||||
org-icalendar-combined-agenda-file))
|
org-agenda-files)
|
||||||
org-agenda-files)
|
(message "Exporting diary ...")
|
||||||
(message "Exporting diary ...")
|
;; open files manually to avoid polluting `org-agenda-new-buffers’; we don’t
|
||||||
;; open files manually to avoid polluting `org-agenda-new-buffers’; we don’t
|
;; want these buffers to be closed after exporting
|
||||||
;; want these buffers to be closed after exporting
|
(mapc #'find-file-noselect (cl-remove-if #'null org-agenda-files))
|
||||||
(mapc #'find-file-noselect (cl-remove-if #'null org-agenda-files))
|
;; actual export; calls `org-release-buffers’ and may thus close buffers
|
||||||
;; 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’
|
||||||
;; we want to keep around … which is why we set `org-agenda-new-buffers’
|
;; to nil
|
||||||
;; to nil
|
(org-icalendar-combine-agenda-files)
|
||||||
(org-icalendar-combine-agenda-files)
|
(message "Exporting diary ... done."))))))
|
||||||
(message "Exporting diary ... done."))))))
|
|
||||||
|
|
||||||
(defun db/ical-to-org (ical-file-name org-file-name category filetags)
|
(defun db/ical-to-org (ical-file-name org-file-name category filetags)
|
||||||
"Convert ICAL-FILE-NAME to ORG-FILE-NAME using ical2org.
|
"Convert ICAL-FILE-NAME to ORG-FILE-NAME using ical2org.
|
||||||
|
|
Loading…
Reference in New Issue