Re: [FR] Accept nil outline path for file+olp+datetree org-capture-templates target

2025-05-11 Thread Ihor Radchenko
Kristoffer Balintona writes: >> Why not just using nil value as you initially suggested? > > Currently, both `org-capture-expand-headline' and > `org-capture-expand-olp' error when the expanded headline or olp, > respectively, return nil. I wanted to preserve that assuming there was a > good reas

Re: [FR] Accept nil outline path for file+olp+datetree org-capture-templates target

2025-05-11 Thread Kristoffer Balintona
On Sun, May 11 2025, Ihor Radchenko wrote: > Kristoffer Balintona writes: > >> Thank you for the help. I've attached a diff for a set of proposed >> changes. It has `org-capture-expand-olp' and >> `org-capture-expand-headline' return the symbol 'file in certain cases >> and has `org-capture-set-t

Re: [FR] Accept nil outline path for file+olp+datetree org-capture-templates target

2025-05-11 Thread Ihor Radchenko
Kristoffer Balintona writes: > Thank you for the help. I've attached a diff for a set of proposed > changes. It has `org-capture-expand-olp' and > `org-capture-expand-headline' return the symbol 'file in certain cases > and has `org-capture-set-target-location' treat those cases specially, > inse

Re: [FR] Accept nil outline path for file+olp+datetree org-capture-templates target

2025-05-09 Thread Kristoffer Balintona
Whoops, I forgot to include in my diff the small test I added. I've attached the full diff here. -- Best, Kristoffer diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 6d395406cf..f418e9fba9 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -205,24 +205,36 @@ (

Re: [FR] Accept nil outline path for file+olp+datetree org-capture-templates target

2025-05-09 Thread Kristoffer Balintona
On Thu, May 08 2025, Ihor Radchenko wrote: > Kristoffer Balintona writes: > >> Currently, `org-find-olp' assumes that it is being passed a file path + >> an outline path, but when the olp function returns nil, only a file path >> is returned, so `org-find-olp' ends up returning nil when >> `org-c

Re: [FR] Accept nil outline path for file+olp+datetree org-capture-templates target

2025-05-08 Thread Ihor Radchenko
Kristoffer Balintona writes: > Currently, `org-find-olp' assumes that it is being passed a file path + > an outline path, but when the olp function returns nil, only a file path > is returned, so `org-find-olp' ends up returning nil when > `org-capture-set-target-location' expects it to return a

Re: [FR] Accept nil outline path for file+olp+datetree org-capture-templates target

2025-05-07 Thread Kristoffer Balintona
On Mon, May 05 2025, Ihor Radchenko wrote: > Kristoffer Balintona writes: > >> On Mon, May 05 2025, Kristoffer Balintona wrote: > >> It would be nice if the top-level datetree in would simply >> be used if the function supplied for function-returning-list-of-strings >> returns nil. Alternatively

Re: [FR] Accept nil outline path for file+olp+datetree org-capture-templates target

2025-05-05 Thread Ihor Radchenko
Kristoffer Balintona writes: > On Mon, May 05 2025, Kristoffer Balintona wrote: > It would be nice if the top-level datetree in would simply > be used if the function supplied for function-returning-list-of-strings > returns nil. Alternatively, a target specification like > (file+olp+datetr

Re: [FR] Accept nil outline path for file+olp+datetree org-capture-templates target

2025-05-04 Thread Kristoffer Balintona
On Mon, May 05 2025, Kristoffer Balintona wrote: > It would be nice if the top-level datetree in would simply > be used if the function supplied for function-returning-list-of-strings > returns nil. Seems like the attached diff can accomplish this, though I'm not sure if it's the most elegant so

[FR] Accept nil outline path for file+olp+datetree org-capture-templates target

2025-05-04 Thread Kristoffer Balintona
Hi, In my org-capture-templates, I use a function to return the outline path of my datetree target: (file+olp+datetree function-returning-list-of-strings) However, in my desired workflow, sometimes the function I use for function-returning-list-of-strings returns an outline path of nil; in su