From e33c14429824811c92e8c66f9c98acbff37aa7e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20H=C3=B6tzel?= Date: Wed, 15 Apr 2020 20:53:43 +0200 Subject: [PATCH] (bugfix): add workaround for undocumented `file-truename` behavior (#470) This prevents and error being generated when the agenda is displayed. Fixes #408 --- org-roam.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/org-roam.el b/org-roam.el index 3b7979e..846335e 100644 --- a/org-roam.el +++ b/org-roam.el @@ -163,12 +163,12 @@ Like `file-name-extension', but does not strip version number." (defun org-roam--org-roam-file-p (&optional file) "Return t if FILE is part of Org-roam system, nil otherwise. If FILE is not specified, use the current buffer's file-path." - (let ((path (or file + (if-let ((path (or file (buffer-file-name)))) - (and path - (org-roam--org-file-p path) - (f-descendant-of-p (file-truename path) - (file-truename org-roam-directory))))) + (save-match-data + (org-roam--org-file-p path) + (f-descendant-of-p (file-truename path) + (file-truename org-roam-directory))))) (defun org-roam--list-files (dir) "Return all Org-roam files located within DIR, at any nesting level.