emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Quirk in Emacs-Lisp code block evaluation
@ 2011-07-29  4:30 Matthew Snyder
  2011-07-29  5:02 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew Snyder @ 2011-07-29  4:30 UTC (permalink / raw)
  To: emacs-orgmode

Hello -

I noticed today as I was playing with code blocks that some results are prematurely truncated, possibly because they contain nil as a first element and are thus considered empty return values.

Consider:


    #+BEGIN_SRC emacs-lisp
    '(a nil nil b)
    #+END_SRC

    #+results:
    | a | nil | nil | b |

But then:

    #+BEGIN_SRC emacs-lisp
    '(nil nil nil b)
    #+END_SRC

    #+results:

I'm using Emacs 24.0.50.1 and Org Mode 7.6, ELPA version 20110728.

--
Matthew Snyder

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Quirk in Emacs-Lisp code block evaluation
  2011-07-29  4:30 Quirk in Emacs-Lisp code block evaluation Matthew Snyder
@ 2011-07-29  5:02 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2011-07-29  5:02 UTC (permalink / raw)
  To: Matthew Snyder; +Cc: emacs-orgmode

Matthew Snyder <matthew.c.snyder@gmail.com> writes:

> Hello -
>
> I noticed today as I was playing with code blocks that some results
> are prematurely truncated, possibly because they contain nil as a
> first element and are thus considered empty return values.
>
> Consider:
>
>
>     #+BEGIN_SRC emacs-lisp
>     '(a nil nil b)
>     #+END_SRC
>
>     #+results:
>     | a | nil | nil | b |
>
> But then:
>
>     #+BEGIN_SRC emacs-lisp
>     '(nil nil nil b)
>     #+END_SRC
>
>     #+results:
>
> I'm using Emacs 24.0.50.1 and Org Mode 7.6, ELPA version 20110728.
>

Interesting corner case.

If you place a ":results scalar" header argument onto the code block,
then you get reasonable results

#+begin_src emacs-lisp :results scalar
  '(nil nil nil nil)
#+end_src

#+results:
: (nil nil nil nil)

However when the results are converted into a table, the
`orgtbl-to-orgtbl' which ultimately calls the `orgtbl-to-generic'
function turns '(nil nil nil nil) into "".  This may be something to
look at in the future, but for now I'm hesitant to touch such a central
function.

Cheers -- Eric

>
> --
> Matthew Snyder

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-29 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-29  4:30 Quirk in Emacs-Lisp code block evaluation Matthew Snyder
2011-07-29  5:02 ` Eric Schulte

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