Sébastien Vauban <wxhgmqzgw...@spammotel.com> 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. >> >> > > 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 _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode