Kristoffer Balintona <krisbalint...@gmail.com> writes:

> On Mon, May 05 2025, Kristoffer Balintona wrote:

> It would be nice if the top-level datetree in <file-spec> would simply
> be used if the function supplied for function-returning-list-of-strings
> returns nil. Alternatively, a target specification like
>     (file+olp+datetree function-returning-file-path-and-olp)
> or
>     (file+olp+datetree list-of-file-path-and-olp)
> would suffice.
> 
> Are such changes desirable? If they are, I could try preparing a patch,
> but looking at org-capture-set-target-location, I'm not sure how easy
> this would be easy.

That would be logical, I think.
Not just for file+olp+datetree, but then also for file+headline and file+olp.

> Seems like the attached diff can accomplish this, though I'm not sure if
> it's the most elegant solution.
> ...
> -                                         (apply #'org-capture-expand-olp 
> expanded-file-path outline-path))))
> ...
> +                (outline-path (if (functionp (car outline-path))
> +                                  (funcall (car outline-path))
> +                                outline-path))

We should keep outline path processing inside
`org-capture-expand-olp'. Duplicating logic is a bad idea.

Otherwise, something along those lines, yes.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
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>

Reply via email to