mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-01-17 06:31:32 -08:00
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:
parent
b37bcb5f25
commit
cd063b4596
1 changed files with 6 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue