From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Make ob-shell conform to the org-babel interface Date: Mon, 01 Jun 2015 19:18:09 +0200 Message-ID: <877frntkj2.fsf@nicolasgoaziou.fr> References: <3651FC40-E9B3-4027-91D7-DD03147591C4@infomedia.uib.no> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzTKN-00013L-6x for emacs-orgmode@gnu.org; Mon, 01 Jun 2015 13:16:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzTKL-0008GB-Us for emacs-orgmode@gnu.org; Mon, 01 Jun 2015 13:16:43 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:56616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzTKL-0008G5-PY for emacs-orgmode@gnu.org; Mon, 01 Jun 2015 13:16:41 -0400 In-Reply-To: <3651FC40-E9B3-4027-91D7-DD03147591C4@infomedia.uib.no> (Bjarte Johansen's message of "Wed, 27 May 2015 17:30:27 +0200") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bjarte Johansen Cc: emacs-orgmode Hello, Bjarte Johansen writes: > I found that ob-shell=E2=80=99s org-babel-variable-assignments:bash funct= ion > does not respect the interface for org-babel. It takes multiple > arguments when it should only take 1. This is a problem when f.ex. > org-babel-sha1-hash tries to expand the body of a bash source block > and tries to call that function with only 1 argument. > > I am not sure if the following patch follows best practices in the > project, but it solves the problem for me. Thank you for the patch. Some comments follow. > From 04f00e4f69c5352d51b7de1ba8783ddd96124c1f Mon Sep 17 00:00:00 2001 > From: Bjarte Johansen > Date: Wed, 27 May 2015 17:20:41 +0200 > Subject: [PATCH] ob-shell: Conform to variable assignment interface You need to list modified functions in commit message. > Change org-babel-variable-assignments functions in ob-shell to use the > same function so conform to the interface used for variable assignment > in org-babel. "Org Babel" > +(ert-deftest test-ob-shell/should-respect-ob-interface-naming-convention= () > + "Functions used to interface with the different org-babel > + should have the correct signature." "Org Babel". Also, do not indent second line, and please make first sentence fit on a single line. > + (dolist (shell org-babel-shell-names) > + (org-test-with-temp-text > + (format "#+BEGIN_SRC %s :cache yes > + echo test > +#+END_SRC" shell) > + (let ((info (org-babel-get-src-block-info))) > + (org-babel-sha1-hash info))))) You need to wrap this within a `should' in order to define a proper test. Regards, --=20 Nicolas Goaziou