Rudolf Adamkovič <rud...@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 via email to