Prevent org from saving org-agenda-files to customize

org-agenda-files is managed programmatically. Override
org-store-new-agenda-file-list to use setq instead of
customize-save-variable, and reset org-agenda-files to nil
before building it so stale customize values are ignored.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 00:01:46 -08:00
committed by Kat Huang
parent 749700fc6c
commit f45f84fa18

View File

@@ -421,6 +421,11 @@ that have a SCHEDULED date before today to the current date."
#+end_src
*** Agenda Files
#+begin_src emacs-lisp :tangle org-config-config.el
;; Prevent org from saving org-agenda-files to customize; managed programmatically.
(advice-add 'org-store-new-agenda-file-list :override
(lambda (files) (setq org-agenda-files files)))
(setq org-agenda-files nil)
(imalison:add-to-org-agenda-files
(nconc (list imalison:org-gtd-file imalison:org-calendar-file
imalison:org-inbox-file imalison:shared-org-gtd-file