emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Rudolf Adamkovič" <rudolf@adamkovic.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: Fix "inverted" behavior of `colnames' header argument
Date: Sun, 03 Nov 2024 23:10:57 +0100	[thread overview]
Message-ID: <m2plnc7ytq.fsf@adamkovic.org> (raw)
In-Reply-To: <m2r07sc8oo.fsf@adamkovic.org>

Rudolf Adamkovič <rudolf@adamkovic.org> writes:

> Oh, I see.  Wow, that is /really/ confusing from the user's POV.

In fact, I do not understand the manual.  It says:

  The default value is ‘nil’: if an input table has column names—because
  the second row is a horizontal rule—then Org removes the column names,
  processes the table, puts back the column names, and then writes the
  table to the results block.

Three questions immediately pop up in my head:

1. Is the manual talking about the input tables, specified with `:var',
   the output tables, when `:result table', or both?

2. Org "removes" the column names, then "processes" the table, and then
   "puts [the column names] back".  Why?  And what does it mean?

3. What if the second row is not a horizontal rule?  The manual says
   nothing about that happens in that case, with `:colnames nil'.

Also, I tried the following with `emacs -Q':

  #+NAME: 568ccf1e-f266-47ab-9402-0d380359d73c
  | 10 |
  |----|
  | 20 |
  | 30 |
  
  With =colnames= unset:
  
  #+HEADER: :var table = 568ccf1e-f266-47ab-9402-0d380359d73c
  #+BEGIN_SRC python
  return table
  #+END_SRC
  
  #+RESULTS:
  | 20 |
  | 30 |
  
  With =colnames= set to =nil=:
  
  #+HEADER: :colnames nil
  #+HEADER: :var table = 568ccf1e-f266-47ab-9402-0d380359d73c
  #+BEGIN_SRC python
  return table
  #+END_SRC
  
  #+RESULTS:
  | 10 |
  |----|
  | 20 |
  | 30 |

Why do the two outputs differ if

  The default value is ‘nil’: [...]

Thank you in advance for clarifications!

Rudy
-- 
"The whole science is nothing more than a refinement of everyday
thinking."  --- Albert Einstein, 1879-1955

Rudolf Adamkovič <rudolf@adamkovic.org> [he/him]
http://adamkovic.org


  reply	other threads:[~2024-11-03 22:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-02 16:44 Fix "inverted" behavior of `colnames' header argument Rudolf Adamkovič
2024-11-02 18:39 ` Ihor Radchenko
2024-11-03 21:24   ` Rudolf Adamkovič
2024-11-03 22:10     ` Rudolf Adamkovič [this message]
2024-11-03 23:53       ` Rudolf Adamkovič
2024-11-04 20:06     ` 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:
  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=m2plnc7ytq.fsf@adamkovic.org \
    --to=rudolf@adamkovic.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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).