Merge pull request #44 from jethrokuan/fix/symlinks-handling

Fix symlinks handling
This commit is contained in:
Jethro Kuan
2020-02-10 16:33:19 +08:00
committed by GitHub

View File

@@ -136,18 +136,20 @@ it will return the title by loading the file."
(defun org-roam--find-all-files () (defun org-roam--find-all-files ()
"Return all org-roam files." "Return all org-roam files."
(org-roam--find-files org-roam-directory)) (org-roam--find-files (file-truename org-roam-directory)))
(defun org-roam--get-file-path (id &optional absolute) (defun org-roam--get-file-path (id &optional absolute)
"Convert identifier `ID' to file path. "Convert identifier `ID' to file path.
If `ABSOLUTE', return the absolute file-path. Else, return the relative file-path." If `ABSOLUTE', return the absolute file-path. Else, return the relative file-path."
(let ((absolute-file-path (expand-file-name (let ((absolute-file-path (file-truename
(expand-file-name
(concat id ".org") (concat id ".org")
(file-truename org-roam-directory)))) org-roam-directory))))
(if absolute (if absolute
absolute-file-path absolute-file-path
(file-relative-name absolute-file-path org-roam-directory)))) (file-relative-name absolute-file-path
(file-truename org-roam-directory)))))
(defun org-roam--get-id (file-path) (defun org-roam--get-id (file-path)
"Convert `FILE-PATH' to the org-roam id." "Convert `FILE-PATH' to the org-roam id."