From 25ec60401980b4b3929242875ce1d95d1d199ae1 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 9 Feb 2019 17:39:12 +0100 Subject: [PATCH] =?UTF-8?q?[Org]=20Change=20the=20way=20=E2=80=98org-agend?= =?UTF-8?q?a-files=E2=80=99=20is=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Up to now, ‘org-agenda-files’ only consisted of the four variables customizable in init.el, namly ‘db/org-default-work-file’, ‘db/org-default-home-file’, ‘db/org-default-notes-file’, and ‘db/org-default-refile-file’. However, this meant that no *additional* agenda files were possible, like including multiple files for notes. This should not be the case any longer. --- site-lisp/db-org.el | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index 1d9bfb8..1051276 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -13,18 +13,14 @@ ;; For customization of default org agenda files (defun db/update-org-agenda-files (symbol value) - "Set SYMBOL to VALUE and update `org-agenda-files’ afterwards." + "Set SYMBOL to VALUE and update `org-agenda-files’ afterwards. +Remove the old value of SYMBOL from `org-agenda-files’ and add +the new one instead." + (require 'org) + (when (boundp symbol) + (setq org-agenda-files (cl-delete (symbol-value symbol) org-agenda-files))) (set-default symbol value) - (setq org-agenda-files (cl-remove-duplicates - (cl-remove-if #'string-empty-p - (mapcar (lambda (symbol) - (when (boundp symbol) - (symbol-value symbol))) - '(db/org-default-home-file - db/org-default-work-file - db/org-default-refile-file - db/org-default-notes-file))) - :test #'cl-equalp))) + (push value org-agenda-files)) (defun db/org-agenda-list-deadlines (&optional match) ;; XXX org-agenda-later does not work, fix this