From 75d4046820957401a2561e53dc935ad27e2b52ea Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 Sep 2023 23:27:16 +0200 Subject: [PATCH] fix(lib): doom/reload-docs: `org-id-get' warnings Prevents '`org-id-get' expects a file-visiting buffer' warnings in some in-repo org files. --- lisp/lib/docs.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/lib/docs.el b/lisp/lib/docs.el index 2052f78f3..3a1dcb402 100644 --- a/lisp/lib/docs.el +++ b/lisp/lib/docs.el @@ -467,10 +467,10 @@ This primes `org-mode' for reading." (org-id-locations doom-docs--id-locations) (org-id-files doom-docs--id-files)) (doom/reload-docs) - (let ((id (org-id-new))) - (org-id-add-location - id (buffer-file-name (buffer-base-buffer))) - id))) + (when-let (fname (buffer-file-name (buffer-base-buffer))) + (let ((id (org-id-new))) + (org-id-add-location id fname) + id)))) ;;;###autoload (define-derived-mode doom-docs-org-mode org-mode "Doom Docs"