Просмотр исходного кода

ob-shell: Fix "wrong type sequencep: function" error

* lisp/ob-shell.el (org-babel-shell-names): Fix error introduced when
  switching to lexical binding.
Nicolas Goaziou 8 лет назад
Родитель
Сommit
f8eb0b30ea
1 измененных файлов с 10 добавлено и 11 удалено
  1. 10 11
      lisp/ob-shell.el

+ 10 - 11
lisp/ob-shell.el

@@ -44,17 +44,16 @@
   '("sh" "bash" "csh" "ash" "dash" "ksh" "mksh" "posh")
   "List of names of shell supported by babel shell code blocks."
   :group 'org-babel
-  :type 'string
-  :initialize
-  (lambda (symbol value)
-    (set-default symbol (second value))
-    (mapc
-     (lambda (name)
-       (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)))))
-     (second value))))
+  :type '(repeat (string :tag "Shell name: "))
+  :set (lambda (symbol value)
+	 (set-default symbol value)
+	 (dolist (name value)
+	   (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)))
+		 t))))
 
 (defun org-babel-execute:shell (body params)
   "Execute a block of Shell commands with Babel.