[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH] An amended to the enhance Org babel for scheme blocks
From: |
Nicolas Goaziou |
Subject: |
Re: [O] [PATCH] An amended to the enhance Org babel for scheme blocks |
Date: |
Sun, 23 Jul 2017 11:32:14 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Hello,
"José L. Doménech" <address@hidden> 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= result-type "output") ; output?
> + impl ; implementation
> + (and (not (string= 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,
--
Nicolas Goaziou