On 02/10/2022 16:14, Ihor Radchenko wrote: > Ihor Radchenko writes: >> Max Nikulin writes: >> > The new version of the patch allows all but first function return nil. > See the attached. > > Let me know if there are any other objections. Ihor, sorry that I left your earlier questions with no response. I hope, the attached diff may illustrate my ideas better. I have not tried to run it though, so it can be full of stupid mistakes. I suggest to ignore nil values completely, but maybe I missed some use case. Actually I suspect the if the `org-attach-dir-from-id' function returned both first and existing directories, the code of callers would be clearer.