From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SPd4C+vOcmOD3gAAbAwnHQ (envelope-from ) for ; Tue, 15 Nov 2022 00:27:39 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 8DmZCuvOcmNR8wAAG6o9tA (envelope-from ) for ; Tue, 15 Nov 2022 00:27:39 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DE65E3F5DE for ; Tue, 15 Nov 2022 00:27:35 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ouiqf-0003Pp-NF; Mon, 14 Nov 2022 18:26:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ouihh-000126-36 for emacs-orgmode@gnu.org; Mon, 14 Nov 2022 18:17:25 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ouQcw-0006v5-RN for emacs-orgmode@gnu.org; Sun, 13 Nov 2022 22:59:20 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 5AC51240103 for ; Mon, 14 Nov 2022 04:59:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1668398356; bh=DKccumsVUJSWzFtB6+37k10buv+H5TDX/NySWZNJV2c=; h=From:To:Cc:Subject:Date:From; b=JFzfu8shpi6gxwhRlUB+Td2OyQklZlowWblHoATeTVo2JQHTFQ0LUoVnWHklfBq6u NQAEnxPiEoMNGLcGqlMDEJCHBZmjOkHFJqmMb3KXDJwE1zVBVK7QRSdut4Fkz+i3pH WjuRq5PMcpiQGQ5IIZqJYU6RfNDmHruFjZM+BMraJvAVks2hUyV6CK59betdTcIHvr lX8cET8pDX0NLqZO8DAcMXHvOvCUpqa+fmi4p60FDheN+fhW/2ozGe0rCez1kFaTCK zk7mCwK47pH+ZlZtjpgYbCbqn2peVOyQ77H9cqOiywpXGtesvbg1lGFQQZcC2MmNDW uYu9kT9QfbHmw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4N9bCk1MMPz6tmQ; Mon, 14 Nov 2022 04:59:13 +0100 (CET) From: Ihor Radchenko To: Alain.Cochard@unistra.fr Cc: Org Mode List Subject: Re: 2 'echo' bash instructions produce a table In-Reply-To: <25457.22124.839301.412560@gargle.gargle.HOWL> References: <25447.23346.575598.420558@gargle.gargle.HOWL> <87tu3ba40w.fsf@localhost> <25457.22124.839301.412560@gargle.gargle.HOWL> Date: Mon, 14 Nov 2022 03:59:55 +0000 Message-ID: <87pmdqfao4.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1668468459; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Z+cB+V7DdYVlGUhfqoWE8fijnIFh6mhB/PwT3zczMtw=; b=dli7HhJYHOQ8M+lq/MOQfNavKXAyhmNQKDwhLTVMGV1akIpBEECCZ68x8cOHF/5kOa9LPy RYTuOnt/Tw8t0W1b1ZnprB8jKmYnHMjkjNYJdwRkgCxKvwF4XVEBccNYi4I9EMTGkaUD9N AoAaKUe5orLnT4HThZaEurxc7adTe6u8YEvAStUGmjCtgk36L105MJszF2sw7CDk6CL5F8 Z/glua8qTpBcOLxz89M0jwbIF1IEI4BVWTAHb5T3nFMqW4eyr0XAmJ5JeHe7RZk3tcVFIJ EvKkpwbM0DRB9KTuCeYqHFdfwqGH8WnkcWBNAgEjqp5z/Deb5Ja0JBm3XbIIbQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1668468459; a=rsa-sha256; cv=none; b=UHx4HJweWKiQISVsZArivpB/KUKCOb3gylw/8v0gs307KU5tsOWR/4r4k+XEl5HQ+nubUR Qu6Tm46vgNCy7G745havIhdNsI+AQNGj1LoFp5DbqB7jJUTs9SNdnNBFJsORrYznEfUSs5 Ex2EVcfH3yeBA7oSL0Ct4ahoxoxFnYcTORM6zfOtSNFNt/esGsEpDxWD8E7aKiBARW4JQn 0WFmGc6qa0BpSjR6GgZlJskXZ5CyuvtY8fl91OJDh6kvoOqwr1MD3OrLZavnTWFh7tr6kF V3K2gJQ0ZWmxLyQfObR0yOoJ+CETyA5IgKJtLs/4IhT9QUE5LXmyz/n/d3Lotw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=JFzfu8sh; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.54 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=JFzfu8sh; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: DE65E3F5DE X-Spam-Score: -3.54 X-Migadu-Scanner: scn1.migadu.com X-TUID: 6iIE0+jbZu9q 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. > >=20 > > 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? > 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? > In section 16.3 of the manual (Using Header Arguments): > > System-wide values of header arguments can be specified by > customizing the =E2=80=98org-babel-default-header-args=E2=80=99 variab= le, which > defaults to the following values: > > :session =3D> "none" > :results =3D> "replace" > :exports =3D> "code" > :cache =3D> "no" > :noweb =3D> "no" > > > but the docstring of 'org-babel-default-header-args' says: > > org-babel-default-header-args is a variable defined in =E2=80=98ob-cor= e.el=E2=80=99. > Its value is > ((:session . "none") > (:results . "replace") > (:exports . "code") > (:cache . "no") > (:noweb . "no") > (:hlines . "no") > (:tangle . "no")) > > so I was wondering if there should be > > :hlines =3D> "no" > :tangle =3D> "no" > > added above. It will be fixed in the next release. The online and built-in Emacs manual are only reflecting the current stable Org version. > PS2 > > In section 16.6 (Results of Evaluation) >=20=20=20=20 > [The =E2=80=98results=E2=80=99 header argument] accepts four classes o= f options > [Collection, Type, Format, Handling] > > Each code block can take only one option per class: > > Now, the paragraphs related to Collection, Type, & Format all contain > the statement > > "Choose one of the options; they are mutually exclusive". > > I thought this statement was saying the same thing as the "only one > option per class" above, but then why not also repeat the statement in > the Handling paragraph? Makes sense. Done on main. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3D4260f5a8d= 74c965fccf200aa71da0c6d338573c0 > PS3 > > In section 16.4 (Environment of a Code Block) > > A simple named list. > > #+NAME: example-list > - simple > - not > - nested > - list > > #+BEGIN_SRC emacs-lisp :var x=3Dexample-list > (print x) > #+END_SRC > > #+RESULTS: > | simple | list | > > But if I evaluate the code, I get > > #+RESULTS: > | simple | (unordered (not) (nested)) | > | list | | Confirmed. Need to look into this. > PS4 > > In 16.5 (Evaluating Code Blocks), in this code > > #+NAME: random > #+BEGIN_SRC R :cache yes > runif(1) > #+END_SRC > > the (1) seems to be understood as a footnote in Info, at least for me. > E.g., on it goes to the footnote > > (1) The option =E2=80=98org-babel-no-eval-on-ctrl-c-ctrl-c=E2=80=99 [.= ..] > > and on this (1) goes back to the above code instead of to the > actual call > > "Org provides many ways to execute code blocks. =E2=80=98C-c C-c=E2= =80=99 or =E2=80=98C-c > C-v e=E2=80=99 with the point on a code block(1)" Confirmed, but it does not look like Org's fault. Org correctly produces the following texinfo source: @example #+NAME: random #+BEGIN_SRC R :cache yes runif(1) #+END_SRC #+RESULTS[a2a72cd647ad44515fab62e144796432793d68e1]: random 0.4659510825295 #+NAME: caller #+BEGIN_SRC emacs-lisp :var x=3Drandom :cache yes x #+END_SRC #+RESULTS[bec9c8724e397d5df3b696502df3ed7892fc4f5f]: caller 0.254227238707244 @end example As you can see, no @footnote command is there. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at