From: "Sébastien Gendre" <seb@k-7.ch>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: GNU Emacs text editor <help-gnu-emacs@gnu.org>
Subject: Re: Using Org-mode for literate Emacs configuration with use-package
Date: Mon, 15 Jul 2024 19:17:10 +0200 [thread overview]
Message-ID: <87o76yshgp.fsf@k-7.ch> (raw)
In-Reply-To: <87ikx9pdet.fsf@localhost> (Ihor Radchenko's message of "Sat, 13 Jul 2024 14:36:10 +0000")
[-- Attachment #1: Type: text/plain, Size: 1686 bytes --]
Thank you very much.
So, you can make a reference to a block of code who is defined below ?
It's a very nice feature. Org-mode is very amazing. :D Even after many
years of daily use, people still make me discover new features.
Ihor Radchenko <yantar92@posteo.net> writes:
> Sébastien Gendre <seb@k-7.ch> writes:
>
>> Sometimes, I need to split a package configuration into multiple
>> sections of my Org-mode document. For example Org-mode, because I set a
>> lot of settings. By spiting my config, I can correctly document each
>> option and organize it in a more comprehensible way.
>>
>> But with the elisp function `(use-package)`, I need to join each package
>> configuration into the call of `(use-package)` function. Which prevent
>> me from splitting my config into Org-mode sections.
>>
>> 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 ?
>
> You can make use of noweb expansion:
>
> * Org config
>
> #+begin_src emacs-lisp :tangle yes :noweb yes
> (use-package org
> :config
> <<org-settings>>
> )
> #+end_src
>
> ** Actual config
> :PROPERTIES:
> :header-args: :noweb-ref org-settings :tangle no
> :END:
> *** Agenda files
> #+begin_src emacs-lisp
> (setq org-agenda-files '("/path/to/agenda/files"))
> #+end_src
> *** Startup
> #+begin_src emacs-lisp
> (setq org-startup-indented t)
> #+end_src
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]
next prev parent reply other threads:[~2024-07-15 17:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 19:39 Using Org-mode for literate Emacs configuration with use-package Sébastien Gendre
2024-07-13 13:45 ` John Kitchin
2024-07-15 17:13 ` Sébastien Gendre
2024-07-13 14:36 ` Ihor Radchenko
2024-07-15 17:17 ` Sébastien Gendre [this message]
2024-07-15 17:32 ` Ihor Radchenko
2024-07-13 17:56 ` Dominic Martinez
2024-07-15 17:20 ` Sébastien Gendre
2024-07-15 9:37 ` Rens Oliemans
2024-07-15 17:20 ` Sébastien Gendre
2024-07-16 6:02 ` Björn Bidar
[not found] <87le2acq2f.fsf__13832.1084481262$1720874764$gmane$org@k-7.ch>
2024-07-27 7:47 ` Dilip via General discussions about Org-mode.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o76yshgp.fsf@k-7.ch \
--to=seb@k-7.ch \
--cc=help-gnu-emacs@gnu.org \
--cc=yantar92@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.