* Add new whitespace option for :noweb-prefix
@ 2024-03-25 12:00 Chen Mingzheng
0 siblings, 0 replies; only message in thread
From: Chen Mingzheng @ 2024-03-25 12:00 UTC (permalink / raw)
To: emacs-orgmode
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-28 13:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-25 12:00 Add new whitespace option for :noweb-prefix Chen Mingzheng
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).