emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Ross Donaldson <gastove@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: CALL misbehavior with :results verbatim [8.3.4 (8.3.4-5-gdc68d2-elpaplus @ /Users/rossdonaldson/.emacs.d/elpa/org-plus-contrib-20160229/)]
Date: Wed, 06 Apr 2016 09:55:48 +0200	[thread overview]
Message-ID: <877fgbf9x7.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <m1d1q3ekum.fsf@gmail.com> (Ross Donaldson's message of "Tue, 05 Apr 2016 15:45:05 -0700")

Hello,

Ross Donaldson <gastove@gmail.com> writes:

> So: by default (at least, for me, in my configuration), Org
> automatically tries to interpret the results of src blocks as Org
> values -- usually tables. For example, evaluating `ls -la` in a shell
> src block returns, by default, Org's best attempt to parse a table
> from the output of ls.
>
> `:results verbatim` skips this, inserting the values as an example block. Vis:

[...]

Indeed, as I understand it, verbatim is a way to force "dumb" default
handling for results. However, I don't find the manual particularly
clear about it, particularly in the second sentence:

   • ‘scalar’, ‘verbatim’ The results should be interpreted
     literally—they will not be converted into a table.  The results
     will be inserted into the Org mode buffer as quoted text.  E.g.,
     ‘:results value verbatim’.

> So. With call, I get values wrapped in quotes, often with a newline,
> if I use `verbatim`.

The core of the problem is that Babel emacs-lisp has its own
interpretation for "verbatim", more in line with the second sentence
pointed out above. Hence, in `org-babel-execute:emacs-lisp', one can see

  (if (or (member "scalar" (cdr (assoc :result-params params)))
                    (member "verbatim" (cdr (assoc :result-params params))))
                (format "%S" result)
              (format "%s" result))

So, basically, the function quote strings; "verbatim" is no longer
equivalent to default behaviour.

Eventually, as icing of the cake, every CALL line is evaluated as an
emacs-lisp block, so the idiosyncrasy above propagates to any result
coming from any language.

I think it is no good if any language provides its own definition for
verbatim. We should stick to a common one. Besides, I don't think CALL
lines should be wrapped within an Emacs lisp call.


Regards,

-- 
Nicolas Goaziou

      reply	other threads:[~2016-04-06  7:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-05 22:55 Bug: CALL misbehavior with :results verbatim [8.3.4 (8.3.4-5-gdc68d2-elpaplus @ /Users/rossdonaldson/.emacs.d/elpa/org-plus-contrib-20160229/)] Ross Donaldson
2016-03-16 22:42 ` Nicolas Goaziou
2016-03-16 23:52   ` Ross Donaldson
2016-04-03  9:00     ` Nicolas Goaziou
2016-04-05 22:45       ` Ross Donaldson
2016-04-06  7:55         ` Nicolas Goaziou [this message]

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=877fgbf9x7.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=gastove@gmail.com \
    /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).