Skip to content

Commit

Permalink
Use file-truename to resolve symbolic links (jrblevin#81)
Browse files Browse the repository at this point in the history
A change initiated from
org-roam/org-roam#518 causes org-roam to
only store files by their resolved symbolic link value.

Testcase:

0. Create a symbolic link from '/path/to/real/roam/dir' to '/easy/path'
1. Configure org-roam to use '/easy/path'
2. Update the roam index, it will store files with
'/path/to/real/roam/dir'
3. point deft to '/easy/path'

  (setq deft-recursive t)
  (setq deft-use-filter-string-for-filename t)
  (setq deft-default-extension "org")
  (setq deft-directory "/easy/path/" )

4. open a file using deft.

The result will be that it is opened using /easy/path and roam will
not be able to resolve it. Using `fie-truename` will actually expand
the symbolic link, opening it with /path/to/real/roam/dir.

I can understand if this breaks other things, so perhaps a flag is
more appropriate. What do you think?
  • Loading branch information
credmp committed Jan 1, 2021
1 parent b7f3071 commit c4af448
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deft.el
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ name."
When OTHER is non-nil, open the file in another window. When
OTHER and SWITCH are both non-nil, switch to the other window.
FILE must be a relative or absolute path, with extension."
(let ((buffer (find-file-noselect file)))
(let ((buffer (find-file-noselect (file-truename file))))
(with-current-buffer buffer
(hack-local-variables)
(when deft-filter-regexp
Expand Down

0 comments on commit c4af448

Please sign in to comment.