From 5cdc0068c878244882cec9af3bcd17cd8df2f9ec Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 11 Nov 2017 08:53:56 +0100 Subject: [PATCH] =?UTF-8?q?[Org]=20Remove=20empty=20strings=20from=20?= =?UTF-8?q?=E2=80=98org-agenda-files=E2=80=99=20before=20exporting=20diary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Empty strings in the variable ‘org-agenda-files’ cause exporting of the current buffer, because "" is treated by ‘org-agenda-files’ (the function). This results in ID properties generated in the current buffer, if this happens to be an org-mode buffer currently selected at the time of export. --- site-lisp/db-org.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index d078f6f..2ec54d7 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -814,8 +814,9 @@ This is done only if the value of this variable is not null." (message "`org-icalendar-combined-agenda-file’ not set, not exporting diary.") (progn (org-save-all-org-buffers) - (let ((org-agenda-files (list db/org-default-home-file - db/org-default-work-file)) + (let ((org-agenda-files (cl-remove-if #'string-empty-p + (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) @@ -825,7 +826,7 @@ This is done only if the value of this variable is not null." (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)) + (mapc #'find-file-noselect 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