[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] Reference chains (C refers to B refers to A) in tangle do not
From: |
C. M. Sperberg-McQueen |
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/)] |
Date: |
Tue, 21 May 2024 07:55:28 -0600 |
User-agent: |
mu4e 1.6.10; emacs 28.2 |
Thank you for the response. I am sorry to say I do not understand it.
You say that non-expansion of references in the code block Baker is
expected "when it does not have :noweb tangle".
> ... 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.
The problem I am reporting is that the <<...>> in the code of Baker are
treated literally even when Baker DOES have :noweb tangle.
Thanks.
Michael Sperberg-McQueen
Ihor Radchenko <yantar92@posteo.net> writes:
> "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com> 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
>> <<Able>>
>> 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
>> <<Baker>>
>> 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 - <<Baker>>. 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.
--
C. M. Sperberg-McQueen
Black Mesa Technologies LLC
http://blackmesatech.com