emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rodrigo Morales <moralesrodrigo1100@gmail.com>
To: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <87ft2aikpf.fsf@gmail.com> (raw)


* 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	other threads:[~2021-02-05 15:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ft2aikpf.fsf@gmail.com \
    --to=moralesrodrigo1100@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).