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

#+RESULTS[4981a8c18361e02d50b4d3ac3677e0c56e9ba9c0]: test-cache

while the results of this one isn't cached.

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

#+RESULTS: test-no-cache

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

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

The tangling of the files mentioned above would result in

#+begin_src dash
cat test-cache.sh

echo "Hello 5
echo "Hello . Lorem ipsum."

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

echo "Hello 5. Lorem ipsum."

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=

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:

  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 \
    --subject='Re: bug? Newline inserted when referencing a block result with ":cache yes" in a "noweb" reference' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


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