emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org f5467b53ec 1/3: lisp/ob-shell.el: Fix sessions for


From: ELPA Syncer
Subject: [elpa] externals/org f5467b53ec 1/3: lisp/ob-shell.el: Fix sessions for generic "shell" blocks
Date: Fri, 4 Aug 2023 03:58:30 -0400 (EDT)

branch: externals/org
commit f5467b53ec9be02ceaca8494e58090b3972fe2ac
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    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.
---
 lisp/ob-shell.el | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/lisp/ob-shell.el b/lisp/ob-shell.el
index ae86ee4c24..6c69c28848 100644
--- a/lisp/ob-shell.el
+++ b/lisp/ob-shell.el
@@ -67,8 +67,6 @@ that will be called with a single additional argument: prompt 
string.
 The fallback association template is defined in (t . \"template\")
 alist element.")
 
-(defvar org-babel-prompt-command)
-
 (defun org-babel-shell-initialize ()
   "Define execution functions associated to 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)
          (:documentation
            (format "Execute a block of %s commands with Babel." 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))))
+         (let ((shell-file-name name))
            (org-babel-execute:shell body params))))
       (put fname 'definition-name 'org-babel-shell-initialize))
     (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-input-command
              (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
                         (concat "^" (regexp-quote org-babel-sh-prompt)
                                 " *"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]