emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: "Rudolf Adamkovič" <rudolf@adamkovic.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Fix "inverted" behavior of `colnames' header argument
Date: Sat, 09 Nov 2024 15:03:11 +0000	[thread overview]
Message-ID: <871pzkfo0g.fsf@localhost> (raw)
In-Reply-To: <m2ldxz98ml.fsf@adamkovic.org>

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

> Upon further thinking, I think I now get it.
>
> My understanding:
>
>   - =nil= ::
>   
>     1. Drop the column names from the input, if tabular.
>     2. Run the code block, possibly producing results.
>     3. Re-add the column names, if any, to the results, if tabular.
>   
>     N.B. Column names are row #1 if row #2 is a horizontal rule.

Sounds about right. See `org-babel-disassemble-tables' and
`org-babel-reassemble-table' for what is actually being done.

I guess "auto" would have been a better name for this value.
   
>> Also, I tried the following with `emacs -Q':
>
> I noticed that if I pass 'nil (with a quote) instead of nil, everything
> works well.  Why is that?  And, no matter why that is, why do we say nil
> in the manual instead of 'nil, if that is what the user must write?

That's because Org treats :foo text as a string or number by
default. Org only parses the value as Elisp when it starts from "(",
"\\='", "\\=`" or a "[". See `org-babel-read'.

This means that :colnames nil actually means :colnames "nil".

I agree that it is confusing. It would be a good idea to treat nil and
"nil" equally. Maybe even rename the default to "auto" to avoid
confusion (in addition to nil/"nil").

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


  reply	other threads:[~2024-11-09 15:02 UTC|newest]

Thread overview: 8+ 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č
2024-11-03 23:53       ` Rudolf Adamkovič
2024-11-09 15:03         ` Ihor Radchenko [this message]
2024-11-04 20:06     ` Ihor Radchenko
2024-11-25 15:11       ` Rudolf Adamkovič

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=871pzkfo0g.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=rudolf@adamkovic.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).