Skip to content

(fix)org-roam-file-p: don't exclude org-roam-directory#2178

Merged
jethrokuan merged 2 commits intoorg-roam:mainfrom
toregilhk:main
May 2, 2022
Merged

(fix)org-roam-file-p: don't exclude org-roam-directory#2178
jethrokuan merged 2 commits intoorg-roam:mainfrom
toregilhk:main

Conversation

@toregilhk
Copy link
Copy Markdown
Contributor

@toregilhk toregilhk commented Apr 29, 2022

Don't exlude the org-roam-directory even if it matches
org-roam-file-exclude-regexp.

Should fix #2165.

This makes org-roam-file-p compare org-roam-file-exclude-regexp only with files and subdirectories within org-roam-directory, not the entire path.

Motivation for this change

When someone has an org-roam-directory that contains a (sub)string that is a part of org-roam-file-exclude-regexp, the entire org-roam directory is excluded, and all files removed from the database.

For example, when org-roam-directory is "~/data/org-roam/" and org-roam-file-exclude-regexp is "data/", the entire roam directory is exluded, and no files are found.

Don't exlude the org-roam-directory even if it matches
org-roam-file-exclude-regexp.

Should fix [org-roam#2165].
@toregilhk
Copy link
Copy Markdown
Contributor Author

toregilhk commented May 1, 2022

When I'm looking at it again, I think it would probably be better to have (file-relative-name path org-roam-directory) defined only one place, instead of having it being recalculated each time the dolist loops through. I'll try to edit the PR – though I am new to Gitbhub, my apologies if I'm doing it wrong.

Refactor PR org-roam#2178 to avoid recalculating (file-relative-name path
org-roam-directory) multiple timess.
@jethrokuan jethrokuan merged commit 5483e65 into org-roam:main May 2, 2022
@jethrokuan
Copy link
Copy Markdown
Member

Thanks!

jethrokuan added a commit that referenced this pull request May 16, 2022
jethrokuan added a commit that referenced this pull request May 16, 2022
hpfr added a commit to hpfr/system that referenced this pull request Jun 27, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

org-roam-node-find or org-roam-node-insert not showing nodes

2 participants