From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id uJ55BylVDGRoGwEASxT56A (envelope-from ) for ; Sat, 11 Mar 2023 11:17:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id EFqJBylVDGTfiwAA9RJhRA (envelope-from ) for ; Sat, 11 Mar 2023 11:17:13 +0100 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 BB247BB5F for ; Sat, 11 Mar 2023 11:17:12 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Iuil2Ahg; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678529832; 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=eG9IcsU2927+xbGQeB1meIThtxLJKAuLxdsNLcbe1JA=; b=tS10FbfPSGeLieGtAaUlnbhnyU674JvSUzdUt1MgVk3p4L7kMIj2Qi/M+7lf2E+rftUANc RN1RzInJsjxFQX/tnn89d4/zb2lGte8G+1Vr1Z00o3odRdECvdQV0H3Hw5ajJw8tbkcBzT Se0ipZI/1MaY74Td4IHaj3Sh9laGWd31rN5asD3E8rhRNuR3XDkLvWuZmLGV256Zpu/Pp5 Mkmo33x8R8JBddH6y4RTSVzt97TPnVEazwrxuvkViXijC71kqFWJ+Lf8kGPjOAPeX/hAnm h1Xt7gJQ6D7OHvkhxYu3MpF91GyrkLbN6gq7CzmvUeF/G60q3LOFGjOkVnNpWw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Iuil2Ahg; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678529832; a=rsa-sha256; cv=none; b=NkAHr+Zo1zUA/qdQBkXtro5y14zWWjwzsFEqKrx85kUMkqzD9TVPFUnnUfb8nArATiSdz9 X5QbE62mIW15BV7TaKL0XZhqA6s7b+X6mGIZ0AgFUX5NoNWht6pe72vrHX8G1RKGAFLXo0 yUtVqaoQsKoOMEl/KQhdS88JJtg47NKTRLVnaJGhmTl1qjxW8U1CMR/AMiNlu/JcdDevSj KzQXLZNgTcCAvuhGRCUmAFgGKs6EXu+/3E5AAeZEQbf2iX8HTWcNzOxV8tRJmabgEiBEeL 2eX7gEJb0kAX56x2+VlI8NICaMrb65k8XHD7lyrzEPvgoLIsSDYUZMge+QHGHQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pawHN-0007mr-0j; Sat, 11 Mar 2023 05:16:45 -0500 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 1pawHK-0007l0-OI for emacs-orgmode@gnu.org; Sat, 11 Mar 2023 05:16:43 -0500 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 1pawHI-0003TG-Ka for emacs-orgmode@gnu.org; Sat, 11 Mar 2023 05:16:42 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 3E8352402B9 for ; Sat, 11 Mar 2023 11:16:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1678529799; bh=kAG0EFUiOqWIcWilVj7Lw3O472xPH/zmtRDucNITWw4=; h=From:To:Cc:Subject:Date:From; b=Iuil2AhgeOnfD++bWH1nLRL5A15IkZdLVOjGrbJIWLWQYJz8qiBaImrlPd27jnQUj KOnwl6lHhVIKpNSaHAYRyKDcKK31Ak7Q9b/8cOB30FJgMh2J8FqHg66lFG7LytbVkp 6oAvRdgz0A+jBjbcQNnD9Jo7fhW31DXuk97qn3XDUEQ8kxQ570LSq92DwaSbRn/8EJ ygoSPQMueiq6mNo4pW4uVb8IeDidioZ7oJSETmpmn18pGEf1z0j23zSFXg92gqHx6p 7lfJaKT2CuNlhfI9kUjem0S0G1hFd0T6AaOYLLj05ps4bBnJYeR3am50wQY4VpxE7v yO9wpjrgxmPRw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PYf3B5KmRz6tn5; Sat, 11 Mar 2023 11:16:38 +0100 (CET) From: Ihor Radchenko To: Zelphir Kaltstahl Cc: Bruno Barbier , emacs-orgmode@gnu.org Subject: Re: org-babel guile source block bug in handling multiple values In-Reply-To: <46e6f579-9eca-e1da-06ea-f2478a603c5a@posteo.de> References: <9eab60bc-9b82-e037-d63b-3d879573ae32@posteo.de> <87v8jceihi.fsf@localhost> <7fc63848-d6d3-80e0-ae78-00967990813d@posteo.de> <64079614.170a0220.5a0d3.0a23@mx.google.com> <97ee254e-72d2-2bdf-e026-78bde076f1f9@posteo.de> <6408e424.5d0a0220.8862a.2a62@mx.google.com> <87sfeeoysf.fsf@localhost> <46e6f579-9eca-e1da-06ea-f2478a603c5a@posteo.de> Date: Sat, 11 Mar 2023 10:18:10 +0000 Message-ID: <875yb7y4kd.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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_H2=-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: X-Migadu-Queue-Id: BB247BB5F X-Spam-Score: -11.50 X-Migadu-Spam-Score: -11.50 X-Migadu-Scanner: scn0.migadu.com 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-TUID: UGABSyzruCL8 --=-=-= Content-Type: text/plain Zelphir Kaltstahl writes: >> This is expected. Noweb includes the src block code without altering it. >> See 16.11 Noweb Reference Syntax >> >> We may probably clarify this in the manual. Would it be helpful? > I think it would be helpful. I merely tried Python, because it was at hand and > because I did not find ob-racket in M-x package-list RET and did not have > another Scheme installed. Cannot say, whether others find the behavior confusing > or not, but I imagine I would find it helpful, if it was mentioned in the docs. See the attached tentative patch. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-manual.org-Explain-that-noweb-expansion-does-not.patch >From 26763df7de8f742e76f10f2e7603ed290b97df65 Mon Sep 17 00:00:00 2001 Message-Id: <26763df7de8f742e76f10f2e7603ed290b97df65.1678529850.git.yantar92@posteo.net> From: Ihor Radchenko Date: Sat, 11 Mar 2023 11:16:23 +0100 Subject: [PATCH] org-manual.org: Explain that noweb expansion does not carry over :var * doc/org-manual.org (Noweb Reference Syntax): Provide an example explaining that :var header arguments are not in effect when expanding noweb reference. Reported-by: Zelphir Kaltstahl Link: https://orgmode.org/list/46e6f579-9eca-e1da-06ea-f2478a603c5a@posteo.de --- doc/org-manual.org | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/doc/org-manual.org b/doc/org-manual.org index 1c97d6aa8..2c3ec46a4 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -19117,6 +19117,32 @@ ** Noweb Reference Syntax ,#+END_SRC #+end_example +Note that noweb expansion does not automatically carry over =var= +header arguments. In the following example, attempting to evaluate +the second code block will give an error, because the variables +defined in the first code block will not be defined in the second +block. + +#+begin_example +,#+NAME: get-prompt +,#+BEGIN_SRC emacs-lisp :var prompt="root> " :var command="ls" + (concat prompt command) +,#+END_SRC + +,#+RESULTS: get-prompt +: root> ls + +,#+BEGIN_SRC emacs-lisp :noweb yes + <> +,#+END_SRC + +The previous block is expanded to + +,#+BEGIN_SRC emacs-lisp + (concat prompt command) +,#+END_SRC +#+end_example + You may also include the contents of multiple blocks sharing a common =noweb-ref= header argument, which can be set at the file, subtree, or code block level. In the example Org file shown next, the body of -- 2.39.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--