org-roam/org-roam

org-roam-descendant-of-p interaction with symlinks

cvb100 opened this issue · 0 comments

Description

I was using a symlinked org-roam-directory (while setting org-roam-directory to the symlink's file-truename) and while visiting a file (using find-file) I saw I did not have completion inside org links (the relevant capf was not registered in completion-at-point-functions). Upon further investigation, I saw the in the relevant hook (find-file-hook) the function org-roam-db-autosync--setup-file-h was using org-roam-file-p to (ultimately) decide whether to register the relevant capf to completion-at-point-functions.

Steps to Reproduce

  1. Set org-roam-directory to the file-truename value of /path/to/symlink/
  2. Leaving the value of find-file-visit-truename unchanged (nil).
  3. Create a file under org-roam-directory.
  4. Visit the file.
  5. Evaluate (org-roam-descendant-of-p (buffer-file-name) org-roam-directory) or (org-roam-file-p).

Expected Results

The value should be t.

Actual Results

The value is nil.

It is worth to mention that when using (file-truename (buffer-file-name)) instead it evaluates to the expected result.

Environment

  • Emacs: GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
  • Framework: N/A
  • Org: Org mode version 9.6 (9.6-g554935 @ /home/user/.emacs.d/local/straight/build/org/)
  • Org-roam: v2.2.2-35-g938c602
  • sqlite-connector: sqlite