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 sVSOEn7rEWCzfAAA0tVLHw (envelope-from ) for ; Wed, 27 Jan 2021 22:38:54 +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 uE/0DX7rEWADBgAA1q6Kng (envelope-from ) for ; Wed, 27 Jan 2021 22:38:54 +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 A090A9404C2 for ; Wed, 27 Jan 2021 22:38:53 +0000 (UTC) Received: from localhost ([::1]:50220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4tSd-0004JL-EY for larch@yhetil.org; Wed, 27 Jan 2021 17:38:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4tSD-0004Ig-LA for emacs-orgmode@gnu.org; Wed, 27 Jan 2021 17:38:25 -0500 Received: from mail.tuxteam.de ([5.199.139.25]:44308) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1l4tSB-00019g-1j for emacs-orgmode@gnu.org; Wed, 27 Jan 2021 17:38:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:Date; bh=vpafy1SOhoyAxMEX+XboVb34012j48W8kY2fpv0tx88=; b=jkx7FYVbQ+tisfTQ93p1rtpybWud7EfHiFxUjl88ftOKPFJEuqinQoN9MDs8kukF1PQ5pw0JJ31lj+LrRbSjeQUMDKkd/w94wsJBc+JCsF7VUU44+3ObwPubXyNQ+97q8hdFTDt3BTLYH/QtGJz2XNfzx24MDiq42pPrHWPeSAkojPksl7T98ylpNUA4rynoBbhJTIEK5daw9f+7LJgiLWtKkEUgS92zcOuPgKS5LxacdoakWYmvTGmmK7ExCzZVCXAjlqtZzOV27vJxX9rGQNkL39prEU5M0n2ZC0x+6stcZ9LQQ4XBanHWeIzE0UBe5hJ7xLLHxLHZDic6hq4dHw==; Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1l4tS9-0004RD-3n for emacs-orgmode@gnu.org; Wed, 27 Jan 2021 23:38:21 +0100 Date: Wed, 27 Jan 2021 23:38:21 +0100 To: emacs-orgmode@gnu.org Subject: Re: Get =#+RESULTS= without re-evaluating source code block? Message-ID: <20210127223821.GB14346@tuxteam.de> References: <87czxq83ha.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eAbsdosE1cNLO4uF" Content-Disposition: inline In-Reply-To: <87czxq83ha.fsf@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) From: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de 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_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.23 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" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.65 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=tuxteam.de header.s=mail header.b=jkx7FYVb; dmarc=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: A090A9404C2 X-Spam-Score: -3.65 X-Migadu-Scanner: scn0.migadu.com X-TUID: BKd5YVgxN6mn --eAbsdosE1cNLO4uF Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 27, 2021 at 05:14:43PM -0500, doltes wrote: > Get =3D#+RESULTS=3D without re-evaluating source code block? >=20 > Let's suppose I have a code block which requires a long time to finish >=20 > #+NAME: big-computation > #+begin_src bash > sleep 5 # Some computation which requires a long time to complete. > echo a > #+end_src >=20 > #+RESULTS: big-computation > #+begin_example > a > #+end_example >=20 > I want to use the results of that code block in other code blocks so I > use a =3Dnoweb=3D reference (see below.) >=20 > #+begin_src bash :noweb yes > printf "%s\n" <> > #+end_src >=20 > #+RESULTS: > #+begin_example > a >=20 > #+end_example >=20 > However, doing this (i.e. using a =3Dnoweb=3D reference) would make the > 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. >=20 > So, my question is: Is it possible to use the actual =3D#+RESULTS=3D code > 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 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 --eAbsdosE1cNLO4uF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAmAR610ACgkQBcgs9XrR2kYJwwCggXiPbslSdcjO8Bybhd3D/qEz e8AAnibgUfvt0KCzvNPiJUyeQPt0tU6D =bICq -----END PGP SIGNATURE----- --eAbsdosE1cNLO4uF--