[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug: ob-python mangles multiline :var values [9.3.6 (release_9.3.6-3
From: |
Jack Kamm |
Subject: |
Re: Bug: ob-python mangles multiline :var values [9.3.6 (release_9.3.6-397-ga089600)] |
Date: |
Sun, 24 May 2020 07:51:39 -0700 |
Hello,
Thanks for reporting. I've just fixed this issue in master (commit
6149b6cb6).
The problem was that ob-python adds tab indentation to the code body
before putting it inside a main() function, which adds spurious
indentation to multiline strings passed through :var.
I fixed the issue by moving variable assignment from the code body to
the code preamble, which is executed outside the main() function.
Best,
Jack
Štěpán Němec <address@hidden> writes:
> Recipe:
> -------
>
> emacs -Q
> M-x load-library RET ob-python RET
> M-x org-mode RET
>
> #+begin_src python :var text="a\nb\nc"
> return text
> #+end_src
>
> #+RESULTS:
> : a
> : b
> : c
>
>
> Commentary:
> -----------
>
> ob-python seems to prepend a TAB character to every line except for the
> first one.
>
> Emacs : GNU Emacs 28.0.50 (build 11, x86_64-pc-linux-gnu, GTK+ Version
> 3.24.14, cairo version 1.17.3)
> of 2020-03-11
> Package: Org mode version 9.3.6 (release_9.3.6-397-ga08960 @
> /home/stepnem/.emacs.d/lib/org/lisp/)
- Re: Bug: ob-python mangles multiline :var values [9.3.6 (release_9.3.6-397-ga089600)],
Jack Kamm <=