From f45f84fa188f21e5d950006e38078ef593acf1f4 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 24 Feb 2026 00:01:46 -0800 Subject: [PATCH] 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 --- dotfiles/emacs.d/org-config.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dotfiles/emacs.d/org-config.org b/dotfiles/emacs.d/org-config.org index b2259207..0921bca6 100644 --- a/dotfiles/emacs.d/org-config.org +++ b/dotfiles/emacs.d/org-config.org @@ -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