emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "José L. Doménech" <domenechjosel@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] An amended to the enhance Org babel for scheme blocks
Date: Sun, 23 Jul 2017 11:32:14 +0200	[thread overview]
Message-ID: <87pocrmrc1.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87eftfq76z.wl-domenechjosel@gmail.com> ("José L. Doménech"'s message of "Mon, 17 Jul 2017 19:55:32 +0200")

Hello,

"José L. Doménech" <domenechjosel@gmail.com> 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

  reply	other threads:[~2017-07-23  9:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-16 17:08 Enhance Org babel scheme "José L. Doménech"
2017-07-17 17:55 ` [PATCH] An amended to the enhance Org babel for scheme blocks "José L. Doménech"
2017-07-23  9:32   ` Nicolas Goaziou [this message]
2017-07-24  7:27     ` "José L. Doménech"
2017-07-24 10:06       ` Nicolas Goaziou
2017-07-24 10:44         ` "José L. Doménech"

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pocrmrc1.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=domenechjosel@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).