Function: org-babel-shell-initialize

org-babel-shell-initialize is an interactive and byte-compiled function defined in ob-shell.el.gz.

Signature

(org-babel-shell-initialize)

Documentation

Define execution functions associated to shell names.

This function has to be called whenever org-babel-shell-names is modified outside the Customize interface.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-shell.el.gz
(defun org-babel-shell-initialize ()
  "Define execution functions associated to shell names.
This function has to be called whenever `org-babel-shell-names'
is modified outside the Customize interface."
  (interactive)
  (dolist (name org-babel-shell-names)
    (eval `(defun ,(intern (concat "org-babel-execute:" name))
	       (body params)
	     ,(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))))
	       (org-babel-execute:shell body params))))
    (eval `(defalias ',(intern (concat "org-babel-variable-assignments:" name))
	     'org-babel-variable-assignments:shell
	     ,(format "Return list of %s statements assigning to the block's \
variables."
		      name)))
    (eval `(defvar ,(intern (concat "org-babel-default-header-args:" name)) '()))))