Bastien <b...@gnu.org> writes: > Hi Eric, > > Eric Abrahamsen <e...@ericabrahamsen.net> writes: > >> I ended up writing a function on top of that that does find-or-create, >> so you can go to a certain outline path, creating and inserting >> (optionally in sorted order) the missing segments as you go. It was >> fairly difficult to get right, so perhaps it will be of use to someone, >> or appropriate for Worg or even Org proper: >> >> https://github.com/girzel/timesheet.el/blob/master/timesheet.el#L250 > > thanks for this - don't hesitate to reference it somewhere on Worg if > you think that's useful. > > If you think this should go to Org's core, please make a patch and > tell what's the difference with your patch and how to test it to make > sure we really understand the issue at stake. I don't have any issue > with the current implementation of `org-find-olp' so I cannot really > know.
It isn't a replacement for `org-find-olp'! It's just built on top of it. `org-find-olp' signals an error if the full path isn't found. My function looks for that error and creates the missing segments of the path. If `org-find-olp' is the equivalent of "cd" in the shell, this function is like "mkdir -p", plus the "cd" afterwards. It's nice for programmatically creating outline structures (ie can be used to create date trees and the like). I guess I think worg is sufficient -- it's a nice utility, but perhaps not necessary for core. Eric