org-babel-execute-src-block: Force :dir according to live session
* lisp/ob-core.el (org-babel-execute-src-block): Force eval directory to follow live session buffer, if any. This is consistent with what we promise in the manual section "16.4 Environment of a Code Block">Choosing a working directory. Link: https://orgmode.org/list/87mssi8ht2.fsf@gmail.com
This commit is contained in:
parent
cbfe1354b3
commit
13d0f8bf8e
|
@ -842,6 +842,9 @@ guess will be made."
|
|||
(default-directory
|
||||
(cond
|
||||
((not dir) default-directory)
|
||||
((when-let ((session (cdr (assq :session params))))
|
||||
(when (org-babel-comint-buffer-livep session)
|
||||
(buffer-local-value 'default-directory (get-buffer session)))))
|
||||
((member mkdirp '("no" "nil" nil))
|
||||
(file-name-as-directory (expand-file-name dir)))
|
||||
(t
|
||||
|
|
Loading…
Reference in New Issue