From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id esA9Lu8L5GAb4QAAgWs5BA (envelope-from ) for ; Tue, 06 Jul 2021 09:53:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 6BxoKe8L5GBOIwAAB5/wlQ (envelope-from ) for ; Tue, 06 Jul 2021 07:53:19 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 139522599F for ; Tue, 6 Jul 2021 09:53:19 +0200 (CEST) Received: from localhost ([::1]:39032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0ftN-0000gG-27 for larch@yhetil.org; Tue, 06 Jul 2021 03:53:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0fsq-0000Vg-4M for emacs-orgmode@gnu.org; Tue, 06 Jul 2021 03:52:44 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:44628) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0fsn-0001bg-Py for emacs-orgmode@gnu.org; Tue, 06 Jul 2021 03:52:43 -0400 Received: by mail-pl1-x631.google.com with SMTP id a6so616876plh.11 for ; Tue, 06 Jul 2021 00:52:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=ShQgVpCThDUjKF+XuC3Uv/+J57vAy08GKt9VmxX1dE4=; b=PFAFj+dobLwmv15yT8ewsTEUwR7pQHrPv9pItlroOtVgsdDq1o/g5GdINlQQr7gK/U nIHM2LxVVu1gPpaqanzOA3GxlWwZ6MwcIV8t+NtThFGwbN4PWNWgvOT1pBgmQQ0uu7nY ySeHpeGfVYL2pNOQ6e14pyp0iGIL5Hj8BaOfT17qhpiVulwwMMu1GgN3inrsqo0SnNXw zPKHDpasvYs1neewP/hukffyNAs+VUonXcz400F01m4iUSd2q9w7XjtSkWKdssx9dl/w EtZb+CALUp6U797U8/mx6iOp05qzGXLB1lz8pniH8NqupSfS8z9/Y0blgqWo7RpdraHw kH3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=ShQgVpCThDUjKF+XuC3Uv/+J57vAy08GKt9VmxX1dE4=; b=pmvE5Ip+l2fd9shsu0uTvs6MODHBBTsudkwA2rkePyzqzhvBHCK4b5ClgAjCV7BDkY QMIoJQXgtSokLeTok7LnoTVWG4T4UEEQ+A6cLtv/qMrHV+ijyVDJIrP5HJGWG/9+1rUr 5TqEnUT6wYlE5nFBv3fInS7O22ut2xOlZcyZ8vWGZ34X33ek3rTkaofOf+21fl5ncaCC OpwG1rzLWfnbP4d8h8Mnh1OpdXaXwyAp8ATD1CKgRvk0NKRKc69Qh3pS7RWimSiAbedQ EYRgnWsG2xW5O34gKfRmGG08/gLilWOWnfd6wsdtoM76nSYpkre4hVFUPFnjkcSGqKK9 8pVQ== X-Gm-Message-State: AOAM531DlwT8XBpchISteUDRQVsRv4s0mFLHq9ItPRxKsJT4Y4mhu5if 17kb7xGw+AMWgDzuMtoGz6M7JXoL/lY= X-Google-Smtp-Source: ABdhPJx4RjdyXzQ0c6jbGlQMxDfB4s7uG7VIsKZ9Uc1wW8Z9PbJwn0V4EKwyuLvSaVytoB6NfxF7Qw== X-Received: by 2002:a17:90b:3597:: with SMTP id mm23mr3205764pjb.179.1625557958789; Tue, 06 Jul 2021 00:52:38 -0700 (PDT) Received: from tim-desktop (220-235-1-69.dyn.iinet.net.au. [220.235.1.69]) by smtp.gmail.com with ESMTPSA id l6sm15321977pff.74.2021.07.06.00.52.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 00:52:38 -0700 (PDT) References: <-0ZoEP_lzUvrnWSq9TwiYHNJ0Spa94xjiTOF0TU8np0pYgHEPx-62_dr5xBMd3VUu7frSRXxiAFje99v2jeaJg==@protonmail.internalid> <195645.1625546634@apollo2.minshall.org> <1903689.usQuhbGJ8B@bl4ckspoons> User-agent: mu4e 1.5.13; emacs 28.0.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: [PATCH] Allow tangling to a list of files Date: Tue, 06 Jul 2021 17:30:40 +1000 In-reply-to: <1903689.usQuhbGJ8B@bl4ckspoons> Message-ID: <87h7h7nakd.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=theophilusx@gmail.com; helo=mail-pl1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625557999; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ShQgVpCThDUjKF+XuC3Uv/+J57vAy08GKt9VmxX1dE4=; b=EI5CvshpUCdWZh/P5Ev9NfPqvnkdzRkVu3vaM6ai2tHe0lM2Xv20VfOsQVKEibU5gN/RjR 1RvMyMYUQNuXi5NzleYnHwPra9BOEHZgPtHpG9ck7+VPTde4+sshIPN+/h4JzYg9rI/Rbt z5ZOx5oUtPSqLdWnOomwnVehYFl5qhRDioe8nPAtzzInpm/yQJcUiuI1yTet6Zb1vNPTO9 YNbW8pVWxBq4gvaNxF0f75nVzuvT1Zw9JSZysvSVoLfbWSKi2e5N2pVJ+gAje/kF+5hAPZ qUykPT3A28t6T3rju3uUOggZ63jG2mjm1ImMVGHE1aGz6dFnnI9+tMustJNlFA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625557999; a=rsa-sha256; cv=none; b=lt0mSmOGo/P9sZv2Zfd5qtiM6UX3qiALiocrg4WNotdKlwSIe2D5245Q38wmNxM+Yl1AEJ cPW43N13k3DXrr+UJmXxey6F2s8v+2kW92IqEXiXJKTos5RxrxnQLMKFnZORz98zW+ksUp wbivXGXr/UOWT82bcLYjwoJ9tmbHJk+sAlCahynNR2zdu7Rih/Xa63FtfONoeFuS2G/Gtu WDELk5TOWNvuL8WxEY3vs1JP5l5ST4jQitsTr0lmeEZC906xFY5pBYkBbEsEwHCJEwXDs5 H01dhKq4DAbdauK0xF/Fu914/rRyB+Saf1Ua+VeFRqRC1nbWbObvH+rGXvueWA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=PFAFj+do; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=PFAFj+do; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 139522599F X-Spam-Score: -3.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: nVwBmCtQszcD Jacopo De Simoi via "General discussions about Org-mode." writes: > Hi Greg, > > thanks for your comments! > > On Tuesday, July 6, 2021 12:43:54 AM EDT Greg Minshall wrote: >> hi, Jacopo, >> >> i'm not convinced this is needed over and above your old "solution" of >> using <> witn N-different source blocks, each :tangle'ing to a >> different file. > > To be honest I never quite managed to get it work... =) > > My point here is to be able to have one org file tangle'ing to several, > slightly different outputs. Ideally I want to use one readable literate config > for all my machines; the config can then be published (or exported) to html > > Say I want to create an org file to tangle .tmux.conf (or .zshrc) for different > machines; then most of the conf file would be the same (and each such block > would be tangled to all files) whereas some specifics could be tangled to > corresponding files only (e.g. ALIASes or EDITORs) > > Even if a solution using noweb could work, I find being able to tangle to a > list of files more readable and elegant. Especially when exporting the org in > an external format, I think the noweb solution would look like a hack, whereas > a solution with tangle-to-list would be much easier to parse. > >> >> but, i'm curious -- in the example you sent, did you miss a ":tangle" on >> the "#+begin_src" line? > > Yikes! of course I did! Good catch. >> >> > #+begin_src sh '("filename1" "filename2") >> > #my script >> > #+end_src >> I'm not sure I fully understand the rationale behind this patch. It seems to be very niche oriented and not a terribly useful general feature. It feels like it is just a partial solution to a problem (i.e. generate multiple different files from the same org file). If this is the case, then you probably need some additional control structures to determine which bits/blocks go into which files. From what I can see, all the patch is doing is creating multiple files, which I imagine would then need to be modified anyway? If I understand it correctly, all the files will end up with the same content. This seems odd to me. Am I missing something (like some ability to have different contents tangled to different files)? If it is just generating multiple copies of the same file, I don't really see the value. It would be less processing/overhead to just create one file and then copy it (possibly copying it to different locations, such as a tramp filespec). Using the 'devops' style of org files, this could even be coded into a script block which could be executed after tangling. Personally, I've used a different approach to a similar problem. For example, my .zshrc and init.el files have conditional tests which check either the hostname or platform type and set things accordingly. This way, I only ever have one .zshrc and one init.el file for all systems, but they behave differently based on the system they are running on. When the config does not support conditional tests, then I'll have different source blocks included in the tangle. Currently, I just turn off blocks I don't want (:tangle no), but I guess I could do something more sophisticated using noweb or tags, but the manual setting has worked fine so far as I don't have many files requiring this. -- Tim Cross