Enabling user config override for org-id-locations-file

The use case: if a user has their org directory stored in a synced
location (e.g. dropbox), this file is the same on all machines and is
almost always conflicted.

This change enables users to override this in the :init section of their
config (or otherwise before org loading) and that the
+org-init-org-directory-h hook will detect an override.
This commit is contained in:
Sam Whitlock 2021-02-07 13:16:06 +01:00
parent fd7073240c
commit cf523eb4dd
No known key found for this signature in database
GPG key ID: 4DC9F73CED3252EB

View file

@ -67,7 +67,8 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
(defun +org-init-org-directory-h () (defun +org-init-org-directory-h ()
(unless org-directory (unless org-directory
(setq-default org-directory "~/org")) (setq-default org-directory "~/org"))
(setq org-id-locations-file (expand-file-name ".orgids" org-directory))) (unless org-id-locations-file
(setq org-id-locations-file (expand-file-name ".orgids" org-directory))))
(defun +org-init-agenda-h () (defun +org-init-agenda-h ()
@ -1047,6 +1048,7 @@ compelling reason, so..."
;; Set to nil so we can detect user changes to them later (and fall back on ;; Set to nil so we can detect user changes to them later (and fall back on
;; defaults otherwise). ;; defaults otherwise).
(defvar org-directory nil) (defvar org-directory nil)
(defvar org-id-locations-file nil)
(defvar org-attach-id-dir nil) (defvar org-attach-id-dir nil)
(setq org-publish-timestamp-directory (concat doom-cache-dir "org-timestamps/") (setq org-publish-timestamp-directory (concat doom-cache-dir "org-timestamps/")