From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qB9MClFtqV/fMAAA0tVLHw (envelope-from ) for ; Mon, 09 Nov 2020 16:24:49 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 2M/yBVFtqV88MgAAB5/wlQ (envelope-from ) for ; Mon, 09 Nov 2020 16:24:49 +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 9C0F394053D for ; Mon, 9 Nov 2020 16:24:48 +0000 (UTC) Received: from localhost ([::1]:53510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kc9yJ-0004Bx-J7 for larch@yhetil.org; Mon, 09 Nov 2020 11:24:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kc9u6-0000Bb-0h for emacs-orgmode@gnu.org; Mon, 09 Nov 2020 11:20:26 -0500 Received: from grinta.net ([109.74.203.128]:44034) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kc9u3-00079c-JO for emacs-orgmode@gnu.org; Mon, 09 Nov 2020 11:20:25 -0500 Received: from black.local (guests.bs.ptb.de [192.53.103.10]) (Authenticated sender: daniele) by grinta.net (Postfix) with ESMTPSA id 1BD0AEDE26 for ; Mon, 9 Nov 2020 16:20:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=grinta.net; s=2020; t=1604938820; bh=dkauS8mZs4ZZvlaqH9qql7ChzQw1MM6u/xYnEWfheLk=; h=To:From:Subject:Date:From; b=OY0ZHKnNlhh9ITabgWGh9bAcqh2/dBjsifnFoJebY1OpyE9lZV+u+gYubfFx6dptj +UnFzCrcpl6jXmw0ew0CDUXRJuXKiv3iG817rUPB1DdVXB4iD2ZXSbL2Jgmx0TTRZK kJ3dvv3jogRFz4VBwGyzaFuNG3Ge9hZjo0mQkAq2iYZc6OYbELA10scm2mzmKyk9rF 4AAjVSReP2GX5aRm8hANbignX3bUQiSg+dPKFmcBe03sOAGvvj1Lns7i0DmMRQdpHi xzQaYdoVJBOwsKH551jSVj/MndpmA3JXPoqlHtzad64fEdTQOlFtiB033oNsj0LWHh F019s3MsIlHzQ== To: Org Mode List From: Daniele Nicolodi Subject: Caching answer to prompt for code block execution Message-ID: <3cb1aa1d-29ff-1a81-9ee7-db1843e0a45a@grinta.net> Date: Mon, 9 Nov 2020 17:20:19 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=109.74.203.128; envelope-from=daniele@grinta.net; helo=grinta.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/09 10:53:53 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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.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-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=grinta.net header.s=2020 header.b=OY0ZHKnN; 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-Spam-Score: -0.01 X-TUID: 88Te9ZlYRbIG Hello, I am trying to use the org-sbe macro to compute values in an org table. This results in a (well, actually two, see my other recent email to the mailing list) prompt for execution of the relevant code block. This is unpractical when there are more than an handful of cells to be evaluated. I have a couple of ideas for improvement. First, I think prompting only once for code blocks evaluated multiple times by org-sbe would make a lot of sense and would make the user experience much better. Second, I think it would be nice to have a way to cache the answer to the code block execution prompt. This could be implemented caching somewhere the answer keyed with an hash of the content of the code block. This should not require many changes to the code. The only thing that is not obvious is how to expire the cache to do not have it grow unbound. What do others think of these approaches? Cheers, Dan