mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 02:02:52 +00:00
lisp/ob-shell.el: Fix sessions for generic "shell" blocks
* lisp/ob-shell.el (org-babel-prompt-command): Remove variable. (org-babel-sh-initiate-session): Set prompt according to `shell-file-name' - either the value set in let-binding provided by `org-babel-shell-initialize' or using the default Emacs value of `shell-file-name'. (org-babel-shell-initialize): Do not set `org-babel-prompt-command'. Only let-bind `shell-file-name' according to shell variant in src block.
This commit is contained in:
parent
5ed2763b15
commit
f5467b53ec
|
@ -67,8 +67,6 @@ that will be called with a single additional argument: prompt string.
|
||||||
The fallback association template is defined in (t . \"template\")
|
The fallback association template is defined in (t . \"template\")
|
||||||
alist element.")
|
alist element.")
|
||||||
|
|
||||||
(defvar org-babel-prompt-command)
|
|
||||||
|
|
||||||
(defun org-babel-shell-initialize ()
|
(defun org-babel-shell-initialize ()
|
||||||
"Define execution functions associated to shell names.
|
"Define execution functions associated to shell names.
|
||||||
This function has to be called whenever `org-babel-shell-names'
|
This function has to be called whenever `org-babel-shell-names'
|
||||||
|
@ -80,10 +78,7 @@ is modified outside the Customize interface."
|
||||||
(lambda (body params)
|
(lambda (body params)
|
||||||
(:documentation
|
(:documentation
|
||||||
(format "Execute a block of %s commands with Babel." name))
|
(format "Execute a block of %s commands with Babel." name))
|
||||||
(let ((shell-file-name name)
|
(let ((shell-file-name name))
|
||||||
(org-babel-prompt-command
|
|
||||||
(or (cdr (assoc name org-babel-shell-set-prompt-commands))
|
|
||||||
(alist-get t org-babel-shell-set-prompt-commands))))
|
|
||||||
(org-babel-execute:shell body params))))
|
(org-babel-execute:shell body params))))
|
||||||
(put fname 'definition-name 'org-babel-shell-initialize))
|
(put fname 'definition-name 'org-babel-shell-initialize))
|
||||||
(defalias (intern (concat "org-babel-variable-assignments:" name))
|
(defalias (intern (concat "org-babel-variable-assignments:" name))
|
||||||
|
@ -259,7 +254,11 @@ var of the same value."
|
||||||
(org-babel-comint-wait-for-output (current-buffer))
|
(org-babel-comint-wait-for-output (current-buffer))
|
||||||
(org-babel-comint-input-command
|
(org-babel-comint-input-command
|
||||||
(current-buffer)
|
(current-buffer)
|
||||||
(format org-babel-prompt-command org-babel-sh-prompt))
|
(format
|
||||||
|
(or (cdr (assoc (file-name-nondirectory shell-file-name)
|
||||||
|
org-babel-shell-set-prompt-commands))
|
||||||
|
(alist-get t org-babel-shell-set-prompt-commands))
|
||||||
|
org-babel-sh-prompt))
|
||||||
(setq-local comint-prompt-regexp
|
(setq-local comint-prompt-regexp
|
||||||
(concat "^" (regexp-quote org-babel-sh-prompt)
|
(concat "^" (regexp-quote org-babel-sh-prompt)
|
||||||
" *"))
|
" *"))
|
||||||
|
|
Loading…
Reference in a new issue