[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Support for whitespace prefix for :noweb-prefix
From: |
Doerthous |
Subject: |
Re: Support for whitespace prefix for :noweb-prefix |
Date: |
Fri, 29 Mar 2024 10:55:19 +0800 |
Ihor Radchenko <yantar92@posteo.net> 于2024年3月29日周五 03:25写道:
>
> Doerthous <doerthous@gmail.com> 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 (<<varable-bindings>>)
> > <<do-something>>)
> > #+end_src
> >
> > using whitespace :noweb-prefix, the above code will expand to
> >
> > #+begin_src elisp
> > (let ((a 0)
> > (b 1))
> > `(,a ,b))
> > #+end_src
>
> 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))
#+end_src
~(let (~ is the prefix of <<varable-bindings>>.
I thought we can replace just the prefix in current code[1] with
~(setq prefix (replace-regexp-in-string "[^ \t]" " " prefix))~ ?
[1] lisp/ob-core.el (org-babel-expand-noweb-references) @ 9.6.23
- Support for whitespace prefix for :noweb-prefix, Doerthous, 2024/03/28
- Re: Support for whitespace prefix for :noweb-prefix, Ihor Radchenko, 2024/03/28
- Re: Support for whitespace prefix for :noweb-prefix,
Doerthous <=
- Re: Support for whitespace prefix for :noweb-prefix, Ihor Radchenko, 2024/03/29
- Re: Support for whitespace prefix for :noweb-prefix, Doerthous, 2024/03/29
- Re: Support for whitespace prefix for :noweb-prefix, Ihor Radchenko, 2024/03/29
- Re: Support for whitespace prefix for :noweb-prefix, Doerthous, 2024/03/29
- Re: Support for whitespace prefix for :noweb-prefix, Ihor Radchenko, 2024/03/29
- Re: Support for whitespace prefix for :noweb-prefix, Doerthous, 2024/03/29