Ihor Radchenko <yanta...@posteo.net> writes:

> The patch generally looks reasonable, although I am slightly concerned
> about interaction between :dir and session we describe in the manual:
>
>     When ‘dir’ is used with ‘session’, Org sets the starting directory
>     for a new session.  But Org does not alter the directory of an already
>     existing session.

I agree it's a problem -- if there are multiple blocks with the same
session but different ":dir" arguments, then a ":file" result of the
second block will be relative to the wrong :dir.

This seems like a longstanding problem, and affects both async and
non-async session blocks.

Ideally, ":dir" should be set at session level rather than block
level. This could be done via PROPERTY if there is only one session in
the file or subtree, but there isn't a mechanism for this more
generally.

Perhaps the simplest solution is to add a check to org-lint, requiring
all blocks with the same session to have the same :dir.

Reply via email to