emacs-orgmode
[Top][All Lists]
Advanced

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

bug? Newline inserted when referencing a block result with ":cache yes"


From: Rodrigo Morales
Subject: bug? Newline inserted when referencing a block result with ":cache yes" in a "noweb" reference
Date: Fri, 05 Feb 2021 10:43:40 -0500
User-agent: mu4e 1.4.14; emacs 27.1

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



reply via email to

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