From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id eEsbJs2OTGbZdgAAA41jLg (envelope-from ) for ; Tue, 21 May 2024 14:08:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id CGnUHs2OTGaIigAA62LTzQ (envelope-from ) for ; Tue, 21 May 2024 14:08:45 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="X/95hQp5"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716293325; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=YNWP5YxGKrYwxjR4oau0jEDUksmJWLBQXPm/CwXCYX0=; b=NF++bSwmLSYPjsl5eKBai7CYmaNkPG23FSAouyx0/Ao/Ca51Ge/BrKMGM1ACdgGCuLWjtD hNFqiRpwPWdrhWdfSNRM6+frWO8382jhXp1FnsDzTyUsv1XshoxkhQ6huA8Qc8WSfKoU97 uSLORt95IfMyrG6uiAjx9K6L+59B0o+bi38ZyQDfkF5Rlswhte36fPEw+4zGR30FwyrQ8n hUxqdGCZ0tXkPSTQhMc4q8bHA2JOKQ4S6c2h4u3QTFzTonA0spCGdcr0QftZpFbD7k6/Fv IaAsEWUW72lIgh1gdKL5MaddJLWpyByjMbKxNKHkiwQvEZYQIJc2bTfaUFiO1Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="X/95hQp5"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716293325; a=rsa-sha256; cv=none; b=KIV/+X34iQ086CF5LsbKDvx1+k5wOeOAwM2Rm0pROUxG8Bl6eIAcmEzR8OZaGiXjo2tWPD F6vyocL1zYm22CwAgi4rbGevWvCj6mRZzqnV+xEl+NN6e1QfLg52IoR9XRv80XTZ4OoPpe tIlilPYCCpJorXiOUKn/ReB0S8LPGqFqBYeXd1UnFAy+fNBL+zjbILLdQbaWJG1ZFWVQrN TWG9lggZxEAsEW4QR2XIeqR5FEYZdjBQR5/pygqYVIModnZws3jXic0LArQYLIeEoITFS+ PSYbWXNgCmtjypu2fq8eaZoGZWBR9GjTDs1ctaeVLINcqvbvf+zdiXYTwGAmVQ== 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 4A91775972 for ; Tue, 21 May 2024 14:08:45 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9OHV-0001yX-HN; Tue, 21 May 2024 08:07:50 -0400 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 1s9OHS-0001y7-B4 for emacs-orgmode@gnu.org; Tue, 21 May 2024 08:07:46 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9OHP-0005fW-CF for emacs-orgmode@gnu.org; Tue, 21 May 2024 08:07:45 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 9466C240101 for ; Tue, 21 May 2024 14:07:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1716293259; bh=NDLZIEbGmWg9hJk3llOYWCOJEg7vRrm1TENyKETCQfI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=X/95hQp5eesvojyiaINAZCQ9eoS7l4HBMYix14K2LF+5izqG5JY5XwcEPbWmnuC44 EKUNJG+VIx06PgMC3cz6w9xsV1cdvxZivYLHxrK45F6x0px4pTC9a4o0fXt7nkW97q zJ61JzJ4L57kI6DonUfKgIzjur20MFS2vFaOV9RYwDJGqD+ejoiBX6n+fJnXM1gNfV xvhPRb07ZUHVAj6UZ3rs5wHrSC0+mxE2cKdTnFcY0z0vR841lN6XT1KTOU8ABjv6jJ CAlCQjoA4z5g/9v2gMh3CWF5RcEHjN3cprMklBCQ5/r9vku5YWtZFzEOF9xNA0w68y iqfp9PNGLEcYQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VkCqZ69Ycz9rxF; Tue, 21 May 2024 14:07:38 +0200 (CEST) From: Ihor Radchenko To: "C. M. Sperberg-McQueen" Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] Reference chains (C refers to B refers to A) in tangle do not behave as expected [9.5.5 (release_9.5.5 @ /usr/local/share/emacs/28.2/lisp/org/)] In-Reply-To: <87jzjov2ll.fsf@blackmesatech.com> References: <87jzjov2ll.fsf@blackmesatech.com> Date: Tue, 21 May 2024 12:09:22 +0000 Message-ID: <87seybicy5.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.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: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -9.54 X-Migadu-Queue-Id: 4A91775972 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.54 X-TUID: /77u4k8RHRLc "C. M. Sperberg-McQueen" writes: > Consider the following literate program in org mode: > > ................ make-abc.org: > #+title: Minimal example > #+date: 20 May 2024 > > The first letter is A. > #+name: Able > #+begin_src txt > A is for application. > #+end_src > > The second letter is B. It follows A. > #+name: Baker > #+begin_src txt :noweb tangle > <> > B is for beta-tester. > #+end_src > > The third letter is C. We'll stop here. > #+name: Charlie > #+begin_src txt :tangle abc.txt :noweb tangle > <> > C is for coder. > #+end_src > > Bottom line: two-level inclusions work only if the middle layer (here, > /Baker/) has ~:noweb yes~. Using ~:noweb tangle~ on /Baker/ produces > the same results as using ~:noweb no~. Yes, and it is expected. > ... > In the org-mode manual [1], the meaning of :noweb tangle is described > as: "Expansion of noweb syntax references in the body of the code block > when tangling. No expansion when evaluating or exporting." I think that > running org-babel-tangle counts as tangling, so I expect the noweb > syntax references inside of code block Baker to be expanded. They are indeed expanded - there is a single noweb reference in Charlie block - <>. It is expanded to the code contained in the Baker block. When retrieving the code for Baker block, Org mode goes to that block and cleans up its text according to that block's expansion. However, for Baker block, when it does not have :noweb tangle, the <<...>> in the code are treated literally. In other words, each noweb reference is expanded in its own context, according to each block's own header arguments. Not a bug. Canceled. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at