From cd063b4596bc06b973a35e72098acfca5037078c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 5 Jan 2026 20:10:36 -0500 Subject: [PATCH] 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. --- modules/lang/org/config.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index ec62c2e56..aa7ecec18 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -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