Modify org-roam-node-find to list nodes with a given filetag

I would like to have a behavior of org-roam-node-find more similar to org-roam V1, where if I filetag with “index” or “references” I can list only those specific nodes. I would appreciate any suggestion on how to accomplish that. Even just a high level description of how you would approach the problem.

Right now I use deft for this, but I would love to have it in org-roam find node function as well.

I think this is what you are looking for.

Part of readme: GitHub - org-roam/org-roam: Rudimentary Roam replica with Org-mode

  ;; 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)))

1 Like

As usual, you are right. I completely missed it. Thank you.

1 Like

@nobiot I don’t know if this is the right place to address this issue: I’m using Spacemacs, and if I have more than one tag Helm puts them in a new line, without exploiting all the empty space after the title. Is there a way to correct this behaviour? Here’s a screenshot:

I’m of course using the line of code presented in the readme and here. Thanks!

I think the problem is that you are not giving enough space to the tags. Try this:

(setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:30}" 'face 'org-tag)))

Thanks! Just as an extra thought, it could also be nice to have a way to dynamically arrange the placement of tags at the end of the line…

You might be able to achieve what you are suggesting with org-roam-node-display-template. See its documentation (excerpt below). You might like to try either * as the length specifier or not specifying one for tags.

“length” is an optional specifier and declares how many
characters can be used to display the value of the corresponding
field. If it’s not specified, the field will be inserted as is,
i.e. it won’t be aligned nor trimmed. If it’s an integer, the
field will be aligned accordingly and all the exceeding
characters will be trimmed out. If it’s “*”, the field will use
as many characters as possible and will be aligned accordingly.

for me, neither work. In both cases the tags are shown in a second line and the title occupies the whole first line. Instead with a large enough fixed field size, it works as expected. Maybe this happens because the title is already associated with *?

Maybe it’s how Helm deals with the lower-level built-in functions.