[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Make :var foo=name-of-src-block assign the source block code
From: |
Ihor Radchenko |
Subject: |
Re: [PATCH] Make :var foo=name-of-src-block assign the source block code instead of currently assigned result of evaluation (was: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments) |
Date: |
Wed, 31 Aug 2022 12:04:49 +0800 |
Sébastien Miquel <sebastien.miquel@posteo.eu> writes:
> I've implemented this proposal in the patch attached.
>
> Does it look good to you ?
Thanks! The patch looks mostly fine.
Applied onto main via 72f66ca0b.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=72f66ca0b9d336e0da61b17cbe8ce183eef364dd
A small side effect of the patch is that name[] will also work for
lists:
#+name: test
- one
- two
- three
#+begin_src emacs-lisp :var x=test[]
(message "%S" x)
#+end_src
#+RESULTS:
: (("one") ("two") ("three"))
which is not intentional, but does not break anything and also somewhat
logical.
#+begin_src emacs-lisp :var x=test[1:2]
(message "%S" x)
#+end_src
#+RESULTS:
: (("two") ("three"))
worked in the past anyway, despite not being documented.
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92