From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yO4bGdl55GA/KAAAgWs5BA (envelope-from ) for ; Tue, 06 Jul 2021 17:42:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EIPGFNl55GDqPwAA1q6Kng (envelope-from ) for ; Tue, 06 Jul 2021 15:42:17 +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 5414324D5E for ; Tue, 6 Jul 2021 17:42:16 +0200 (CEST) Received: from localhost ([::1]:44368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0nDD-0003UC-Am for larch@yhetil.org; Tue, 06 Jul 2021 11:42:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0mwK-00032A-Q2 for emacs-orgmode@gnu.org; Tue, 06 Jul 2021 11:24:48 -0400 Received: from mail.math.toronto.edu ([128.100.68.68]:55518) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0mwH-0008Na-6D for emacs-orgmode@gnu.org; Tue, 06 Jul 2021 11:24:48 -0400 Received: from bl4ckspoons.localnet (coxeter.math.toronto.edu [128.100.68.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jacopods) by mail.math.toronto.edu (Postfix) with ESMTPSA id A628E4219AF; Tue, 6 Jul 2021 11:24:41 -0400 (EDT) To: Vladimir Lomov Cc: Greg Minshall , emacs-orgmode@gnu.org Subject: Re: [PATCH] Allow tangling to a list of files Date: Tue, 06 Jul 2021 11:24:40 -0400 Message-ID: <4139848.ejJDZkT8p0@bl4ckspoons> In-Reply-To: References: <-0ZoEP_lzUvrnWSq9TwiYHNJ0Spa94xjiTOF0TU8np0pYgHEPx-62_dr5xBMd3VUu7frSRXxiAFje99v2jeaJg==@protonmail.internalid> <3xziDF9qTEWTCnFZdoXRlffWkusi5xR4Rcrp-7A0mXpDHI11TIQoxfgNAoygPMIK52EZ7hZfRpb8YnTDQ4RosA==@protonmail.internalid> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: softfail client-ip=128.100.68.68; envelope-from=wilderjds@protonmail.com; helo=mail.math.toronto.edu X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 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" Reply-to: Jacopo De Simoi From: Jacopo De Simoi via "General discussions about Org-mode." X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625586136; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=s1BxnblnimT2oqM+iLOWXuW3fzTEFh8L9HfA4m/pP7Y=; b=lNigV0IMoJCQQ4aNcRXO8UceHQhPmlq6FUgK13yWMmgpmw3oxtBLFxbe6oTgBuNLh4o5J0 LexnhDNp+ALmfZ4Op9VQa2gUopNJleZ1/bJzzyPc7g5WReWvMcf/t0i/1SbzdxfOpJ3TqE k/7HeevLhkgh0/poPVyZLIP3dRDI8XA/dFg+u+xUZTCAePD7cPukzPNS2a9ZXFUsodlHoD 3mZlmypeIunzzem1GslOj9rKyz6/gZzHDYmblUs9yGDWdquUSIuIqUOuylniwhxSCkQOcC 2CRod6mCV1IOlY1OFj1bq10P/iytKGqnanvq7CF4Z5DYJjbqYZ5C5p7V0VEXLA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625586136; a=rsa-sha256; cv=none; b=sTcfHA97E7UOhBzCHUfO3hoQSnLXbEaXC4rGlbbagZqi1x/t3AetbJl4eJO3vcmdBqhTt+ 7OvdA7+z/w77z57dWOPnduFGdApDVQWLFA5zBZIXiyu/LQ9xn9J/74L/ATnxKOmj4dlNWn Nf3ueaB3mGCpa/riY/X1a1+bcU2DoUwrU0avDCvbcXFSeAkxCeSbGESFAUS6gMbnxGsO0Q vZa0n7IjDWcj3gUdz02C4p3ZBk5WFu9V3XCpUGrd6co0Rp1denhFHhz0ETMOuQgTSGDAKd tZGXCA1Yu869Kj06QwnRspwZ9VdzOqmNjZOT+tacKt8Hv3s4S9d7KtGo1GGQxg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: -1.91 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: 5414324D5E X-Spam-Score: -1.91 X-Migadu-Scanner: scn0.migadu.com X-TUID: eLWMJaQbvjtE Dear Vladimir, thanks for your reply. Let me show you two examples; they are both WIP and incomplete, but you'll get the gist. - Example 1 https://gist.github.com/85c9b9c9ab151c5fd35bd761ef6ef569 This is my literate config for .zshrc; as you can see different blocks are tangled to different set of files; hence the output files differ (as some blocks are present and other are not) - Example 2 https://gist.github.com/2bce5d6df3f04c934fb4beda0c6560ad This is my literate config for xkb maps; I have several keyboards, and some of them require slightly different maps. Once again, likely all this can be accomplished by some noweb magic, but I find my approach much less intrusive (particularly the initial bit in the .zshrc, which I am still refactoring, where the list of tangle targets is inferred from the headline tags) Thanks again for your comments. I'd really like to see how to do the same with noweb and compare my approach with the "standard" one. Once more, I hope these examples clarify my point of view. Best Jacopo On Tuesday, July 6, 2021 2:11:09 AM EDT Vladimir Lomov wrote: > Hello! > > ** Jacopo De Simoi via General discussions about Org-mode. > > [2021-07-06 01:09:30 -0400]: > > 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 > I do the same with 'noweb' feature. > > > 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) > > How this could be solved by your approach by tangling to several files? They > will be identical! > > > Even if a solution using noweb could work, I find being able to tangle to > > a > > list of files more readable and elegant. > > Could you explain this a bit more? How you will see that (assuming you have > exported Org to HTML) this goes into different files? Again, if you tangle > to several files they content will be the same! Then why you need different > files? > > > Especially when exporting the org in an external format, > > > > I think the noweb solution would look like a hack, > > IMHO, yes, this is a hack and the "standard" way. I would suggest to read > again Org manual concerning "Literate programming". > > > whereas a solution with tangle-to-list would be much easier to parse. > > How that? You will tangle source block to several files, they content will > be identical! Or you suggesting to add some syntax for source block > indicating to which file to tangle that code snippet? > > I would recommend you to describe your needs and how you do things right > now. > > [...] > > > Best, > > > > Jacopo > > --- > WBR, Vladimir Lomov