emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* bug? Newline inserted when referencing a block result with ":cache yes" in a "noweb" reference
@ 2021-02-05 15:43 Rodrigo Morales
  0 siblings, 0 replies; only message in thread
From: Rodrigo Morales @ 2021-02-05 15:43 UTC (permalink / raw)
  To: emacs-orgmode


* The context

Let's suppose we have two code blocks whose results we want to use in multiple code blocks.

The result of this code block is cached.

#+NAME: test-cache
#+begin_src sh :cache yes
printf "%s" 5
#+end_src

#+RESULTS[4981a8c18361e02d50b4d3ac3677e0c56e9ba9c0]: test-cache
#+begin_example
5
#+end_example

while the results of this one isn't cached.

#+NAME: test-no-cache
#+begin_src sh :cache no
printf "%s" 5
#+end_src

#+RESULTS: test-no-cache
#+begin_example
5
#+end_example

Let's insert each result in a different code block through a =noweb= reference so that we can get to the issue.

#+begin_src sh :eval no :noweb yes :tangle ./test-cache.sh
echo "Hello <<test-cache()>>. Lorem ipsum."
#+end_src

#+begin_src sh :eval no :noweb yes :tangle ./test-no-cache.sh
echo "Hello <<test-no-cache()>>. Lorem ipsum."
#+end_src

The tangling of the files mentioned above would result in

#+begin_src dash
cat test-cache.sh
#+end_src

#+RESULTS:
#+begin_example
echo "Hello 5
echo "Hello . Lorem ipsum."
#+end_example

#+begin_src dash
cat test-no-cache.sh
#+end_src

#+RESULTS:
#+begin_example
echo "Hello 5. Lorem ipsum."
#+end_example

As we could see above, a newline is inserted when referencing the results of the code block which had the =:cache= header argument set to =yes=. This didn't happen with the code block which had =:cache= set to no.

* The questions

1. Is this normal behavior or is it a bug?
2. How can I make a newline not to be inserted when referencing the result of a code block which had =:cache= set to =yes=

-- 
Greetings,
Rodrigo Morales.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-05 15:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-05 15:43 bug? Newline inserted when referencing a block result with ":cache yes" in a "noweb" reference Rodrigo Morales

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