From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Re: babel header arguments tutorial? Date: Sun, 27 Sep 2015 16:28:25 +0000 Message-ID: References: <87zj08zvcl.fsf@pierrot.dokosmarshall.org> <87vbawziq2.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013d1926f015e80520bd11d7 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgEoN-0003Sr-Nc for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 12:28:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgEoM-0004Zf-II for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 12:28:27 -0400 Received: from mail-la0-x231.google.com ([2a00:1450:4010:c03::231]:32851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgEoM-0004ZT-6m for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 12:28:26 -0400 Received: by lahh2 with SMTP id h2so138034133lah.0 for ; Sun, 27 Sep 2015 09:28:25 -0700 (PDT) In-Reply-To: <87vbawziq2.fsf@pierrot.dokosmarshall.org> 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: emacs-orgmode Mailinglist --089e013d1926f015e80520bd11d7 Content-Type: text/plain; charset=UTF-8 I guess from a purely elisp perspective I'm baffled. How is #+begin_src emacs-lisp org-babel-default-header-args:Python #+end_src supposed to produce #+RESULTS: | (:session . foo) | as it supposedly does in the doc? It doesn't for me. (Where, e.g., would "foo" be coming from?) If it had worked, does it make an addition to some hash table, or an alist somewhere? But then running this as an elisp code block is cool from a declarative programming standpoint (see this ) . So this # Local Variables: # eval: (setq-local org-babel-default-header-args:Python '((:session . "foo"))) # End: is called when you eval-buffer or open the file? Ancillary questions: 1. can babel elisp (or CL) blocks be assigned/associated to a specifically named session? That would enable various elisp code blocks to have separate "session spaces" (as does the geiser/scheme babel). If so, I'm guessing the block-session communication could also be remote? Again, with babel geiser/scheme sessions, can they call "cached" things from each other's different sessions? 2. . . . which makes me wonder how code blocks in a buffer can be run besides manually C-c C-c ing them. For example, #+name: myexptdouble #+begin_src emacs-lisp :session (defun myexptdouble (x y) (* (myexpt x y) (myexpt x y))) #+end_src #+RESULTS: myexptdouble : myexptdouble #+name: myexpt #+begin_src emacs-lisp :session (defun myexpt (x y) (expt x y)) #+end_src #+BEGIN_SRC emacs-lisp :results output raw (myexptdouble 2 3) #+END_SRC Even if I manually evaluate myexptdouble, running the last block gives an error about not knowing what myexpt is. Is there something in the last block that can be told to evaluate all the dependent functions? Perhaps if my blocks are named the same as the function name? How tangling and preserving sessions is also an interesting question, IHMO. --089e013d1926f015e80520bd11d7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I guess from a purely elisp perspective I'm baffled. H= ow is

#+begin_src emacs-lisp
=C2=A0 org-b= abel-default-header-args:Python
#+end_src

supposed to produce

#+RESULTS:
<= div>| (:session . foo) |

as it supposedly do= es in the doc? It doesn't for me. (Where, e.g., would "foo" b= e coming from?) If it had worked, does it make an addition to some hash tab= le, or an alist somewhere? But then running this as an elisp code block is = cool from a declarative programming standpoint (see this)=C2=A0. So this

= # Local Variables:
# eval: (setq-local org-babel-default-header-a= rgs:Python '((:session . "foo")))
# End:

is called when you eval-buffer or open the file?=C2=A0=

Ancillary questions:
1. can babel elisp= (or CL) blocks be assigned/associated to a specifically named session? Tha= t would enable various elisp code blocks to have separate "session spa= ces" (as does the geiser/scheme babel). If so, I'm guessing the bl= ock-session communication could also be remote? Again, with babel geiser/sc= heme sessions, can they call "cached" things from each other'= s different sessions?

2. . . . which makes me wond= er how code blocks in a buffer can be run besides manually C-c C-c ing them= . For example,


#+name: myexptd= ouble
#+begin_src emacs-lisp :session
(defun myexptdoub= le (x y)
=C2=A0 (* (myexpt x y) (myexpt x y)))
#+end_sr= c

#+RESULTS: myexptdouble
: myexptdouble=

#+name: myexpt
#+begin_src emacs-lisp := session
(defun myexpt (x y)
=C2=A0 (expt x y))
#+end_src

#+BEGIN_SRC emacs-lisp :results output= raw
(myexptdouble 2 3)
#+END_SRC

<= /div>
Even if I manually evaluate myexptdouble, running the last block = gives an error about not knowing what myexpt is. Is there something in the = last block that can be told to evaluate all the dependent functions? Perhap= s if my blocks are named the same as the function name? How tangling and pr= eserving sessions is also an interesting question, IHMO.
--089e013d1926f015e80520bd11d7--