From 91e2a4f3969d58143516b57428d16915a500c520 Mon Sep 17 00:00:00 2001 From: Richard Kim Date: Mon, 30 Jan 2023 12:41:05 -0800 Subject: [PATCH] Do not call org-agenda-files if org-mode is already loaded (#15908) --- core/core-spacemacs-buffer.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/core-spacemacs-buffer.el b/core/core-spacemacs-buffer.el index c88192ad9..67cf5696a 100644 --- a/core/core-spacemacs-buffer.el +++ b/core/core-spacemacs-buffer.el @@ -1294,9 +1294,12 @@ LIST-SIZE is specified in `dotspacemacs-startup-lists' for recent entries." org-agenda-files ;; but if it's a string, it must be file where the list ;; of agenda files are stored in that file and we have - ;;to load `org-agenda' to process the list. - (when (y-or-n-p "`org-agenda-files' is a string and \ -not a list. Load `org' and continue?") + ;; to load `org-agenda' to process the list. If org is + ;; already loaded, then we assume that the user has + ;; already called org-agenda-files. + (when (and (not (featurep 'org)) + (y-or-n-p "`org-agenda-files' is a string and \ +not a list. Load `org' and continue?")) (require 'org) (org-agenda-files)))))) (mapcar #'expand-file-name files)))