emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: appearance of list as results from evaluating code blocks


From: George Mauer
Subject: Re: appearance of list as results from evaluating code blocks
Date: Wed, 23 Jun 2021 16:24:55 -0500

What about :results code
The default is a elisp code block so you get syntax coloring

On Wed, Jun 23, 2021, 16:22 Rodrigo Morales <moralesrodrigo1100@gmail.com> wrote:
Johannes Brauer <brauer@nordakademie.de> writes:

Johannes Brauer writes:

> thanks, that works

While that works, you might be interested in ":results verbatim" instead
of ":results raw" since when using "verbatim" the results are replaced
when re-evaluating the code block. See minimal working example below.

After pressing =C-c C-c= five times

#+BEGIN_SRC elisp :results raw
(list 1 2 3)
#+END_SRC

#+RESULTS:
(1 2 3)
(1 2 3)
(1 2 3)
(1 2 3)
(1 2 3)

After pressing =C-c C-c= five times

#+BEGIN_SRC elisp :results verbatim
(list 1 2 3)
#+END_SRC

#+RESULTS:
#+begin_example
(1 2 3)
#+end_example

PS: If you haven't customized Org Mode enough, you might get a ":" as
the prefix of some of your results.

#+BEGIN_SRC elisp :results verbatim
(list 1 2 3)
#+END_SRC

#+RESULTS:
: (1 2 3)

As can be seen above, the results are not enclosed within
#+begin_example and #+end_example. To enable this, set the following.

#+BEGIN_SRC elisp
(setq org-babel-min-lines-for-block-output 0)
#+END_SRC

Once you set the option shown above, you might get the following when
evaluating the code block.

#+BEGIN_SRC elisp :results verbatim
(list 1 2 3)
#+END_SRC

#+RESULTS:
#+begin_example
(1 2 3)
#+end_example


reply via email to

[Prev in Thread] Current Thread [Next in Thread]