From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id yB7jNSL5EWDzagAA0tVLHw (envelope-from ) for ; Wed, 27 Jan 2021 23:37:06 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id iByOMSL5EWCaPQAAbx9fmQ (envelope-from ) for ; Wed, 27 Jan 2021 23:37:06 +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 433919403C9 for ; Wed, 27 Jan 2021 23:37:06 +0000 (UTC) Received: from localhost ([::1]:45908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4uMz-0003Ri-93 for larch@yhetil.org; Wed, 27 Jan 2021 18:37:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4uMP-0003RW-Gb for emacs-orgmode@gnu.org; Wed, 27 Jan 2021 18:36:29 -0500 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]:47012) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4uMN-0007oP-QC for emacs-orgmode@gnu.org; Wed, 27 Jan 2021 18:36:29 -0500 Received: by mail-qt1-x833.google.com with SMTP id l23so2814255qtq.13 for ; Wed, 27 Jan 2021 15:36:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=Xepu/WJ2DH1yRnwV7eH8sgrxcbYAGe0Otb8wG9j+YqY=; b=NOZgEySMbIOg4TzIcxXMHP3DEiQXwd4dwKtXxXFBhFL1cVekWQq/PxtqbevAC0qIpK 4PtRMO97EVQp34Za7EFJJtz4rKBqQhDcoKrD0BbMW0u5FN0GzDwqigjswkX4bpWrO0Gh MRGvg92KlIw9pxwxlGAw7SYUrZaSJAEDhDOnzK1OgjUTcPXI74p0IbcNScKTcmLWxhcH 0OFazvcsmrG7cVIBSSAG4fwmnBpnvGzrXWl/1fwbLn01SI6QVzYM6fBB8tlRngbpMknl fU/wmVUVR8dPO3/aRLWCzqGOgwf5HIKzZgvICsMV1MmCn3wzYcSokgiTxlpfZpCG+C0A Q0sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=Xepu/WJ2DH1yRnwV7eH8sgrxcbYAGe0Otb8wG9j+YqY=; b=ozoG3M4++v0atWO1sSuGXhT4i3ziRkNOcOlCcbimR+W2cjraZpAQTvy3mEpWRxCGzG MXTkPq/GagjoklQwBaEpQcQ+YDIy7ZiF6+ehwK4ZFIgET0b0X/Ba5Rwis5U3VwBxGye+ QsfgWuN/0nbToVtoVktGnlSFIVPfcTsOnhkA6kXBokAeCXq1Ui1ibo4Ed+3O3xU52s25 kQesrZmPx1Q6HIHkTwabMNfLQo5bJLVHcV/hQqWsZWPcF/Z1vJAquozlYXTPAG09y4KK UiIbUHOFdq41BAyQLM9min2gvntlqa9VbJQAY22S+4VyufZnKEXB+9VU7LWV2PbH4w6W yBMg== X-Gm-Message-State: AOAM532nt3S9bjhgaGEkGz1wDc37UgDPOaDQtdDr/8I3UtbY2tMi5DE6 tdgMlM8D56+Egme7aHj/cwQLX2ualg4= X-Google-Smtp-Source: ABdhPJyoRiaHyTHmNnUF3lchf9DPaBUB30ZmLn+aSQx17ePc8smfqxmsfTd6deoAPbGIN2FVUUb8Ag== X-Received: by 2002:ac8:6b44:: with SMTP id x4mr12226117qts.224.1611790586204; Wed, 27 Jan 2021 15:36:26 -0800 (PST) Received: from localhost ([190.239.232.181]) by smtp.gmail.com with ESMTPSA id m2sm2258359qke.117.2021.01.27.15.36.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 15:36:25 -0800 (PST) References: <87czxq83ha.fsf@gmail.com> <20210127223821.GB14346@tuxteam.de> User-agent: mu4e 1.4.14; emacs 27.1 From: doltes To: tomas@tuxteam.de Subject: Re: Get =#+RESULTS= without re-evaluating source code block? In-reply-to: <20210127223821.GB14346@tuxteam.de> Date: Wed, 27 Jan 2021 18:33:13 -0500 Message-ID: <87a6su7y6e.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::833; envelope-from=doltes512@gmail.com; helo=mail-qt1-x833.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=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.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: -2.05 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=NOZgEySM; dmarc=pass (policy=none) header.from=gmail.com; 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: 433919403C9 X-Spam-Score: -2.05 X-Migadu-Scanner: scn1.migadu.com X-TUID: xbFQwXf8YL4r Yes, it worked like a charm! Thanks! tomas@tuxteam.de writes: > 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 -- Greetings, doltes.