From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Re: disable automatic source block evaluation but allow manual Date: Thu, 16 Dec 2010 07:54:21 -0700 Message-ID: <87ipytn4yq.fsf@gmail.com> References: <4D09D2EF.8070309@med.uni-goettingen.de> <807hfaaw14.fsf@missioncriticalit.com> <4D0A1D59.3080907@gmail.com> <801v5hvkv1.fsf@missioncriticalit.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=58559 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTFE0-0000xK-Hu for emacs-orgmode@gnu.org; Thu, 16 Dec 2010 09:54:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PTFDy-0000aL-Tm for emacs-orgmode@gnu.org; Thu, 16 Dec 2010 09:54:32 -0500 Received: from mail-qw0-f41.google.com ([209.85.216.41]:47827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PTFDy-0000aA-Rd for emacs-orgmode@gnu.org; Thu, 16 Dec 2010 09:54:30 -0500 Received: by qwa26 with SMTP id 26so3152408qwa.0 for ; Thu, 16 Dec 2010 06:54:30 -0800 (PST) In-Reply-To: <801v5hvkv1.fsf@missioncriticalit.com> (=?utf-8?Q?=22S=C3=A9b?= =?utf-8?Q?astien?= Vauban"'s message of "Thu, 16 Dec 2010 15:43:46 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?utf-8?Q?S=C3=A9bastien?= Vauban Cc: emacs-orgmode@gnu.org S=C3=A9bastien Vauban writes: >>> I guess one possibility would be to have a header argument >>> (update-results-when-exporting) which, if set, would update all results >>> in the org buffer and export then. >> >> This can also be accomplished using an export hook. e.g. >> >>=20 > > Thanks Eric for this. Though it is not yet *exactly* what I meant: here, > buffer is executed twice, once just before exporting (thru the hook) and = once > when exporting. > > Hence: > > - The results still may defer: date example that I gave previously in this > thread, but as well results of SQL code execution that would have > side-effects, etc... Not completely in sync'. > > - Regarding performance, it consumes twice as much time... > > Would it be possible, then, to avoid executing the buffer when exporting = (only > keeping it, once, in the export hook)? Yes, this should be possible through setting the :cache header argument on a buffer-wide basis, and calling `org-babel-execute-buffer' with a prefix argument (which forces re-evaluation in the face of caching). (add-hook 'org-export-first-hook (lambda () (org-babel-execute-buffer t))) Best -- Eric