From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: babel header arguments tutorial? Date: Sat, 26 Sep 2015 18:39:11 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11403322bd43960520aac77b Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfuNN-0006bo-MM for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 14:39:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfuNM-0004FG-Hf for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 14:39:13 -0400 Received: from mail-la0-x22f.google.com ([2a00:1450:4010:c03::22f]:35793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfuNM-0004FA-AV for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 14:39:12 -0400 Received: by lacrr8 with SMTP id rr8so47608786lac.2 for ; Sat, 26 Sep 2015 11:39:11 -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: emacs-orgmode Mailinglist --001a11403322bd43960520aac77b Content-Type: text/plain; charset=UTF-8 I see this and find the bottom section ("Setting language and file specific default header argument value") intriguing, however too cryptic. Can someone explain what's going on here and how to use it? LB --001a11403322bd43960520aac77b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I see=C2=A0this=C2=A0and find the bottom section ("Se= tting language and file specific default header argument value") intri= guing, however too cryptic. Can someone explain what's going on here an= d how to use it?

LB
--001a11403322bd43960520aac77b-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: babel header arguments tutorial? Date: Sat, 26 Sep 2015 14:39:25 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfxBt-0006XL-0e for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 17:39:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfxBp-0004Ls-Pi for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 17:39:32 -0400 Received: from iport-acv1-out.ucsd.edu ([132.239.0.176]:61832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfxBp-0004Ll-HG for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 17:39:29 -0400 In-Reply-To: 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: Lawrence Bottorff Cc: emacs-orgmode Mailinglist On Sat, 26 Sep 2015, Lawrence Bottorff wrote: > I see this and > find the bottom section ("Setting language and file specific default header > argument value") intriguing, however too cryptic. Can someone explain > what's going on here and how to use it? I'd say "don't use it". The source is several years old and filed under the FIXME worg directory. header-arg handling has improved lately. See (info "(org) Header arguments in Org mode properties") for a good appproach that uses this one line #+PROPERTY: header-args:python :session foo to do what is in the example you cite. HTH, Chuck From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: babel header arguments tutorial? Date: Sat, 26 Sep 2015 18:09:14 -0400 Message-ID: <87zj08zvcl.fsf@pierrot.dokosmarshall.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfxfJ-0002fd-Ti for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 18:09:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfxfG-0004be-O9 for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 18:09:57 -0400 Received: from plane.gmane.org ([80.91.229.3]:54734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfxfG-0004bV-He for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 18:09:54 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Zfxew-0005WE-Se for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 00:09:35 +0200 Received: from pool-108-20-41-232.bstnma.fios.verizon.net ([108.20.41.232]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Sep 2015 00:09:34 +0200 Received: from ndokos by pool-108-20-41-232.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Sep 2015 00:09:34 +0200 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@gnu.org Lawrence Bottorff writes: > I see this and find the bottom section ("Setting language and file > specific default header argument value") intriguing, however too > cryptic. Can someone explain what's going on here and how to use it? > Each language defines a variable where you can set header args that will apply to *all* code block for that language (and there is a language-independent variable too: org-babel-default-header-args). What the document you linked to suggests is that you can set such variables as local file variables (i.e. they are set as part of opening the file and they are set for that file only). The mechanism is bog-standard emacs: see (info "(emacs) file variables") for the details. The implementation on the page you linked contains a typo (capital P instead of lower-case p in python) and is much more prolix than it needs to be. You can get the same effect with # Local Variables: # org-babel-default-header-args:python: ((:session . "foo"))) # End: This form should be preferred for just setting variables. The eval mechanism should be used only when absolutely necessary. HTH -- Nick From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas S. Dye Subject: Re: babel header arguments tutorial? Date: Sat, 26 Sep 2015 12:43:17 -1000 Message-ID: References: <87zj08zvcl.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfyBy-00076p-FA for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 18:43:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfyBu-0005XV-DD for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 18:43:42 -0400 Received: from gproxy4-pub.mail.unifiedlayer.com ([69.89.23.142]:54171) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ZfyBu-0005VN-4w for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 18:43:38 -0400 In-reply-to: <87zj08zvcl.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: Nick Dokos Cc: emacs-orgmode@gnu.org Aloha Nick, Nick Dokos writes: > The implementation on the page you linked contains a typo (capital P > instead of lower-case p in python) and is much more prolix than it needs > to be. You can get the same effect with > > # Local Variables: > # org-babel-default-header-args:python: ((:session . "foo"))) > # End: > > This form should be preferred for just setting variables. The eval > mechanism should be used only when absolutely necessary. Can you elaborate why the eval mechanism should be used only when absolutely necessary? You've mentioned that a few times but I haven't run across similar warnings elsewhere. Thanks, Tom -- Thomas S. Dye http://www.tsdye.com From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: babel header arguments tutorial? Date: Sat, 26 Sep 2015 22:41:57 -0400 Message-ID: <87vbawziq2.fsf@pierrot.dokosmarshall.org> References: <87zj08zvcl.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zg1uq-0008DC-5S for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 22:42:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zg1um-0007yj-W1 for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 22:42:16 -0400 Received: from plane.gmane.org ([80.91.229.3]:33419) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zg1um-0007yS-PH for emacs-orgmode@gnu.org; Sat, 26 Sep 2015 22:42:12 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Zg1ug-0001v1-EC for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 04:42:06 +0200 Received: from pool-108-20-41-232.bstnma.fios.verizon.net ([108.20.41.232]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Sep 2015 04:42:06 +0200 Received: from ndokos by pool-108-20-41-232.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Sep 2015 04:42:06 +0200 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@gnu.org Thomas S. Dye writes: > Aloha Nick, > > Nick Dokos writes: > >> The implementation on the page you linked contains a typo (capital P >> instead of lower-case p in python) and is much more prolix than it needs >> to be. You can get the same effect with >> >> # Local Variables: >> # org-babel-default-header-args:python: ((:session . "foo"))) >> # End: >> >> This form should be preferred for just setting variables. The eval >> mechanism should be used only when absolutely necessary. > > Can you elaborate why the eval mechanism should be used only when > absolutely necessary? You've mentioned that a few times but I haven't > run across similar warnings elsewhere. > It's a matter of safety: eval allows you to evaluate arbitrary lisp code. Doing that in a local-variables block which is run when you open the file can lead to all kinds of damage. If you get a file with an eval in the local variables section, you'd better be very sure before opening the file in emacs. Here's one warning: http://www.gnu.org/software/emacs/manual/html_node/emacs/Safe-File-Variables.html -- Nick From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Strey Subject: Modification dates in Worg (was: babel header arguments tutorial?) Date: Sun, 27 Sep 2015 10:22:51 +0200 Message-ID: <87zj08uv8k.fsf_-_@strey.biz> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zg7F1-0006Br-Fq for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 04:23:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zg7Ey-0002Wh-BF for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 04:23:27 -0400 Received: from plane.gmane.org ([80.91.229.3]:38796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zg7Ey-0002WW-4f for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 04:23:24 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Zg7Es-0000TH-SE for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 10:23:18 +0200 Received: from xd9bda9dd.dyn.telefonica.de ([217.189.169.221]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Sep 2015 10:23:18 +0200 Received: from mstrey by xd9bda9dd.dyn.telefonica.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Sep 2015 10:23:18 +0200 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@gnu.org On Sa, 2015-09-26 at 23:39, Charles C. Berry wrote: [...] > The source is several years old and filed under the FIXME worg > directory. Both things are not visible on the page. In general there seems to be a lot of outdated stuff on Worg. It would be helpful to have at least the date of last modification on the pages. -- Michael Strey http://www.strey.biz * https://twitter.com/michaelstrey 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-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas S. Dye Subject: Re: babel header arguments tutorial? Date: Sun, 27 Sep 2015 06:47:48 -1000 Message-ID: References: <87zj08zvcl.fsf@pierrot.dokosmarshall.org> <87vbawziq2.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgF7V-000700-L3 for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 12:48:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgF7S-0006aS-Bv for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 12:48:13 -0400 Received: from gproxy9-pub.mail.unifiedlayer.com ([69.89.20.122]:43194) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ZgF7S-0006ZL-5D for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 12:48:10 -0400 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: Nick Dokos Cc: emacs-orgmode@gnu.org Aloha Nick, Nick Dokos writes: > Thomas S. Dye writes: > >> Aloha Nick, >> >> Nick Dokos writes: >> >>> The implementation on the page you linked contains a typo (capital P >>> instead of lower-case p in python) and is much more prolix than it needs >>> to be. You can get the same effect with >>> >>> # Local Variables: >>> # org-babel-default-header-args:python: ((:session . "foo"))) >>> # End: >>> >>> This form should be preferred for just setting variables. The eval >>> mechanism should be used only when absolutely necessary. >> >> Can you elaborate why the eval mechanism should be used only when >> absolutely necessary? You've mentioned that a few times but I haven't >> run across similar warnings elsewhere. >> > > It's a matter of safety: eval allows you to evaluate arbitrary lisp > code. Doing that in a local-variables block which is run when you > open the file can lead to all kinds of damage. If you get a file > with an eval in the local variables section, you'd better be very > sure before opening the file in emacs. > > Here's one warning: > > http://www.gnu.org/software/emacs/manual/html_node/emacs/Safe-File-Variables.html Thanks for the clarification. Emacs' built-in paranoia seems appropriate, I guess. I get asked if I want to evaluate local variables that might not be safe and one of my choices is to say no, in which case the file is opened without evaluating them. At that point I can look at the code they propose to run and convince myself there is no mischief. All the best, Tom -- Thomas S. Dye http://www.tsdye.com From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: babel header arguments tutorial? Date: Sun, 27 Sep 2015 15:51:01 -0400 Message-ID: <87mvw7zlne.fsf@pierrot.dokosmarshall.org> References: <87zj08zvcl.fsf@pierrot.dokosmarshall.org> <87vbawziq2.fsf@pierrot.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgHyf-00039R-AU for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 15:51:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgHya-0002N1-9v for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 15:51:17 -0400 Received: from plane.gmane.org ([80.91.229.3]:57794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgHya-0002Mv-0M for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 15:51:12 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZgHyY-0006cr-BS for emacs-orgmode@gnu.org; Sun, 27 Sep 2015 21:51:10 +0200 Received: from pool-108-20-41-232.bstnma.fios.verizon.net ([108.20.41.232]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Sep 2015 21:51:10 +0200 Received: from ndokos by pool-108-20-41-232.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Sep 2015 21:51:10 +0200 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@gnu.org Lawrence Bottorff writes: > 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?  > When you open the file. But see some caveats in my reply. Charles Berry's reply shows the preferred method today, using only what's available in org, but does not shed any light on the local file variables question (which is a more general mechanism, available throughout emacs, not just with org files). Assuming that you want to learn about file variables, we will forget temporarily about Charles's reply. So when you open the file, the local variables section is found and evaluated. Any variable settings are automatically buffer-local. That's what sets the org-babel-default-header-args:python variable to '((:session . "foo")) - in that buffer only. Then when you go evaluate the code block #+begin_src emacs-lisp org-babel-default-header-args:python #+end_src the variable has the give value and produces a result #+RESULTS: : ((:session . foo)) But if you evaluate the same code block in some other buffer, the result will be nil (unless you have initialized in some other way of course, e.g. by adding the initialization to your .emacs). > 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? > Theoretically, maybe (how's that for exactness?), but there are babel implementations that don't support sessions at all and (depending on the underlying interpreter), there may be subtle (or perhaps not so subtle) differences in evaluation semantics. Some experimentation should provide answers, but N.B. that the answers may be accidents of implementation (which some might call "bugs"). I don't think there is a strictly defined session model that applies to all languages: the implementations do the best they can under these circumstances. Now this is more a hunch than anything else: I *think* that's the way things are but I may be wrong, out-of-date, or both. A set of well-designed experiments in as many languages as possible would clarify the situation, and perhaps lead to improvements (they could also be turned into unit tests, which would be very desirable) - I won't volunteer, but maybe you would? > 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. > That's not answering any of your deeper questions, but the problem here is that the last code block evaluates a function that produces no output: it produces a return value though, so try #+BEGIN_SRC emacs-lisp :results value raw (myexptdouble 2 3) #+END_SRC -- Nick From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ista Zahn Subject: Re: Modification dates in Worg (was: babel header arguments tutorial?) Date: Mon, 28 Sep 2015 11:04:11 -0400 Message-ID: References: <87zj08uv8k.fsf_-_@strey.biz> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgZyn-0003d3-Mr for emacs-orgmode@gnu.org; Mon, 28 Sep 2015 11:04:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgZyh-0001fz-O7 for emacs-orgmode@gnu.org; Mon, 28 Sep 2015 11:04:37 -0400 Received: from mail-oi0-x236.google.com ([2607:f8b0:4003:c06::236]:33035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgZyh-0001ft-JP for emacs-orgmode@gnu.org; Mon, 28 Sep 2015 11:04:31 -0400 Received: by oixx17 with SMTP id x17so91563037oix.0 for ; Mon, 28 Sep 2015 08:04:30 -0700 (PDT) In-Reply-To: <87zj08uv8k.fsf_-_@strey.biz> 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: Michael Strey Cc: emacs-orgmode Mailinglist I've created a worg mirror on github at https://github.com/izahn/worg-mirror/, so you can see the modification dates via git-blame. For example, https://github.com/izahn/worg-mirror/blame/master/org-contrib/babel/languages.org shows modification of the babel languages page. Best, Ista On Sun, Sep 27, 2015 at 4:22 AM, Michael Strey wrote: > On Sa, 2015-09-26 at 23:39, Charles C. Berry wrote: > > [...] > >> The source is several years old and filed under the FIXME worg >> directory. > > Both things are not visible on the page. In general there seems to be a > lot of outdated stuff on Worg. It would be helpful to have at least the > date of last modification on the pages. > > -- > Michael Strey > http://www.strey.biz * https://twitter.com/michaelstrey > > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Strey Subject: Re: Modification dates in Worg Date: Tue, 29 Sep 2015 10:06:06 +0200 Message-ID: <874midwsy9.fsf@strey.biz> References: <87zj08uv8k.fsf_-_@strey.biz> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgpvd-0007y5-Nm for emacs-orgmode@gnu.org; Tue, 29 Sep 2015 04:06:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgpvY-0004aY-P3 for emacs-orgmode@gnu.org; Tue, 29 Sep 2015 04:06:25 -0400 Received: from plane.gmane.org ([80.91.229.3]:34986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgpvY-0004a4-IJ for emacs-orgmode@gnu.org; Tue, 29 Sep 2015 04:06:20 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZgpvW-0001xa-0I for emacs-orgmode@gnu.org; Tue, 29 Sep 2015 10:06:18 +0200 Received: from xd9bda952.dyn.telefonica.de ([217.189.169.82]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Sep 2015 10:06:17 +0200 Received: from mstrey by xd9bda952.dyn.telefonica.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Sep 2015 10:06:17 +0200 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@gnu.org On Mo, 2015-09-28 at 17:04, Ista Zahn wrote: > I've created a worg mirror on github at > https://github.com/izahn/worg-mirror/, so you can see the modification > dates via git-blame. Thank you. That will help me and maybe some other people who follow this thread. Unfortunately it does not solve the general problem. Most people access Worg via HTML. -- Michael Strey http://www.strey.biz * https://twitter.com/michaelstrey From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ista Zahn Subject: Re: Modification dates in Worg Date: Tue, 29 Sep 2015 10:38:44 -0400 Message-ID: References: <87zj08uv8k.fsf_-_@strey.biz> <874midwsy9.fsf@strey.biz> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgw3d-0003j8-Uz for emacs-orgmode@gnu.org; Tue, 29 Sep 2015 10:39:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zgw3c-00077A-PZ for emacs-orgmode@gnu.org; Tue, 29 Sep 2015 10:39:05 -0400 Received: from mail-oi0-x235.google.com ([2607:f8b0:4003:c06::235]:33945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgw3c-000776-LH for emacs-orgmode@gnu.org; Tue, 29 Sep 2015 10:39:04 -0400 Received: by oiev17 with SMTP id v17so4933680oie.1 for ; Tue, 29 Sep 2015 07:39:04 -0700 (PDT) In-Reply-To: <874midwsy9.fsf@strey.biz> 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: Michael Strey Cc: emacs-orgmode Mailinglist Hi Machael, Well, you're welcome to add modification dates to the worg files. IMO this won't help much, since some sections of the same file may be up to date while other sections may be out of date. Something like git-blame is needed I think in order to get a sense of how up-to-date a particular section might be. Best, Ista On Tue, Sep 29, 2015 at 4:06 AM, Michael Strey wrote: > On Mo, 2015-09-28 at 17:04, Ista Zahn wrote: >> I've created a worg mirror on github at >> https://github.com/izahn/worg-mirror/, so you can see the modification >> dates via git-blame. > > Thank you. That will help me and maybe some other people who follow this > thread. Unfortunately it does not solve the general problem. Most > people access Worg via HTML. > > -- > Michael Strey > http://www.strey.biz * https://twitter.com/michaelstrey > >