emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alain.Cochard@unistra.fr
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Alain.Cochard@unistra.fr, Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: 2 'echo' bash instructions produce a table
Date: Wed, 16 Nov 2022 17:35:19 +0100	[thread overview]
Message-ID: <25461.4423.734070.149776@gargle.gargle.HOWL> (raw)
In-Reply-To: <87pmdqfao4.fsf@localhost>

Ihor Radchenko writes on Mon 14 Nov 2022 03:59:
 > Alain.Cochard@unistra.fr writes:
 > > Ihor Radchenko writes on Mon  7 Nov 2022 02:31:

 > > > If you want to force string output, use :results output.
 > > > 
 > > > By default, ob-shell tries to guess the output type.  In the
 > > > case of two commands returning output, the guess is yielding
 > > > the table. In the case of a single command, the guess is
 > > > yielding a single string output.
 > >
 > > Thanks a lot.
 > >
 > > I find it strange, though, that the default is not as what one gets
 > > from running the code from a terminal.  I imagine there are good
 > > reasons for that, but I think this should be made clear (or at least
 > > clearer) in the manual.  I browsed through section 16 of the manual,
 > > with particular attention to 16.5 (Evaluating Code Blocks) and 16.6
 > > (Results of Evaluation), but still cannot see where this is said or
 > > hinted; if it is there, I missed it or do not know enough to
 > > understand it.

 > The manual describes generic code execution. If you do not explicitly
 > specify the :results header arg, it is the specific babel backend that
 > specifies the defaults.

 > Will it help if we mention this fact in "16.6 Results of Evaluation"
 > section?

Yes, it would help me.  At least I would been warned.  But it would be
complete only if knew where to read about each specific babel backend.

 > > For the sake of newcomers, it seems to me that something along the
 > > line of what you write above would fit somewhere in 16.6, with a first
 > > short mention/warning (and reference to it) next to that excerpt in
 > > 16.5:
 > >
 > >    Org captures the results of the code block evaluation and inserts
 > >    them in the Org file, right after the code block.

 > Talking about ob-shell does not belong to this section of the
 > manual.  Other backends have different behaviour. Have you seen
 > examples in
 > https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-shell.html
 > ?  Are they not clear enough?

No, I had not seen this before.  If I had, I might have understood why
I was getting the "strange" output that originated this thread -- but
I do not find it explained as clearly as you explained it:

   "In the case of two commands returning output, the guess is
    yielding the table. In the case of a single command, the guess is
    yielding a single string output."

I can now see that the ob-doc-shell.html page is (indirectly) referred
to in 16.9, via
Maybe this is enough for some, but for me it is too convoluted.  I had
seen this page, but it was a long time ago, when I checked whether the
languages I use were supported or not.  So why not also refer to it in
16.6, together with the mentioned fact to which you are referring


PS 1: In the manual, I see "backend" and "back-end".  So it is an
issue similar to the "subtree/sub-tree" issue you fixed a few days
ago, to the "heading/headline" issue that was reported recently, and
to many similar cases I met in the past.  So I was wondering if there
could exist some (semi-)automatic way which would ensure that future
maintainers will not inadvertently re-introduce "sub-tree"
occurrences, or the like.  Perhaps some "accepted terminology" list
that would be checked upon?

PS 2: Reading the ob-doc-shell.html page, I understood (kind of) what
was so far a mystery to me : that a "#+begin_src bash" group works as
expected while "#+begin_src ba + C-M-i" fails to complete "ba" to
"bash": namely that all the shells fall inside the "shell" umbrella
keyword.  Still, would not it make sense that the completion mechanism
also work for all those particular shells?

EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.cochard@unistra.fr
5 rue René Descartes   [bureau 110]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France     | [ slot available for rent ]

  parent reply	other threads:[~2022-11-16 16:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-06  6:58 2 'echo' bash instructions produce a table Alain.Cochard
2022-11-07  2:31 ` Ihor Radchenko
2022-11-13 20:41   ` Alain.Cochard
2022-11-14  3:59     ` Ihor Radchenko
2022-11-15  6:00       ` [RFC] :var x=list-name should be resolved into simple lists (item1 item2 ...); not nested ((item1) (item2) ...) (was: 2 'echo' bash instructions produce a table) Ihor Radchenko
2022-11-26  1:54         ` Ihor Radchenko
2022-11-16  1:24       ` 2 'echo' bash instructions produce a table Ihor Radchenko
2022-11-21  9:04         ` Ihor Radchenko
2022-11-21  9:05         ` Ihor Radchenko
2022-11-16 16:35       ` Alain.Cochard [this message]
2022-11-19 12:28         ` Rudolf Adamkovič
2022-11-20  5:05           ` Ihor Radchenko
2022-11-22  8:16         ` Ihor Radchenko
2022-11-22 19:13           ` Alain.Cochard
2022-11-24  1:55             ` Ihor Radchenko
2022-11-22  8:31         ` [RFC] Backend vs. back-end (was: 2 'echo' bash instructions produce a table) Ihor Radchenko
2023-02-20 10:07           ` Ihor Radchenko
2023-02-20 14:54             ` Alain.Cochard
2023-04-06  9:57               ` Ihor Radchenko
2023-04-20 12:17                 ` Ihor Radchenko
2023-04-06 23:43           ` Samuel Wales
2022-11-22  8:37         ` [BUG] Make source block auto-completion work for all the loaded babel backends " Ihor Radchenko

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:

  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=25461.4423.734070.149776@gargle.gargle.HOWL \
    --to=alain.cochard@unistra.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \


* 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


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).