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)

2022-08-30 Thread Ihor Radchenko
Sébastien Miquel 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

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)

2022-08-29 Thread Sébastien Miquel
Hi Ihor, I've implemented this proposal in the patch attached. Does it look good to you ? -- Sébastien MiquelFrom b1b783dc80821b07937ac4211ec28df8726fff1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Sat, 13 Aug 2022 20:49:27 +0200 Subject: [PATCH] New babel syntax

Re: [FR] 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)

2022-07-22 Thread Ihor Radchenko
Sébastien Miquel writes: > The uses are maybe too niche to warrant the breaking change. A syntax > extension like > : var=block-id[] > seems possible, even though brackets are already overloaded. This sounds better. Using brackets will actually make a lot of sense. Currently, we have roughly

Re: [FR] 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)

2022-07-17 Thread Sébastien Miquel
Hi, Ihor Radchenko writes: > Hmm. You are right. I missed "optionally". > > Still, I find this idea as the best solution for people who want to > process the source block text during noweb expansion. > > Alternative ideas are welcome though. I'd prefer to avoid breaking > change if we can find

Re: [FR] 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)

2022-07-16 Thread Greg Minshall
Ihor, > Alternative ideas are welcome though. I'd prefer to avoid breaking > change if we can find an equally simple syntax alternative to assign > source block code to a variable. my two cents would be to avoid the breaking change. (i notice, for example, that i use this construct in some of

Re: [FR] 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)

2022-07-16 Thread Ihor Radchenko
Greg Minshall writes: >> The current behaviour of :var foo=name-of-src-block is assigning result >> of evaluation. However, this behaviour is actually not documented. >> 16.4 Environment of a Code Block section of the manual only documents >> uses like > > in fact, the text of the info page (on

Re: [FR] 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)

2022-07-16 Thread Greg Minshall
Ihor, > The current behaviour of :var foo=name-of-src-block is assigning result > of evaluation. However, this behaviour is actually not documented. > 16.4 Environment of a Code Block section of the manual only documents > uses like in fact, the text of the info page (on my system?) says > code

[FR] 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)

2022-07-16 Thread Ihor Radchenko
Sébastien Miquel writes: > Ihor Radchenko writes: >> Can you provide more concrete examples? >> >>> Some drawbacks: >>>  + doesn't work for all languages (does work for LaTeX) >> Which languages do not work? > Most languages do not work. Using your proposed solution, what I'm > trying to do is

Re: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments

2022-05-31 Thread Sébastien Miquel
Hi, Ihor Radchenko writes: Can you provide more concrete examples? Some drawbacks:  + doesn't work for all languages (does work for LaTeX) Which languages do not work? Most languages do not work. Using your proposed solution, what I'm trying to do is #+name:javascript-header #+begin_src

Re: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments

2022-05-30 Thread Ihor Radchenko
Sébastien Miquel writes: >> #+name: documentation >> This is a sample function documentation. >> Because there are "quotes", it must be escaped and cannot be directly >> used as noweb-reference. >> >> #+name: doc-escape >> #+begin_src emacs-lisp :var str="" :tangle no >> (prin1-to-string

Re: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments

2022-05-30 Thread Sébastien Miquel
Hi, Ihor Radchenko writes: Thinking about the whole idea of :noweb-trans more, I see little benefit compared to something like: #+name: documentation This is a sample function documentation. Because there are "quotes", it must be escaped and cannot be directly used as noweb-reference. #+name:

Re: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments

2022-04-30 Thread Ihor Radchenko
Sébastien Miquel writes: >> Other than :noweb-trans, the patch looks good for me. > Here's a patch with only the :noweb-prefix part. If applied, we can mark > this thread resolved. Thanks! Applied on main as 2063596b9. > Ihor Radchenko writes: >> #+name: documentation >> This is a sample

Re: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments

2022-04-30 Thread Sébastien Miquel
Ihor Radchenko writes: #+name: documentation This is a sample function documentation. Because there are "quotes", it must be escaped and cannot be directly used as noweb-reference. #+name: doc-escape #+begin_src emacs-lisp :var str="" :tangle no (prin1-to-string (string-trim-right str))

Re: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments

2022-04-30 Thread Ihor Radchenko
Sébastien Miquel writes: > at least as long as you're tangling to a programming language, that > can read lisp strings. >> Consider the following example: >> >> #+BEGIN_SRC emacs-lisp :noweb yes :tangle yes :noweb-prefix no :noweb-trans >> prin1-to-string >> <> >> (setq latex-header <>) >>

Re: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments

2022-04-29 Thread Sébastien Miquel
ébastien Miquel From 99d043b9d837a2658e60fb4b4913454d9566519b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Mon, 6 Sep 2021 18:45:42 +0200 Subject: [PATCH] ob-core.el: Add `:noweb-prefix`, `:noweb-trans` babel header arguments * lisp/ob-core.el (org-babel-expand-noweb

Re: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments

2022-04-28 Thread Ihor Radchenko
Sébastien Miquel writes: > The attached patch adds support for two new babel header arguments: > =:noweb-prefix= and =:noweb-trans=. > > =:noweb-prefix= can be set to =no= to disable the noweb prefix > behaviour, where prefix characters are repeated when expanding a > multiline noweb reference.

[PATCH] Add :noweb-prefix and :noweb-trans babel header arguments

2022-01-15 Thread Sébastien Miquel
adf038d245fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Mon, 6 Sep 2021 18:45:42 +0200 Subject: [PATCH] ob-core.el: Add `:noweb-prefix`, `:noweb-trans` babel header arguments * lisp/ob-core.el (org-babel-expand-noweb-references): Add support for `noweb-prefix'