Thank you very much for you suggestion. It's a very nice feature. I will read the manual. Dominic Martinez writes: > On 7/9/24 3:39 PM, Sébastien Gendre wrote: >> I was thinking of writing Org-mode source block with different parts of >> my `(use-package)` call, so I can distribute it into different section of my >> Org-mode document. But in this case, I can no-longer evaluate my >> `(use-package)` call directly from my Org-mode document. >> Do you have any suggestion ? How do you manage this problem ? > > Yes, you can do this with noweb. > > #+begin_src elisp :noweb-ref package-custom > (my-var1 "value") > (my-var2 "another-val") > #+end_src > > #+begin_src elisp :noweb-ref package-custom > (even-more-vars "multiple-blocks") > #+end_src > > #+begin_src elisp :noweb no-export :results none > (use-package my-package > :custom > <>) > #+end_src > > Now use babel to evaluate the use-package source block (C-c C-c) and > noweb references will be inserted during evaluation. > > Some explanation: > - The <> syntax inserts anything source blocks with the same > :noweb-ref value. > - :noweb no-export says to insert noweb blocks on tangle or eval, but > not on export (so your exports stay organized) > - :results none stops the evaluation output from being inserted into > your Org file > > Also see 16.11 Noweb Reference Syntax in the org manual.