[Org] Change the way ‘org-agenda-files’ is set

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.
This commit is contained in:
Daniel - 2019-02-09 17:39:12 +01:00
parent dcf656c2ed
commit 25ec604019
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 7 additions and 11 deletions

View File

@ -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