summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-07-23 10:47:01 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-07-23 10:47:01 +0200
commit250304bd2eb2449bb1fccd80b8efb6e25c6aa901 (patch)
treebaadf391b225a0288cd1a92284cb4c57f37c1169
parent0f7df32711170906a47594cb2a397c6e5d9c46b7 (diff)
downloadorg-mode-250304bd2eb2449bb1fccd80b8efb6e25c6aa901.tar.gz
ob-shell: Make `org-babel-shell-initalize' a command
* lisp/ob-shell.el (org-babel-shell-initialize): Add `interactive.
-rw-r--r--lisp/ob-shell.el23
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/ob-shell.el b/lisp/ob-shell.el
index b7c23b1..7ddcc5e 100644
--- a/lisp/ob-shell.el
+++ b/lisp/ob-shell.el
@@ -41,21 +41,11 @@
(defvar org-babel-default-header-args:shell '())
-(defcustom org-babel-shell-names
- '("sh" "bash" "csh" "ash" "dash" "ksh" "mksh" "posh")
- "List of names of shell supported by babel shell code blocks.
-Call `org-babel-shell-initialize' when modifying this variable
-outside the Customize interface."
- :group 'org-babel
- :type '(repeat (string :tag "Shell name: "))
- :set (lambda (symbol value)
- (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."
+ (interactive)
(dolist (name org-babel-shell-names)
(eval `(defun ,(intern (concat "org-babel-execute:" name))
(body params)
@@ -63,6 +53,17 @@ is modified outside the Customize interface."
(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.
+Call `org-babel-shell-initialize' when modifying this variable
+outside the Customize interface."
+ :group 'org-babel
+ :type '(repeat (string :tag "Shell name: "))
+ :set (lambda (symbol value)
+ (set-default symbol value)
+ (org-babel-shell-initialize)))
+
(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'."