From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] An amended to the enhance Org babel for scheme blocks Date: Sun, 23 Jul 2017 11:32:14 +0200 Message-ID: <87pocrmrc1.fsf@nicolasgoaziou.fr> References: <87o9skwbrh.wl-domenechjosel@gmail.com> <87eftfq76z.wl-domenechjosel@gmail.com> 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]:60482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZDFQ-0005ai-JZ for emacs-orgmode@gnu.org; Sun, 23 Jul 2017 05:32:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZDFP-0003Oq-RJ for emacs-orgmode@gnu.org; Sun, 23 Jul 2017 05:32:24 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:35404) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dZDFP-0003OE-Kz for emacs-orgmode@gnu.org; Sun, 23 Jul 2017 05:32:23 -0400 In-Reply-To: <87eftfq76z.wl-domenechjosel@gmail.com> (=?utf-8?Q?=22Jos?= =?utf-8?Q?=C3=A9?= L. =?utf-8?Q?Dom=C3=A9nech=22's?= message of "Mon, 17 Jul 2017 19:55:32 +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" To: =?utf-8?Q?Jos=C3=A9_L=2E_Dom=C3=A9nech?= Cc: Org Mode Hello, "Jos=C3=A9 L. Dom=C3=A9nech" writes: > Enhance the babel block for scheme. > > Allows scheme code blocks to return a table and add a :prologue param > to the scheme blocks. All :prologue params are prepended to the > body of code. > > * lisp/ob-scheme.el (org-babel-scheme-null-to): New custom option that > allows to use a empty list to format the table output, initially > assigned to 'hlines. > (org-babel-scheme-table-or-string): New helper function to convert > the return value from the block as a table or a string. > (org-babel-execute-src-block): Changed to allow the return of a > table for the output. > (org-babel-expand-body:scheme) Add :prologue param support. Thank you. Some comments follow. > +(defcustom org-babel-scheme-null-to 'hline > + "Replace `null' in scheme tables with this before returning." > + :group 'org-babel > + :version "24.4" > + :package-version '(Org . "8.0") > + :type 'symbol) :version "26.1" :package-version '(Org . "9.1") > +(defun org-babel-scheme-table-or-string (results) > + "Convert RESULTS into an appropriate elisp value. > +If the results look like a list or tuple, then convert them into an > +Emacs-lisp table, otherwise return the results as a string." > + (let ((res (org-babel-script-escape results))) > + (if (listp res) > + (mapcar (lambda (el) (if (or (eq el '()) (eq el 'null)) (eq el '()) -> (null el) > + (result > + (org-babel-scheme-execute-with-geiser > + full-body ; code > + (string=3D result-type "output") ; output? > + impl ; implementation > + (and (not (string=3D session "none")) session))) ; session > + ) The parenthesis needs to be moved at the end of the line above. Would you mind also providing an ORG-NEWS entry for that change? Regards, --=20 Nicolas Goaziou