babel: working directories and remote execution
This introduces a new header argument :dir. For the duration of source block execution, default-directory is set to the value of this header argument. Consequences include: - external interpreter processes run in that directory - new session processes run in that directory (but existing ones are unaffected) - relative paths for file output are relative to that directory The name of a directory on a remote machine may be specified with tramp syntax (/user@host:path), in which case the interpreter executable will be sought in tramp-remote-path, and if found will execute on the remote machine in the specified remote directory.
This commit is contained in:
parent
5f8a57ad48
commit
b3d5a1eb39
|
@ -42,6 +42,7 @@ called by `org-babel-execute-src-block'."
|
|||
(save-excursion
|
||||
(let* ((processed-params (org-babel-process-params params))
|
||||
(result-type (fourth processed-params))
|
||||
(ess-ask-for-ess-directory (not (cdr (assoc :dir params))))
|
||||
(session (org-babel-R-initiate-session (first processed-params)))
|
||||
(vars (second processed-params))
|
||||
(column-names-p (and (cdr (assoc :colnames params))
|
||||
|
|
|
@ -214,6 +214,9 @@ block."
|
|||
((member "value" result-params) 'value)
|
||||
(t 'value)))
|
||||
(cmd (intern (concat "org-babel-execute:" lang)))
|
||||
(dir (cdr (assoc :dir params)))
|
||||
(default-directory
|
||||
(or (and dir (if (string-match "/$" dir) dir (concat dir "/"))) default-directory))
|
||||
result)
|
||||
;; (message "params=%S" params) ;; debugging
|
||||
(unless (member lang org-babel-interpreters)
|
||||
|
|
Loading…
Reference in New Issue