Create headline if it doesn't already exist in target
Does this feature exist in Emacs orgmode core?
No
Orgmode link
I'm not sure if this is the current behavior in emacs, but I think it would be pretty cool if the capture window offered to create a headline that doesn't yet exist in the target file. An example:
f = {
description = "repo heading",
template = "* %?",
headline = vim.fn.fnamemodify(vim.fn.getcwd(), ":t"),
target = org_agenda_path("repos.org"),
},
on a new repo, currently won't let me confirm the capture since the repo headline doesn't exist in the file.
The relevant section in the code that I found was here.
Feature value
No response
Additional context
No response
I ran frequently into this problem and it is one of the reasons, why I don't use captions as often as I would like - because it needs a very hard-wired ecosystem of existing files and headlines. So I would appreciate, if we could implement this.
Since it doesn't exist in Emacs Orgmode, @kristijanhusak would you be open having an implementation directly in the plugin or should we extend the API to allow implementing this as an extension by the user or another plugin.
For the latter we would need to have some kind of hook for a callback, which by default does the error handling for a missing headline and then could be overridden via config.