emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FR] Add whitespace option for :noweb-prefix


From: Chen Mingzheng
Subject: [FR] Add whitespace option for :noweb-prefix
Date: Mon, 25 Mar 2024 17:01:36 +0800

Hi


For :noweb-prefix of noweb feature, now we have "yes" or "no" option.
Can we add a new "whitespace" option so that we can:

Giving following fragments,
  #+begin_src elisp :noweb-ref varable-bindings
  (a 0)
  (b 1)
  #+end_src

  #+begin_src elisp :noweb-ref do-something
  `(,a ,b)
  #+end_src

we use the "whitespace" option here
  #+name: a-fragment
  #+begin_src elisp :noweb yes :noweb-prefix whitespace
    (let (<<varable-bindings>>)
      <<do-something>>)
  #+end_src

to produce the follow code:
  #+begin_src elisp
  (let ((a 0)
        (b 1))
    `(,a ,b))
  #+end_src


Here is a try:
  #+begin_src elisp :exports results :wrap src elisp
  (org-babel--expand-body (org-babel-lob--src-info "a-fragment"))
  #+end_src
BTW, I'm curious if there's an public API that can output the code expansion of 
an noweb src block by it's name like above?


Best regards,

Chen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]