From 250304bd2eb2449bb1fccd80b8efb6e25c6aa901 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 23 Jul 2016 10:47:01 +0200 Subject: [PATCH] ob-shell: Make `org-babel-shell-initalize' a command * lisp/ob-shell.el (org-babel-shell-initialize): Add `interactive. --- lisp/ob-shell.el | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lisp/ob-shell.el b/lisp/ob-shell.el index b7c23b1a3..7ddcc5e3c 100644 --- a/lisp/ob-shell.el +++ b/lisp/ob-shell.el @@ -41,6 +41,18 @@ (defvar org-babel-default-header-args:shell '()) +(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-execute:shell body params)))))) + (defcustom org-babel-shell-names '("sh" "bash" "csh" "ash" "dash" "ksh" "mksh" "posh") "List of names of shell supported by babel shell code blocks. @@ -52,17 +64,6 @@ outside the Customize interface." (set-default symbol value) (org-babel-shell-initialize))) -(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." - (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-execute:shell body params)))))) - (defun org-babel-execute:shell (body params) "Execute a block of Shell commands with Babel. This function is called by `org-babel-execute-src-block'."