From 640cee3b2669d300d2e59319404430a71d1dd015 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 6 Feb 2020 22:26:06 -0500 Subject: [PATCH] Fix no such file errors when quitting emacs Because org-id-locations-file cannot be read/written to. --- modules/lang/org/config.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 472ad0bc9..152322847 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -988,4 +988,10 @@ compelling reason, so..." org-id-locations-file (concat org-directory ".orgids") org-id-locations-file-relative t) + ;; 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-exists-p org-id-locations-file)) + (add-hook 'org-open-at-point-functions #'doom-set-jump-h))