I’m running org-roam in DOOM Emacs.
I’ve copied the generic config that can be found in the orgroam manual and am trying to change “/path/to/org-files/” to a specific filepath. However, everytime I run C-c n f it looks for nodes in “C:/User/username/org/”, which is the generic org path.
I’ve tried to unpin!, to use after!, etc. Either i’m not doing it right or i’m missing something.
Any help is appreciated.
Yes, I run doom sync after changes.
Regarding the configs:
In init.el:
(org +roam2)
In config.el:
(after! org-roam
:ensure t
:after org
:custom
(org-roam-directory (file-truename “~/org/roamtest”))
(org-roam-completion-everywhere t)
:bind ((“C-c n l” . org-roam-buffer-toggle)
(“C-c n f” . org-roam-node-find)
(“C-c n g” . org-roam-graph)
(“C-c n i” . org-roam-node-insert)
(“C-c n c” . org-roam-capture)
;; Dailies
(“C-c n j” . org-roam-dailies-capture-today))
:config
;; If you’re using a vertical completion framework, you might want a more informative completion interface
(setq org-roam-node-display-template (concat "${title:*} " (propertize “${tags:10}” 'face 'org-tag)))
(org-roam-db-autosync-mode)
;; If using org-roam-protocol
(require 'org-roam-protocol))
org-roam-directory is a variable defined in ‘org-roam.el’.
Its value is "c:/Users/user/org/roamtest/"
Original value was
"c:/Users/user/org-roam/"
Default path to Org-roam files.
All Org files, at any level of nesting, are considered part of the Org-roam.
You can customize this variable.
And yet when I C-c n f it still looks in C:/User/user/org/
yes it’s what I use for my org-directory which is set at the beginning of config.el and is part of the boilerplate of DOOM. When I change it to let’s say C:/Users/user/xyz an then do C-c n f I get an error that directory “C:/Users/user/xyz” does not exist.
So it seems that controls where C-c n f looks for org-roam, but why are they related and how do I fix it?
Does this “they” refer to org-directory and org-roam-directory? If so they are two different directories. If they appear to be “related”, that’s either how you set the value for each, or how Doom sets the value for each. I don’t use Doom any longer so I have no idea how it is done now. Perhaps the configuration of +roam2 does something like this?
Based on what I understood (and also what you explained), org-directory and org-roam-directory are two different things.
org-directory is for general org files
org-roam-directory is for orgroam nodes that get stored
I tested changing the file location with org-directory and org-roam-directory in doom and in my case it appears that org-directory is the function that tells C-c n f where to look for nodes. org-roam-directory seems to be ignored (potentially a doom specific issue?)
I could try and delete the database and build it again, but I couldn’t really figure out where the database gets stored and how I can look for it.
(setq org-roam-directory org-directory)
The above setq function could be happening behind the scenes, but I don’t know where.
The database is stored in the directory found in org-roam-db-location
But the database is not the problem. The files table stores the entire path where the files are located. That makes the database independent of the org-roam-directory contents.
I suspect that when you call the template, the variable is reset.
Use the function debug-on-variable-change. Do this after you have set the variable. If the variaible is changed, emacs will enter the debugger and you will know what is changing it.