[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using Org-mode for literate Emacs configuration with use-package
From: |
Sébastien Gendre |
Subject: |
Re: Using Org-mode for literate Emacs configuration with use-package |
Date: |
Mon, 15 Jul 2024 19:20:00 +0200 |
User-agent: |
mu4e 1.12.1; emacs 29.4 |
Thank you very much for you suggestion.
It's a very nice feature. I will read the manual.
Dominic Martinez <dom@dominicm.dev> 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
> <<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 <<ref>> 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.
signature.asc
Description: PGP signature
- Using Org-mode for literate Emacs configuration with use-package, Sébastien Gendre, 2024/07/09
- Re: Using Org-mode for literate Emacs configuration with use-package, Ihor Radchenko, 2024/07/13
- Re: Using Org-mode for literate Emacs configuration with use-package, John Kitchin, 2024/07/15
- Re: Using Org-mode for literate Emacs configuration with use-package, Dominic Martinez, 2024/07/15
- Re: Using Org-mode for literate Emacs configuration with use-package,
Sébastien Gendre <=
- Re: Using Org-mode for literate Emacs configuration with use-package, Rens Oliemans, 2024/07/15
- Re: Using Org-mode for literate Emacs configuration with use-package, Björn Bidar, 2024/07/16