Re: Support for whitespace prefix for :noweb-prefix

2024-04-03 Thread Fraga, Eric
Ah, okay. Thank you. -- : Eric S Fraga, with org release_9.6.23-1314-g945046 in Emacs 30.0.50

Re: Support for whitespace prefix for :noweb-prefix

2024-04-03 Thread Ihor Radchenko
"Fraga, Eric" writes: > So it's a combination of no prefix in such a case and the indentation > according to major mode. For me, the latter is not an issue but the > former is. > > (but not really an issue for me as I make sure I only have noweb > references on lines where such a replacement

Re: Support for whitespace prefix for :noweb-prefix

2024-04-03 Thread Fraga, Eric
On Friday, 29 Mar 2024 at 09:43, Ihor Radchenko wrote: > Doerthous writes: >> #+begin_src elisp >> (let ((a 0) >> (let ((b 1)) >>`(,a ,b)) >> #+end_src >> >> ~(let (~ is the prefix of <>. >> >> I thought we can replace just the prefix in current code[1] with >> ~(setq prefix

Re: Support for whitespace prefix for :noweb-prefix

2024-03-29 Thread Doerthous
Thanks, I'll check it out.

Re: Support for whitespace prefix for :noweb-prefix

2024-03-29 Thread Ihor Radchenko
Doerthous writes: > I kind of understand what you mean: what I need is just the no > option, after the expansion (maybe with the help of some > after-expansion-hooks), indent the source block according to > major-mode. Right? > > I will try to find some hooks after expansion and some APIs to >

Re: Support for whitespace prefix for :noweb-prefix

2024-03-29 Thread Doerthous
Ihor Radchenko writes: > I still feel that what you are really looking for is major-mode-specific > indentation, not a prefix. Because indentation may require tabs, not > spaces. Or may interfere with programming language. I kind of understand what you mean: what I need is just the no option,

Re: Support for whitespace prefix for :noweb-prefix

2024-03-29 Thread Ihor Radchenko
Doerthous writes: > Ihor Radchenko writes: > >> I think that a more general approach could be allowing :noweb-prefix to >> have a value of string that will be appended to each line on the >> expansion. > > With the use case discussed before, is allowing :noweb-prefix to have a > value of string

Re: Support for whitespace prefix for :noweb-prefix

2024-03-29 Thread Doerthous
Ihor Radchenko writes: > I think that a more general approach could be allowing :noweb-prefix to > have a value of string that will be appended to each line on the > expansion. With the use case discussed before, is allowing :noweb-prefix to have a value of string means I need to provide a

Re: Support for whitespace prefix for :noweb-prefix

2024-03-29 Thread Ihor Radchenko
Doerthous writes: >> Do you mean that you want the code to be indented according to the major >> mode rules? >> > > Why it relates to major mode, > > Currently, with :noweb-prefix set to yes, the above code will be expand to > #+begin_src elisp > (let ((a 0) > (let ((b 1)) >`(,a ,b)) >

Re: Support for whitespace prefix for :noweb-prefix

2024-03-28 Thread Doerthous
Ihor Radchenko 于2024年3月29日周五 03:25写道: > > Doerthous writes: > > > Can we add a support for whitespace prefix such that the prefix of a > > noweb-ref replaced by whitespace characters? > > > > ... > > #+name: a-fragment > > #+begin_src elisp :noweb yes :noweb-prefix whitespace > > (let (<>) > >

Re: Support for whitespace prefix for :noweb-prefix

2024-03-28 Thread Ihor Radchenko
Doerthous writes: > Can we add a support for whitespace prefix such that the prefix of a > noweb-ref replaced by whitespace characters? > > ... > #+name: a-fragment > #+begin_src elisp :noweb yes :noweb-prefix whitespace > (let (<>) > <>) > #+end_src > > using whitespace :noweb-prefix, the

Support for whitespace prefix for :noweb-prefix

2024-03-28 Thread Doerthous
Hi Can we add a support for whitespace prefix such that the prefix of a noweb-ref replaced by whitespace characters? Here is a use case, #+begin_src elisp :noweb-ref varable-bindings (a 0) (b 1) #+end_src #+begin_src elisp :noweb-ref do-something `(,a ,b) #+end_src #+name: a-fragment