From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 GO0uA12EhmOWAwEAbAwnHQ (envelope-from ) for ; Tue, 29 Nov 2022 23:14:53 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id OBIhA12EhmNgCwEA9RJhRA (envelope-from ) for ; Tue, 29 Nov 2022 23:14:53 +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 9148E3E9A9 for ; Tue, 29 Nov 2022 23:14:52 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p08rZ-0008Go-Ts; Tue, 29 Nov 2022 17:14:02 -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 1p08rY-0008G1-BI for emacs-orgmode@gnu.org; Tue, 29 Nov 2022 17:14:00 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p08rV-0001TP-OM for emacs-orgmode@gnu.org; Tue, 29 Nov 2022 17:14:00 -0500 Received: by mail-pl1-x62d.google.com with SMTP id g10so14810608plo.11 for ; Tue, 29 Nov 2022 14:13:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=OpHYraWLafSgLCngD62FdCL4p++XHWgLSZb/gqdNU9k=; b=Z0jUzw2gbX6oX71IZ6VOKoLLri5iDHbpOhzMWYHz3NtmoR4623PmwTaY4DUhMDyaSx 9/0DYn53hxcV0SdTaeO62ohpkUDgNTtXi0VKvvICAMqWFBOw6PApCbgdqJiqS/YpvZ3c t27QHTYF7LT0XLIdkSwhEyz+ljMNxEkqF6l+FwmagoJdzmE0vQA0XJwAK6WK7hzcfGa+ oFEjQY9YX7Z+34eIGHX+X1it/Tl/05gVQeZknObLf2eEvFUSDspk83gkTygpTwl6wV6R EBld8SxRLCwQ3K6LOuZ1qPe0wcessRMb3nuWm00gu95eeMUINNPhf/AAkxLJKTIFqIj+ FIQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OpHYraWLafSgLCngD62FdCL4p++XHWgLSZb/gqdNU9k=; b=umbK7K+PoRZ987/Wai2Itl3LWiYKSn18zjSECLdT3XOnOTvaMenjOfA7y2CBOof85u AK9BAJmJ0xwmHhLFI5MarS8sbb3loqcqnYpA+zadWTEHeC0fIBJXLOS7jTFQX7H9Cht2 nWZbPM52D2r7JjHCd8qDZO1LgrARLAqvoD+JJ583L3Y1OnNcNwaUoh/JHVoBaFoOSKpz 4irYKwZ9NCNlwn8rKxx5hLo2g7Q9BSbFKs3njDsMnnKUi+6afBn2DuPDlbGz1dgg088K 7j/JvfIu4cisahN9ZBQOonJzV9iyYZeV5ViAj4izIUkM7etTEW0kudjCsdfurRatgr4w tpGg== X-Gm-Message-State: ANoB5pkLKEJefJIOFZqK+RrEV82P8dHPCeRCqdjbpD2HHwtyuM5D4xBc UcO29Lmec3s1U0MoWfymxPRrd/+eM7pvp0N3ShE= X-Google-Smtp-Source: AA0mqf5DfMJEUGeY4IHfbRE9olmZXAq8jdh6HWMdCV8xYnAzA550Vo0/yOdixfs5dmJZPlFtPzPgcVtliJw16g5waS0= X-Received: by 2002:a17:902:c652:b0:177:e4c7:e8b7 with SMTP id s18-20020a170902c65200b00177e4c7e8b7mr40343501pls.118.1669760035936; Tue, 29 Nov 2022 14:13:55 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Henrik Frisk Date: Tue, 29 Nov 2022 23:13:44 +0100 Message-ID: Subject: Re: Adding #+name to result block in babel To: Bill Burdick Cc: org-mode-email Content-Type: multipart/alternative; boundary="000000000000cd5c7105eea34d24" Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=frisk.h@gmail.com; helo=mail-pl1-x62d.google.com 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669760092; 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=OpHYraWLafSgLCngD62FdCL4p++XHWgLSZb/gqdNU9k=; b=Cuvmx2XAagOrwPBcPEwMXHFv0HP25/UaATcFkZP5+TGNovQrLTsULzv5iJMhEUwttJlFjP R3F/mKuyNmQuC2yC0D6FsnqBSBhjpJ00ytvn5I3HqiRAXjVsPMlbKM5M1vn5z4PSkROJHx ss44aJv8uTEd5Rrf6R6HE7iucnAdzb/3Y+3DB0F8d2maKuP9O8yUiRMGyFtaW6jcMDx/1r NAeB/p4IPVPxTzMVBnF2ewBLGoJRejaxwKVHgzgdlZUQcg2kCWXRF+kG7Xx/mLOT5IylNK U8OQdfFvnkZl1LwpFhE3f2P2YgvIVrPD3adCoj00pxxJOu5S5/MuxPi3dpQWeA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669760092; a=rsa-sha256; cv=none; b=Kzs/Ar/T406bG1WOiOtTjjBMp/ldJ8S3UosOlb7ABG4UbRLdo8IQ5Ur8bf3f8k3w8ZGtxx JE9vjWaasdMnFdK7kZdRLK8e4SJigNi8XNpvRYN1GSrHw3kh3R8czjlpL2nAeEL6okFDaL 0ubj8fJ2GOuVT0D1iCwaWc5FrO0q1QP7VuPUTYzsj+zQVJGOVe0xUkq6lzwWg4edyeMyGh jYxV9k6d5Hc5hSJ7owYF9V/U5la7YpBMPnF54x2j6pp1N/putWoX0oBxpvPN15+xtcIISm xcHaBBfYKalK0nAn3BfOgVekFRklQBhAVti1838Qk5WruO3e+Fi2A6cRaHTRyA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Z0jUzw2g; dmarc=pass (policy=none) header.from=gmail.com; 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.46 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Z0jUzw2g; dmarc=pass (policy=none) header.from=gmail.com; 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: 9148E3E9A9 X-Spam-Score: -7.46 X-Migadu-Scanner: scn0.migadu.com X-TUID: LRuNrmY28m/7 --000000000000cd5c7105eea34d24 Content-Type: text/plain; charset="UTF-8" Den tis 29 nov. 2022 kl 06:20 skrev Bill Burdick : > Hi Henrik, > > On Tue, Nov 29, 2022 at 2:11 AM Henrik Frisk wrote: > >> Hi, >> >> Maybe I'm missing something obvious but is it possible to have a name be >> added to the result block such as running: >> >> #+begin_src shell >> echo "Hello" >> #+end_src >> >> results in >> >> #+RESULTS: >> #+name: my_result >> : Hello >> >> Thank you! >> > > Name your block, like this: > #+name: my_result > #+begin_src sh > echo hello > #+end_src > > When you evaluate it, you'll get this: > > #+name: my_result > #+begin_src sh > echo hello > #+end_src > > #+RESULTS: my_result > : hello > > Then you can use the result like this: > > #+begin_src sh :var value=my_result > echo $value > #+end_src > > #+RESULTS: > : hello > Thank you! That was good to be reminded of, but I should have been more explicit in my first email. I'm working with a language (sclang) that for various reasons does not have support for variables in this way. The only option I have to include the results from one 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 --000000000000cd5c7105eea34d24 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
Den tis 29 nov. 2022 kl 06:20 skrev B= ill Burdick <bill.burdick@gmai= l.com>:
<= div dir=3D"ltr">
Hi Henrik,

On Tue, Nov 29, 2022= at 2:11 AM Henrik Frisk <frisk.h@gmail.com> wrote:
Hi,

Maybe I'm missing something obvious but is it possible to have a name= be added to the result block such as running:

#+begin_src shell
=C2=A0 echo "Hello"
#+end_src
<= div>
results in

#+RESULTS:
#+name: my_result
: Hello

Thank you= !

Name your block, like this:=C2=A0 =C2=A0 #+name: my_result
=C2=A0 =C2=A0=C2=A0#+begin_src sh
= =C2=A0 =C2=A0=C2=A0echo hello
=C2=A0 =C2=A0=C2=A0#+end_src

When y= ou evaluate it, you'll get this:

=C2=A0 =C2=A0=C2=A0#+name: my_r= esult
=C2=A0 =C2=A0=C2=A0#+begin_src sh
=C2=A0 =C2=A0=C2=A0echo hello=
=C2=A0 =C2=A0=C2=A0#+end_src
=C2=A0 =C2=A0=C2=A0
=C2=A0 =C2=A0=C2= =A0#+RESULTS: my_result
=C2=A0 =C2=A0=C2=A0: hello

Then you can u= se the result like this:

=C2=A0 =C2=A0=C2=A0#+begin_src sh :var valu= e=3Dmy_result
=C2=A0 =C2=A0=C2=A0echo $value
=C2=A0 =C2=A0=C2=A0#+end= _src
=C2=A0 =C2=A0=C2=A0
=C2=A0 =C2=A0=C2=A0#+RESULTS:
=C2=A0 =C2= =A0=C2=A0: hello
Thank you! That was good = to be reminded of, but I should have been more explicit in my first email. = I'm working with a language (sclang) that for various reasons does not = have support for variables in this way. The only option I have to include t= he results from one block is by using a noweb referens:

#+begin_src shell
=C2=A0=C2=A0 echo "Hello"
#+en= d_src

#+RESULTS:
#+name: my_result
: Hello

#+begin_src sclang :nowe= b yes
=C2=A0 <<my_result>>
#+end_sr= c
--000000000000cd5c7105eea34d24--