GNU bug report logs -
#79147
Tangling source blocks with variables using drawer output includes unwanted new line in variable definition
Previous Next
To reply to this bug, email your comments to 79147 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79147
; Package
emacs
.
(Sat, 02 Aug 2025 06:27:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Vincent Koppelmans <vincentkoppelmans <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 02 Aug 2025 06:27:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Tangling a source block that contains a variable from another source block results in an additional incorrect new line at the end of the variable value in the tangled output file, /only/ when source block output type is set to 'drawer'.
Here is a minimal example comparing regular source block output (correct) versus drawer output (error), tested with emacs -Q, GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2025-05-27 and Org 9.7.11:
* Allow org blocks to evaluate shell code
#+begin_src elisp :tangle no :results output none
(org-babel-do-load-languages
'org-babel-load-languages
'((shell . t)))
#+end_src
* Tangle code block with variable input from other source block
** Using regular source block output
*** Source block that generates the variable
#+name: my_temp_dir1
#+begin_src bash :tangle no
echo "/example/path"
#+end_src
#+RESULTS: my_temp_dir1
: /example/path
*** Source block that takes in the variable and which gets tangled
#+begin_src sh :var idir=my_temp_dir1 :tangle test_default.sh
echo "${idir}"
#+end_src
*** Display the tangled block
#+begin_src sh :tangle no :results output drawer
cat test_default.sh
#+end_src
#+RESULTS:
:results:
idir='/example/path'
echo "${idir}"
:end:
Looks okay!
** Using drawer source block output
*** Source block that generates the variable
#+name: my_temp_dir2
#+begin_src bash :tangle no :results output drawer
echo "/example/path"
#+end_src
#+RESULTS: my_temp_dir2
:results:
/example/path
:end:
*** Source block that takes in the variable and which gets tangled
#+begin_src sh :var idir=my_temp_dir2 :tangle test_drawer.sh
echo "${idir}"
#+end_src
*** Display the tangled block
#+begin_src sh :tangle no :results output drawer
cat test_drawer.sh
#+end_src
#+RESULTS:
:results:
idir='/example/path
'
echo "${idir}"
:end:
We have a problem: the closing quote starts on a new line.
Best,
Vincent
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79147
; Package
emacs
.
(Sat, 02 Aug 2025 08:02:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 79147 <at> debbugs.gnu.org (full text, mbox):
> From: Vincent Koppelmans <vincentkoppelmans <at> gmail.com>
> Date: Fri, 01 Aug 2025 12:14:10 -0600
>
> Tangling a source block that contains a variable from another source block results in an additional incorrect new line at the end of the variable value in the tangled output file, /only/ when source block output type is set to 'drawer'.
>
> Here is a minimal example comparing regular source block output (correct) versus drawer output (error), tested with emacs -Q, GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2025-05-27 and Org 9.7.11:
>
> * Allow org blocks to evaluate shell code
> #+begin_src elisp :tangle no :results output none
> (org-babel-do-load-languages
> 'org-babel-load-languages
> '((shell . t)))
> #+end_src
>
> * Tangle code block with variable input from other source block
> ** Using regular source block output
> *** Source block that generates the variable
> #+name: my_temp_dir1
> #+begin_src bash :tangle no
> echo "/example/path"
> #+end_src
>
> #+RESULTS: my_temp_dir1
> : /example/path
>
> *** Source block that takes in the variable and which gets tangled
> #+begin_src sh :var idir=my_temp_dir1 :tangle test_default.sh
> echo "${idir}"
> #+end_src
>
> *** Display the tangled block
> #+begin_src sh :tangle no :results output drawer
> cat test_default.sh
> #+end_src
>
> #+RESULTS:
> :results:
> idir='/example/path'
> echo "${idir}"
> :end:
>
> Looks okay!
>
> ** Using drawer source block output
> *** Source block that generates the variable
> #+name: my_temp_dir2
> #+begin_src bash :tangle no :results output drawer
> echo "/example/path"
> #+end_src
>
> #+RESULTS: my_temp_dir2
> :results:
> /example/path
> :end:
>
> *** Source block that takes in the variable and which gets tangled
> #+begin_src sh :var idir=my_temp_dir2 :tangle test_drawer.sh
> echo "${idir}"
> #+end_src
>
> *** Display the tangled block
> #+begin_src sh :tangle no :results output drawer
> cat test_drawer.sh
> #+end_src
>
> #+RESULTS:
> :results:
> idir='/example/path
> '
> echo "${idir}"
> :end:
>
> We have a problem: the closing quote starts on a new line.
Thanks.
This seems to be a problem with Org, so please report it to the Org
developers first.
This bug report was last modified 7 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.