fix(org): display warning if org-id-locations-{load,save} fails

This advice suppressed any file errors that org-id-locations-{load,save}
emitted to stop a hard error leaving Org in a broken state, but it also
hides the potentially useful error message itself! The middle ground is
to demote it to a warning, rather than suppress it completely.
This commit is contained in:
Henrik Lissner 2026-01-05 20:10:36 -05:00
parent b37bcb5f25
commit cd063b4596
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -1331,10 +1331,12 @@ between the two."
(setq org-effort-property "EFFORT")
;; HACK `org-id' doesn't check if `org-id-locations-file' exists or is
;; writeable before trying to read/write to it.
(defadvice! +org--fail-gracefully-a (&rest _)
:before-while '(org-id-locations-save org-id-locations-load)
(file-writable-p org-id-locations-file))
;; writeable before trying to read/write to it, potentially throwing a
;; file-error if it doesn't, which can leave Org in a broken state.
(defadvice! +org--fail-gracefully-a (fn &rest args)
:around '(org-id-locations-save org-id-locations-load)
(with-demoted-errors "org-id-locations: %s"
(apply fn args)))
(add-hook 'org-open-at-point-functions #'doom-set-jump-h)
;; HACK For functions that dodge `org-open-at-point-functions', like