tmk <[email protected]> writes:

> Hello,
>
> I've noticed that when a source block result is wrapped into an
> example block, the empty line following teh source block (and before
> the following text) is removed.

Confirmed.

I get the same behaviour. I noticed it recently, and made a note to
investigate but haven't got around to it yet. At least I can confirm
anyway. I'd be happy to look at it, but it likely won't be for some
time.

> If the following text is a list, it gets deleted on following
> evaluations of the block that produce empty output because the list
> then sits right after #+RESULTS: and Org considers that list to be the
> result (I think).
>

I also get this behaviour and it could catch someone out. The following
shows what can happen, resulting in data loss :(

Start by evaluating this to set N to 10.

#+BEGIN_src elisp
(setq N 10)
#+END_src

Now evaluate bad-bock and see the result is wrapped in an example block,
and there is no blank space between the results and the list.

#+name: bad-block
#+BEGIN_src elisp
(let ((str ""))
  (dotimes (n N str)
    (setq str (concat str (format "line %s\n" n)))))
#+END_src

- item 1
- item 2

Now evaluate this to set N to 0.

#+BEGIN_src elisp
(setq N 0)
#+END_src

Go back and re-evaluate bad-block twice, discovering to your horror that
your beautiful list is gone!

Presumably something similar happens with objects other than lists, that
are interpreted as part of a the results of a previous evaluation.

> When the result is not wrapped into an example block, the empty line is kept.

Yes, I get that too.

Cheers,
Paul.

Reply via email to