From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.help Subject: Re: Using Org-mode for literate Emacs configuration with use-package Date: Sat, 13 Jul 2024 14:36:10 +0000 Message-ID: <87ikx9pdet.fsf@localhost> References: <87le2acq2f.fsf@k-7.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21581"; mail-complaints-to="usenet@ciao.gmane.io" Cc: GNU Emacs text editor To: =?utf-8?Q?S=C3=A9bastien?= Gendre Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 13 16:35:24 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 1sSdqN-0005T8-T5 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 13 Jul 2024 16:35:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSdpk-0001D9-DA; Sat, 13 Jul 2024 10:34:44 -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 1sSdpi-0001Cl-Qb for help-gnu-emacs@gnu.org; Sat, 13 Jul 2024 10:34:42 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sSdpg-0005k1-Pw for help-gnu-emacs@gnu.org; Sat, 13 Jul 2024 10:34:42 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 889F3240028 for ; Sat, 13 Jul 2024 16:34:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1720881278; bh=Q7lLTVJo7Leu8JuY+i7oPEIcLZXCksn9hULKIvAMPSA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=mrsTWaILfa7jCVjigezgXIJOJU8Gc/V1pL46X6DnJmdywJCtLm/NcGpRr+rI9OyW+ KdngapgQ+rzCCqxK+1I5NQHczLf8OhQORhVYSs6hxFTvjNQKSd6zcX0AJIV1elzX/+ hxkwF8dShcHP8CkYBEGjpAqMx56xzN4czFAyzVvLKjbDbFNhFJTthv+15/zbE8POqL T+xfP/wfGkRrySsQ5O+NKlJjgzgetpOZcP87JUoim2NcOcGfpIR1vsYoYV23MFiNwi M+OpdMa82PJorNJ5zq++Ur4GF0z0dbdOcFPmI+7k2Efl6OKauCzjYNt4OMk2MaAMaF fdXz6YTW2/SDg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WLrZk14ggz6tyl; Sat, 13 Jul 2024 16:34:38 +0200 (CEST) In-Reply-To: <87le2acq2f.fsf@k-7.ch> Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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:147197 Archived-At: 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 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=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 --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at