From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: org-babel -- Improper syntax error in session mode? Date: Tue, 21 Jun 2011 10:52:13 -0700 Message-ID: <87pqm7jbz1.fsf@gmail.com> References: <87k4chwgpa.fsf@gmail.com> <23747.1308539849@alphaville.dokosmarshall.org> <87ei2ouwxk.fsf@gmail.com> <87aadcxl05.fsf@gmail.com> <87fwn4vsd6.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:38642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZ5LM-0006vN-Ds for emacs-orgmode@gnu.org; Tue, 21 Jun 2011 14:06:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZ5LK-0002dt-KF for emacs-orgmode@gnu.org; Tue, 21 Jun 2011 14:06:32 -0400 Received: from mail-pw0-f41.google.com ([209.85.160.41]:44782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZ5LK-0002Mk-8W for emacs-orgmode@gnu.org; Tue, 21 Jun 2011 14:06:30 -0400 Received: by mail-pw0-f41.google.com with SMTP id 12so138081pwi.0 for ; Tue, 21 Jun 2011 11:06:30 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Herbert Sitz Cc: emacs-orgmode@gnu.org Herbert Sitz writes: > Thomas S. Dye tsdye.com> writes: >> >> Aloha Herbert, >> >> I think you're right about the potential to improve the documentation. >> That's an on-going process. Could you suggest some specific changes? >> >> All the best, >> Tom > > Tom -- > > I would suggest just adding specific warnings that session-based evaluation may > throw syntax errors with valid code. > Done. I've added such a warning -- although not as strongly stated as your suggestion > [...] > > Also, it seems the real power of :session evaluation is to share state between > Org/Babel source code blocks, not merely to act as a kind of Org-internal > scratchpad. As a user trying to take advantage of that state-sharing power I > would generally want my Org document exports to start from fresh sessions. That > is, I would write my :session blocks so that they depended on results of code > run in previous :session blocks, BUT I would want the first :session block to > start with a fresh session,with a known state. So on export I would generally > want any existing named session to be closed and restarted anew for an > Org export. > There are times when I explicitly do not want a session to start fresh. Generally this is related to caching, for example if I have some value which is expensive (say a couple of minutes of computation) to compute, and it is currently alive in the session, then I'd probably rather keep my session active across multiple exports as I'm working on other (say visual/prose tweaks) to the exported document. Does that make sense? If the user did want to refresh the session on _every_ export I believe they could add such a function to the `org-export-preprocess-hook'. Cheers -- Eric > > I hope that all makes sense. I should say I'm not a big Babel user, and I could > easily be misunderstanding something. But it seems this is the way the > :session-based stuff should work, when possible. > > -- Herb > > > -- Eric Schulte http://cs.unm.edu/~eschulte/