Fix duplicate files in org-roam db due to symlinks

This commit is contained in:
Henrik Lissner 2020-04-25 16:07:20 -04:00
parent e68e68755b
commit b93e3e41ed
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -53,6 +53,16 @@
(or (featurep! :completion helm +fuzzy)
(featurep! :completion ivy +fuzzy)))
;; HACK On first invocation, `org-roam-db-build-cache' builds the cache with a
;; list of unresolved file paths. If those are symlinks, you will later
;; end up with duplicate entries in your roam DB (e.g. after
;; `org-roam-capture'ing to an existing file).
;; TODO Report/PR this upstream!
(defadvice! +org-roam-resolve-symlinks-a (args)
:filter-args #'org-roam--list-files
(setcar args (file-truename (car args)))
args)
;; Normally, the org-roam buffer doesn't open until you explicitly call
;; `org-roam'. If `+org-roam-open-buffer-on-find-file' is non-nil, the
;; org-roam buffer will be opened for you when you use `org-roam-find-file'