Hi all, I have what I hope is a relatively simple troubleshooting question (cross-posted on the Slack channel as well) about the use of the “Initial Content (%i)” org capture expansion in org-roam-capture.
Desired Behavior
I would like to highlight text, call org-roam-find-file, select the desired template (in the case of below “Test”), and then get a capture buffer to edit that is pre-populated with the selected text. I’ve simplified the below configuration from the full template I’d like to use to minimize factors that might be messing it up.
Currently Observed Behavior
I select the text, call org-roam-find-file, select the “Test” template, and then I get a capture buffer that shows the text that was highlighted the first time I selected text and called this template after a restart of emacs.
Already-Attempted Troubleshooting
So, the first time I try this after restarting emacs, it works as expected, but every time after it re-uses the text that was selected the first time I used the template.
First, I simplified the template as much as possible to make sure no other formatting or expansions were interfering. Then I replaced the “initial content (%i)” expansion with the “head of the kill-ring (%c)” expansion - this works as expected (capture template opens with the last text killed or copied). I’ve tried to see whether it matters if I abort or accept the capture template (it seems not to), whether it matters which buffer I call it from (it seems not to), and whether using another template in between uses of this template makes a difference (it seems not to).
Current Configuration
(setq org-roam-capture-templates
'(("t" "Test" plain (function org-roam-capture--get-point)
"%i%?"
:file-name "Roam_Notes/%<%Y%m%d%H%M%S>-${slug}"
:head "#+title: ${title}\n#+roam_alias: \n#+roam_tags: \n\n"
:unnarrowed t)))
Question
So, does anyone have an idea 1) why the %i is getting stuck on the text selected when I first call the capture template, and more importantly 2) any idea how to change it to behave as expected?
Thanks very much to anyone with thoughts!