From 305c358ca9426673ca7122a8f470940b83fd641b Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sun, 29 Oct 2017 22:27:38 +0100 Subject: [PATCH] [Org] Fix misplaced require when exporting calendar --- site-lisp/db-org.el | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index 184ead7..727a767 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -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’. This is done only if the value of this variable is not null." (interactive) + (require 'ox-icalendar) (if (null org-icalendar-combined-agenda-file) (message "`org-icalendar-combined-agenda-file’ not set, not exporting diary.") - (progn - (require 'ox-icalendar) - (org-save-all-org-buffers) - (let ((org-agenda-files (list db/org-default-home-file - db/org-default-work-file)) - (org-agenda-new-buffers nil)) - ;; check whether we need to do something - (when (some (lambda (org-file) - (file-newer-than-file-p org-file - org-icalendar-combined-agenda-file)) - org-agenda-files) - (message "Exporting diary ...") - ;; open files manually to avoid polluting `org-agenda-new-buffers’; we don’t - ;; want these buffers to be closed after exporting - (mapc #'find-file-noselect (cl-remove-if #'null org-agenda-files)) - ;; 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 - (org-icalendar-combine-agenda-files) - (message "Exporting diary ... done.")))))) + (progn + (org-save-all-org-buffers) + (let ((org-agenda-files (list db/org-default-home-file + db/org-default-work-file)) + (org-agenda-new-buffers nil)) + ;; check whether we need to do something + (when (some (lambda (org-file) + (file-newer-than-file-p org-file + org-icalendar-combined-agenda-file)) + org-agenda-files) + (message "Exporting diary ...") + ;; open files manually to avoid polluting `org-agenda-new-buffers’; we don’t + ;; want these buffers to be closed after exporting + (mapc #'find-file-noselect (cl-remove-if #'null org-agenda-files)) + ;; 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 + (org-icalendar-combine-agenda-files) + (message "Exporting diary ... done.")))))) (defun db/ical-to-org (ical-file-name org-file-name category filetags) "Convert ICAL-FILE-NAME to ORG-FILE-NAME using ical2org.