Kevin Foley <ke...@kevinjfoley.me> writes: > I have a capture template which utilizes %^g to prompt me for a tag to > add to a headline which already has a tag. An example to demonstrate > is: > > * TODO %? %^g :foo: > > If I call this template and give it "bar" when prompted for a tag, it > results in (where | is the cursor position): > > * TODO | :bar: :foo: > > And bar is recognized as a tag. > > I've been able to resolve this with the attached patch. However, > looking at the git history of that code it seems the intent might have > been to prevent some recursive resolution so I'm not sure if this breaks > that. > > I've realized I could also attach the %^g to :foo: tag in the template > and things work as expected but if that's the expectation then I think > it's worth mentioning in the docstring for org-capture-templates.
It sounds logical to me that every %-escape will be replaced with corresponding text. So, your toggle behaviour would actually be surprising for me. If you think that the existing docstring is confusing, could you provide a patch explaining what is not clear? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>