1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-21 06:55:35 +00:00

org-babel-shell-initialize: Define session API backend for all the shells

* lisp/ob-shell.el (org-babel-shell-initialize): Define
org-babel-prep-session:<shell-name> and
org-babel-<shell-name>-initiate-session functions.

Without this, `org-babel-switch-to-session' does not work for ob-shell
blocks.
This commit is contained in:
Ihor Radchenko 2024-06-05 11:35:49 +02:00
parent 7393803716
commit 5b366a731b
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B

View File

@ -85,6 +85,24 @@ is modified outside the Customize interface."
(shell-file-name name))
(org-babel-execute:shell body params))))
(put fname 'definition-name 'org-babel-shell-initialize))
(let ((fname (intern (concat "org-babel-prep-session:" name))))
(defalias fname
(lambda (session params)
(:documentation
(format "Prepare %s SESSION according to the header arguments specified in PARAMS." name))
(let ((explicit-shell-file-name name)
(shell-file-name name))
(org-babel-prep-session:shell session params))))
(put fname 'definition-name 'org-babel-shell-initialize))
(let ((fname (intern (format "org-babel-%s-initiate-session" name))))
(defalias fname
(lambda (session _params)
(:documentation
(format "Initiate %s session named SESSION." name))
(let ((explicit-shell-file-name name)
(shell-file-name name))
(org-babel-sh-initiate-session session))))
(put fname 'definition-name 'org-babel-shell-initialize))
(defalias (intern (concat "org-babel-variable-assignments:" name))
#'org-babel-variable-assignments:shell
(format "Return list of %s statements assigning to the block's \