From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?S=C3=A9bastien_Gendre?= Newsgroups: gmane.emacs.help Subject: Re: Using Org-mode for literate Emacs configuration with use-package Date: Mon, 15 Jul 2024 19:17:10 +0200 Message-ID: <87o76yshgp.fsf@k-7.ch> References: <87le2acq2f.fsf@k-7.ch> <87ikx9pdet.fsf@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16067"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.12.1; emacs 29.4 Cc: GNU Emacs text editor To: Ihor Radchenko Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 15 19:17:37 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sTPKS-0003xp-LS for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 15 Jul 2024 19:17:36 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTPK8-0005EY-Bv; Mon, 15 Jul 2024 13:17:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTPK7-0005AY-9p for help-gnu-emacs@gnu.org; Mon, 15 Jul 2024 13:17:15 -0400 Original-Received: from k-7.ch ([185.31.100.96]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTPK5-0008AT-NH for help-gnu-emacs@gnu.org; Mon, 15 Jul 2024 13:17:15 -0400 Original-Received: from van (_gateway [192.168.1.1]) (Authenticated sender: seb) by k-7.ch (Postfix) with ESMTPSA id B7002E813D; Mon, 15 Jul 2024 19:17:10 +0200 (CEST) In-Reply-To: <87ikx9pdet.fsf@localhost> (Ihor Radchenko's message of "Sat, 13 Jul 2024 14:36:10 +0000") Received-SPF: pass client-ip=185.31.100.96; envelope-from=seb@k-7.ch; helo=k-7.ch X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147225 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thank you very much. So, you can make a reference to a block of code who is defined below=C2=A0? 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 writes: > S=C3=A9bastien Gendre 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 o= f 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=C2=A0? How do you manage this problem=C2=A0? > > You can make use of noweb expansion: > > * Org config > > #+begin_src emacs-lisp :tangle yes :noweb yes > (use-package org > :config > <> > ) > #+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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQI/BAEBCAApFiEEaA9vw9ypVj1kP0tAtYb3x3I54p4FAmaVWZYLHHNlYkBrLTcu Y2gACgkQtYb3x3I54p4LWQ//VHu8KeHwkJ06xLUVNQJsznoQJdJSsxzdsm9hPMwG 9MXLPDqUXzxu0gmk1433197cPK93G9+Rrx57Sln3lALwZqPRbMb11r9eMS4NEh+m jkmM4mHSpGV8z96SAMHStL9NLQ3RcXx9Hi3frAaqIwN3W+L2iX0I4rkGD1rv2ryW wnRvXuNoB2uBgiuY+b5scudG7+DnMHl1f9LnmLZ5HmLfXteQDI/IhcTN7fJTEWXB a/cqshmSx19ytJYFEfqe/vkhDG1Rk3Bia8oWr/lt8Thk6O/avUdbi/L7ypVy2AH0 3ftbcyKyxxx2oQhHiZyVLsrt5wSkedoZSE6e+z/+syt7305/gFFKiRGR1GgxrN6E 37ClEohrnaMgrmJe7jtCO78mWUZBTCNYyzae2uZzaxfL3ngaCZH8RMrMZy9wdZhr VsUe6z4bkOPALC0Ov7COfa0aaDfX/wiGHX02a5AYViGVXTBiiBlPCHhOxIsIVuWh YzKkLTePY3KBRvs78/NWxFbSsC89QXfyOdwQgSBJu135zLK0xT+lMosSZl7dErVf +kXYiECYqk6iUISJ8im7xekiGQxC3sgU/el6SZAkzQbopn2siJIHcQw5vD37IxbJ UPKBzI2Mb5jaiyPs2TTTi2YHmXo4/+BVQn/YE6A4lJrJapNIl+dKLciHhOguiSky 5W4= =8dvK -----END PGP SIGNATURE----- --=-=-=--