Open dmgerman opened 3 weeks ago
Good observation - generally using any function from the files.el
is expensive and the hack was really to reduce the number of times any such function is needed to be called.
We should instead check from the right hand side - using the full path will just take a lot of space.
Use the entire path in the string match. No need to use the file system functions.
ideally i want this for the dir component
"/home/akash/roam/org/roam/refs/faq_git.org" should return "org/../refs"
"/home/akash/roam/refs/faq_git.org" should return "refs"
"/home/akash/roam/" should return "/"
exploring some options - the code needs to be extremely fast.
Also I will remove the variable org-roam-directory-name
we have all the ingredients because we already define the path in
org-roam-directory
this is what I would do:
The memory cost will be tiny, but the gains tremendous.
the value of this binding is the basename of org-roam (e.g. "roam")
the format +org-roam-node-display-template would fail is the that name exists in a previous directory:
assume the org-roam dir is "/Users/dmg/roam/org/roam/"
would return org instead of refs
use the full path instead.