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

2022-05-30 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 j

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 (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 func

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)) #+end_s

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

2022-04-29 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 <>) >> #+END

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

2022-04-29 Thread Sébastien Miquel
Hi, Ihor Radchenko writes: prin1-to-string is too specific and only solves a single use-case. prin1-to-string is actually universal in a way, since any other manipulation can then be achieved with : (setq var (do-something <>)) at least as long as you're tangling to a programming language, th

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.