Org-roam-capture prompts for file before prompting for template

Hello everyone,

I am not sure if this is a problem I am facing from my configuration or if it is an behaviour happening on purpose, but my org-roam-capture prompts for the file before prompting for the template it will use.

My evidence that this behavior is weird is that both org-capture and org-roam-dailies-capture-today (tomorrow,yesterday) prompts for the template before prompting for the file. For me that makes sense, since for some templates, the filename can be auto-generated.

What I am attempting to do is to mount a set of templates for specific periodic meetings, with some sort of pre-built schematics. I am trying to use org-roam instead of vanilla orgmode because I want to be able to find easily in which meeting we dealt with an specific subject. Backlinks would work like a charm if I could make the capture prompt before asking for the file.

Here is my org-roam-capture-templates. The relevant template here is “Planning”. I let others here because, if there is only one template, it doesn’t make sense to prompt for the template.

(setq org-roam-capture-templates
      '(("d" "default" plain (function org-roam--capture-get-point)
         "%?"
         :file-name "%(format-time-string \"%Y-%m-%d--%H-%M-%SZ--${slug}\" (current-time) t)"
         :head "#+title: ${title}\n"
         :unnarrowed t)
        ("n" "notes" plain (function org-roam--capture-get-point)
         "%?"
         :file-name "%(format-time-string \"./notes/%Y-%m-%d--%H-%M-%SZ--${slug}\" (current-time) t)"
         :head "#+title: ${title}\n"
         :unnarrowed t)

        ("p" "Planning" plain (function org-roam--capture-get-point)
         "%?"
         :file-name "meetings/%(format-time-string \"%Y-%m-%d--%H-%M-%SZ--ccc-planning\" (current-time) t)"
         :head "#+title: Planning\n\nChecklist:\n  - [ ] Feriados Verificados"
         )
        )
      )

My solution up to now is to use org-roam-dailies-capture-today. Configuring the dailies templates with a similar template, it prompts for the template previously to the file, file is not required by this template and it go straight for the writing. The problem with this approach is that it narrows to the body of the file, so I can’t use the structure that I wrote on the :head section.

Is it something weird I am facing here or the capture system is working as supposed?

I guess your confusion comes from the “File:” prompt. In fact what you enter here will be the title for the new note and then org-roam will create a filename according to what is in your template.

The other thing is that org-roam-capture and org-rom-find-file (C-c n f) behave the same way if you enter a new title that does not exists. What you see in the completion buffer is not filenames but titles and maybe tags. So if you enter a new title, then org-roam will use capture for that new file.

1 Like