diff --git a/org-roam-db.el b/org-roam-db.el index c9cdfc2..0a7e198 100644 --- a/org-roam-db.el +++ b/org-roam-db.el @@ -380,7 +380,7 @@ If FORCE, force a rebuild of the cache from scratch." (when force (delete-file (org-roam-db--get))) (org-roam-db--close) ;; Force a reconnect (org-roam-db) ;; To initialize the database, no-op if already initialized - (let* ((org-roam-files (seq-filter #'org-roam--org-roam-file-p (org-roam--list-all-files))) + (let* ((org-roam-files (org-roam--list-all-files)) (current-files (org-roam-db--get-current-files)) all-files all-links all-titles all-refs all-tags) (dolist (file org-roam-files) diff --git a/org-roam.el b/org-roam.el index ab0a2a2..13dcf3d 100644 --- a/org-roam.el +++ b/org-roam.el @@ -349,12 +349,15 @@ Use external shell commands if defined in `org-roam-list-files-commands'." `((consp symbolp) ,wrong-type)))) (when path (cl-return))) - (if path - (let ((fn (intern (concat "org-roam--list-files-" exe)))) - (unless (fboundp fn) (user-error "%s is not an implemented search method" fn)) - (mapcar #'ansi-color-filter-apply - (funcall fn path (format "\"%s\"" dir)))) - (org-roam--list-files-elisp dir)))) + (let* ((files (if path + (let ((fn (intern (concat "org-roam--list-files-" exe)))) + (unless (fboundp fn) (user-error "%s is not an implemented search method" fn)) + (funcall fn path (format "\"%s\"" dir))) + (org-roam--list-files-elisp dir))) + (files (mapcar #'ansi-color-filter-apply files)) ; strip ansi codes + (files (seq-filter #'org-roam--org-roam-file-p files)) + (files (mapcar #'expand-file-name files))) ; canonicalize names + files))) (defun org-roam--list-all-files () "Return a list of all Org-roam files within `org-roam-directory'."