From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id aKgLJVmXjGMAUQAAbAwnHQ (envelope-from ) for ; Sun, 04 Dec 2022 13:49:29 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id SOIkJFmXjGMM3AAAG6o9tA (envelope-from ) for ; Sun, 04 Dec 2022 13:49:29 +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 55704403EF for ; Sun, 4 Dec 2022 13:49:29 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1o9x-0004zX-SA; Sun, 04 Dec 2022 07:31:54 -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 1p1o9w-0004zP-2Q for emacs-orgmode@gnu.org; Sun, 04 Dec 2022 07:31:52 -0500 Received: from love.tolo.nu ([2a02:750:7::116]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p1o9t-0001Cv-CT for emacs-orgmode@gnu.org; Sun, 04 Dec 2022 07:31:51 -0500 Received: from nils.tolo.nu (unknown [172.18.0.3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by love.tolo.nu (Postfix) with ESMTPS id E406940224C1; Sun, 4 Dec 2022 13:31:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=toloe.se; s=mail; t=1670157102; bh=8ARUDEc0Rji+coMyuuNsRkIGgdyUEM8Wlyo8whgseb0=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=TLTE2eFWu3G1HHhxpTreb+X8LSL1tM6YfCYMOwsVmtOtU+UYVQLQTzGvg0KWRfXWF vbC5LukLwNGx24FZq77l3AR8TU2VGmLOhBERhflXuwacpeehKQiSu76V7Nr/LzE9v6 nCvyDUhYwXHAhLzV29Ck51n2PeuA4eij3a79+l2M= Received: by nils.tolo.nu (Postfix, from userid 1000) id A731A4C26A6; Sun, 4 Dec 2022 13:31:41 +0100 (CET) References: User-agent: mu4e 1.8.11; emacs 30.0.50 From: Johan =?utf-8?Q?Tol=C3=B6?= To: Henrik Frisk Cc: Bill Burdick , emacs-orgmode@gnu.org Subject: Re: Adding #+name to result block in babel Date: Sun, 04 Dec 2022 13:25:28 +0100 In-reply-to: Message-ID: <871qpfnydu.fsf@toloe.se> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a02:750:7::116; envelope-from=johan@toloe.se; helo=love.tolo.nu 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, SPF_HELO_PASS=-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-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670158169; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=L1eaS1/9ra0FEDVp4TiIl1kVYYfJtpqlhBaAs7PPX50=; b=BcVd3KLw0CvW8WBW3HqL5RoKn44YcEYUtowra+VTMtNXSPz2Dz4I6l0dGRnKjJqlNUbvKb njIKiOL0dTAMa7PNyVcImZNTUPnha41oQFfTH0kayoBFf3CePXa7g5/IrMzOF8+D5Av8n2 wkD4BvMGEvXI+/se+td37NCplcdmKAp7JHAo2rORdvsLs5jdYBcjvq8S5PSUWPu1gpCd1c gt1Z/ZZBOjuGNuRrevEl5eib7Rno4hgKVV0JGAcPDHqR1o333PvaEtKLpCScc7KJOe89WS nQ50aZDwL3rkHIltqrN0U8h1HeLEo5bGYh8B1a523kV97A7bfMQVDwcQ1xzGEQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670158169; a=rsa-sha256; cv=none; b=eGdJDtgLzW/VHNJ4v1EeTWr6ChSiqFirksjjwAAo24SP69r5FKpMA/tEPbN3Ci1NpayGOp XziDp69EaZz4cxGMmmX/iAmLdgnFH2C0euZAA88lvCX4EsVnF4IW1fjCQXyk2Pll3+bkcL FKhzfyQCuZ4urLWZF2CLJOq8/s63U9EGIEjvn6nwH/Y18y0WtQUdEAlulB14EUwlUc+IKa 0g0AsNQiQzM90A+V6aaahATGi2dCZyIx2i18qT9CzzaNESHXYUyD248RaV8oOasVwtepMx TBQdykIyc9hrVqaSuZ6GqVHiYo2u2GBS5BZpdgCzWJuzvsURYfSFbfjMS+JU6A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=toloe.se header.s=mail header.b=TLTE2eFW; dmarc=fail reason="SPF not aligned (strict)" header.from=toloe.se (policy=none); 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" X-Migadu-Spam-Score: 7.73 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=toloe.se header.s=mail header.b=TLTE2eFW; dmarc=fail reason="SPF not aligned (strict)" header.from=toloe.se (policy=none); 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" X-Migadu-Queue-Id: 55704403EF X-Spam-Score: 7.73 X-Migadu-Scanner: scn1.migadu.com X-TUID: LNBleR/9x2An Henrik Frisk writes: [snipped] >> Then you can use the result like this: >> >> #+begin_src sh :var value=3Dmy_result >> echo $value >> #+end_src >>=20=20=20=20=20=20 >> #+RESULTS: >> : hello >> This does not use the result but rather reevaluates the=20 "my_result" code block. > Thank you! That was good to be reminded of, but I should have=20 > been more explicit in my first email. I'm working with a=20 > language (sclang) > that for various reasons does not have support for variables in=20 > this way. The only option I have to include the results from one=20 > block is by > using a noweb referens: > > #+begin_src shell > echo "Hello" > #+end_src > > #+RESULTS: > #+name: my_result > : Hello > > #+begin_src sclang :noweb yes > <> > #+end_src You could try adapting the examples for using :post at the end of:=20 https://orgmode.org/manual/Results-of-Evaluation.html But in my (limited) experience it is difficult to get the output=20 right. Another suggestion is to use a templating system for generating=20 the src block and include the #+name: part in the template. I use=20 yasnippet for this. --=20 Johan Tol=C3=B6