From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernard Hurley Subject: [PATCH] Fix to allow ob-babel-shell-names to be customised. Date: Sat, 23 Jul 2016 01:55:31 +0100 Message-ID: <87vazxb2bg.fsf@marcade.biz> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQlq9-00010q-BX for emacs-orgmode@gnu.org; Fri, 22 Jul 2016 21:34:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQlq5-0008Kv-Qf for emacs-orgmode@gnu.org; Fri, 22 Jul 2016 21:34:52 -0400 Received: from [86.53.51.141] (port=44768 helo=snares-penguin.marcade.biz) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQlq1-0008IR-IX for emacs-orgmode@gnu.org; Fri, 22 Jul 2016 21:34:49 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Hi all, At present customisation of the variable ob-babel-shell-names in ob-shell.el doesn't work properly. You can actually change its value and save the customisation, but the org-babel-execute: functions get created for the hard coded value of the variable not the customised value. The following patch should fix it: ---------------snip------------ *** ob-shell.el.old 2016-07-22 20:43:43.190100908 +0100 --- ob-shell.el 2016-07-22 22:55:28.730037538 +0100 *************** *** 42,60 **** (defcustom org-babel-shell-names '("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)))) (defun org-babel-execute:shell (body params) "Execute a block of Shell commands with Babel. --- 42,61 ---- (defcustom org-babel-shell-names '("sh" "bash" "csh" "ash" "dash" "ksh" "mksh" "posh") ! "List of names of shell supported by babel shell code blocks. ! Changing this variable outside the Customize interface has no effect." :group 'org-babel ! :type '(repeat string) ! :set (lambda (symbol value) ! (set-default symbol 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))))) ! value))) (defun org-babel-execute:shell (body params) "Execute a block of Shell commands with Babel. -----------------------snip---------- I am using Org version 8.3.5 in Emacs 25.1.50.1. Cheers, Bernard -- Your fortune cookie for today: Marriage is low down, but you spend the rest of your life paying for it. -- Baskins ** Fortune cookies are brought to you by GNU/Linux "fortunes" **