From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kC/HCgz4EWAzZAAA0tVLHw (envelope-from ) for ; Wed, 27 Jan 2021 23:32:28 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id mCSwBgz4EWDZLAAA1q6Kng (envelope-from ) for ; Wed, 27 Jan 2021 23:32:28 +0000 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 C99389403C9 for ; Wed, 27 Jan 2021 23:32:26 +0000 (UTC) Received: from localhost ([::1]:40852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4uIT-000132-FK for larch@yhetil.org; Wed, 27 Jan 2021 18:32:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4uHP-00011p-Ie for emacs-orgmode@gnu.org; Wed, 27 Jan 2021 18:31:20 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:42113) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4uHN-0007GK-Er for emacs-orgmode@gnu.org; Wed, 27 Jan 2021 18:31:19 -0500 Received: by mail-wr1-x429.google.com with SMTP id c4so928147wru.9 for ; Wed, 27 Jan 2021 15:31:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrew-cmu-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DbluBfYOHESuubh/QCgoFd5vWawW+uNrCwX6jKDDxX4=; b=Kko9YjYqW9sl9QYEhtjNCxvgfMzbv/CRQmnCqM7UpGKj9byxxp6CPOBSzq472Oomkj OYZKnpxKMjxeiGIV2e2/vjOQv9WmESu+2PiVJQY+xhLlsaN0AVpDEy2749/xAHtN4h21 9BiP8DYBrspSjjnu2b2f9SFrtYckFej6tlQDrWjQH/jLLKahYrH12GGUDXQdl2LlCLRm geJIW1MnssKOXMdlkBhK1QeBHBbqgGSjG/ijJBNy+XCOga/XXotfPt8/6npIfoRUif54 YTDURRjWEmnWW0si2L/X4/0eRwloZd2SL9NiJj1na0554Mtcxlq4rQRGXV2yznEP/3Bn 3Vcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DbluBfYOHESuubh/QCgoFd5vWawW+uNrCwX6jKDDxX4=; b=eGjmOGYXKbcHkQiOu9I4VzL2BB81Qm/ZMMMbsO0UUS+9bLdiBp6KMZK3lMtcp18X68 ErtPFZm+G3php7Usu5FpBm0UK+cw6mkNgd4vIyakudE9H+jaLyvaSCEYcBi6zgJcjx+5 CBP7DyllSS4ypDbrL55Wla3iV/WkV5Zz5R+QIvzddj91oEHH8UiEMIaQWYamTfW48av3 OX37ec5Fg6xNywalCYRFhNHBsg0+5fYH/1MDggiGNOyd6/yit9L6LWCFMGe8Rs0KJ91V KVOhXoZVNwOp560h0NZMANp1k9Bgv76PfKkrKdRxth8km43/HbQT7h0+GBjZhMoLsSm4 vkqg== X-Gm-Message-State: AOAM530yhBq7uVj+2BSoduzRFnt/R+ai+cMaap3teboC3Mtx/6wTUNua WOB44bziXfayOFpLUEQCQrf6WiOY8/ImokH80l8= X-Google-Smtp-Source: ABdhPJwqkrIHeVcFK6Ep5TDgoSh6mPd64J5Sf0f+aJxk4jVZlNmz08s6EbvijI58JHqBCFybWLUCvA0Yth0hr279JqQ= X-Received: by 2002:a5d:6092:: with SMTP id w18mr13349387wrt.75.1611790274400; Wed, 27 Jan 2021 15:31:14 -0800 (PST) MIME-Version: 1.0 References: <87czxq83ha.fsf@gmail.com> <20210127223821.GB14346@tuxteam.de> In-Reply-To: <20210127223821.GB14346@tuxteam.de> From: John Kitchin Date: Wed, 27 Jan 2021 18:31:03 -0500 Message-ID: Subject: Re: Get =#+RESULTS= without re-evaluating source code block? To: tomas@tuxteam.de Content-Type: multipart/alternative; boundary="000000000000c2150b05b9ea2aaf" Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=johnrkitchin@gmail.com; helo=mail-wr1-x429.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.45 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=andrew-cmu-edu.20150623.gappssmtp.com header.s=20150623 header.b=Kko9YjYq; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=andrew.cmu.edu (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: C99389403C9 X-Spam-Score: -1.45 X-Migadu-Scanner: scn1.migadu.com X-TUID: ooHlVuHVcIxS --000000000000c2150b05b9ea2aaf Content-Type: text/plain; charset="UTF-8" I tried this but it did not work for me. On Wed, Jan 27, 2021 at 5:38 PM wrote: > On Wed, Jan 27, 2021 at 05:14:43PM -0500, doltes wrote: > > Get =#+RESULTS= without re-evaluating source code block? > > > > Let's suppose I have a code block which requires a long time to finish > > > > #+NAME: big-computation > > #+begin_src bash > > sleep 5 # Some computation which requires a long time to complete. > > echo a > > #+end_src > > > > #+RESULTS: big-computation > > #+begin_example > > a > > #+end_example > > > > I want to use the results of that code block in other code blocks so I > > use a =noweb= reference (see below.) > > > > #+begin_src bash :noweb yes > > printf "%s\n" <> > > #+end_src > > > > #+RESULTS: > > #+begin_example > > a > > > > #+end_example > > > > However, doing this (i.e. using a =noweb= reference) would make the > > command to be evaluated whenever getting its results. I don't want > > this, I want the =:noweb= reference to actually use the already > > computed results. > > > > So, my question is: Is it possible to use the actual =#+RESULTS= code > > block instead of always evaluating it when referencing the results > > through a =:noweb= reference? > > Perhaps "Cache results of evaluation" (15.5 Evaluating Code Blocks, > in the Interwebs here [1] is for you. > > In short, add a header argument :cache yes to your code block. > > Cheers > > [1] https://orgmode.org/org.html#Evaluating-Code-Blocks > > - t > -- John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu --000000000000c2150b05b9ea2aaf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

I tried this but it did not work for me.= =C2=A0


On Wed, Ja= n 27, 2021 at 5:38 PM <tomas@tuxteam= .de> wrote:
On Wed, Jan 27, 2021 at 05:14:= 43PM -0500, doltes wrote:
> Get =3D#+RESULTS=3D without re-evaluating source code block?
>
> Let's suppose I have a code block which requires a long time to fi= nish
>
> #+NAME: big-computation
> #+begin_src bash
> sleep 5 # Some computation which requires a long time to complete.
> echo a
> #+end_src
>
> #+RESULTS: big-computation
> #+begin_example
> a
> #+end_example
>
> I want to use the results of that code block in other code blocks so I=
> use a =3Dnoweb=3D reference (see below.)
>
> #+begin_src bash :noweb yes
> printf "%s\n" <<big-computation()>>
> #+end_src
>
> #+RESULTS:
> #+begin_example
> a
>
> #+end_example
>
> However, doing this (i.e. using a =3Dnoweb=3D reference) would make th= e
> command to be evaluated whenever getting its results. I don't want=
> this, I want the =3D:noweb=3D reference to actually use the already > computed results.
>
> So, my question is: Is it possible to use the actual =3D#+RESULTS=3D c= ode
> block instead of always evaluating it when referencing the results
> through a =3D:noweb=3D reference?

Perhaps "Cache results of evaluation" (15.5 Evaluating Code Block= s,
in the Interwebs here [1] is for you.

In short, add a header argument :cache yes to your code block.

Cheers

[1] https://orgmode.org/org.html#Evaluating-Code-= Blocks

=C2=A0- t
--
J= ohn

-----------------------------------
Professor John Kitchin=C2= =A0
Doherty Hall A207F
Department of Chemical Engineering
Carnegie= Mellon University
Pittsburgh, PA 15213
412-268-7803
=
--000000000000c2150b05b9ea2aaf--