* [Announcement] Org-babel initial release @ 2009-09-14 13:44 Eric Schulte 2009-09-15 8:20 ` Carsten Dominik ` (3 more replies) 0 siblings, 4 replies; 16+ messages in thread From: Eric Schulte @ 2009-09-14 13:44 UTC (permalink / raw To: Org Mode Dan Davison and I (Eric Schulte) are happy to announce that Org-babel has now been released as a contributed package in Org-mode with corresponding documentation on worg [1]. Org-babel provides the following functionality: - Source-code execution and control of output in org buffers - currently supported languages [2]: - emacs-lisp - shell scripts - R - ruby - python - SQL - gnuplot - dot - ditaa - asymptote - Haskell - OCaml - css - sass - results of code execution can be [3]: - passed to other source-code blocks - inserted into Org buffer as Org-mode table - inserted into Org buffer as escaped text - inserted into Org buffer as raw Org-mode text - dropped to a file and linked to from Org-mode buffer (e.g. ditaa) - ignored - Meta-programming language for org mode: each source-code block is treated as a function which can accept arguments in the form of: - entire org-mode tables - output of other source-code blocks - raw text - values of cells in Org-mode tables using the Org spreadsheet functionality - Spreadsheet enhancement: source-code blocks can be called from spreadsheet functions within tables - Community maintained library of useful code blocks [4] - reproducible research [5] - literate programming with org-mode [6] - Org-babel has special support for embedding your emacs initialization in literate Org-mode files [7] To activate Org-babel simply grab the latest version of Org-mode and add the following to your Emacs init (more complete instructions at [8]). (require 'org-babel-init) Thanks -- Eric Footnotes: [1] http://orgmode.org/worg/org-contrib/babel/org-babel.php [2] http://orgmode.org/worg/org-contrib/babel/org-babel.php#languages [3] http://orgmode.org/worg/org-contrib/babel/org-babel.php#header-arguments [4] http://orgmode.org/worg/org-contrib/babel/org-babel.php#library-of-babel [5] http://orgmode.org/worg/org-contrib/babel/org-babel.php#reproducable-research [6] http://orgmode.org/worg/org-contrib/babel/org-babel.php#literate-programming [7] http://orgmode.org/worg/org-contrib/babel/org-babel.php#literate-emacs-initialization [8] http://orgmode.org/worg/org-contrib/babel/org-babel.php#getting-started ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Announcement] Org-babel initial release 2009-09-14 13:44 [Announcement] Org-babel initial release Eric Schulte @ 2009-09-15 8:20 ` Carsten Dominik 2009-09-15 13:31 ` Miguel Fernando Cabrera ` (2 subsequent siblings) 3 siblings, 0 replies; 16+ messages in thread From: Carsten Dominik @ 2009-09-15 8:20 UTC (permalink / raw To: Eric Schulte; +Cc: Org Mode Hi Eric, thank you very much for this fantastic contribution to Org. - Carsten On Sep 14, 2009, at 2:44 PM, Eric Schulte wrote: > Dan Davison and I (Eric Schulte) are happy to announce that Org-babel > has now been released as a contributed package in Org-mode with > corresponding documentation on worg [1]. > > Org-babel provides the following functionality: > - Source-code execution and control of output in org buffers > - currently supported languages [2]: > - emacs-lisp > - shell scripts > - R > - ruby > - python > - SQL > - gnuplot > - dot > - ditaa > - asymptote > - Haskell > - OCaml > - css > - sass > - results of code execution can be [3]: > - passed to other source-code blocks > - inserted into Org buffer as Org-mode table > - inserted into Org buffer as escaped text > - inserted into Org buffer as raw Org-mode text > - dropped to a file and linked to from Org-mode buffer (e.g. ditaa) > - ignored > - Meta-programming language for org mode: each source-code block is > treated as a function which can accept arguments in the form of: > - entire org-mode tables > - output of other source-code blocks > - raw text > - values of cells in Org-mode tables using the Org spreadsheet > functionality > - Spreadsheet enhancement: source-code blocks can be called from > spreadsheet functions within tables > - Community maintained library of useful code blocks [4] > - reproducible research [5] > - literate programming with org-mode [6] > - Org-babel has special support for embedding your emacs > initialization in literate Org-mode files [7] > > To activate Org-babel simply grab the latest version of Org-mode and > add > the following to your Emacs init (more complete instructions at [8]). > > (require 'org-babel-init) > > Thanks -- Eric > > Footnotes: > [1] http://orgmode.org/worg/org-contrib/babel/org-babel.php > > [2] http://orgmode.org/worg/org-contrib/babel/org-babel.php#languages > > [3] http://orgmode.org/worg/org-contrib/babel/org-babel.php#header-arguments > > [4] http://orgmode.org/worg/org-contrib/babel/org-babel.php#library-of-babel > > [5] http://orgmode.org/worg/org-contrib/babel/org-babel.php#reproducable-research > > [6] http://orgmode.org/worg/org-contrib/babel/org-babel.php#literate-programming > > [7] http://orgmode.org/worg/org-contrib/babel/org-babel.php#literate-emacs-initialization > > [8] http://orgmode.org/worg/org-contrib/babel/org-babel.php#getting-started > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Announcement] Org-babel initial release 2009-09-14 13:44 [Announcement] Org-babel initial release Eric Schulte 2009-09-15 8:20 ` Carsten Dominik @ 2009-09-15 13:31 ` Miguel Fernando Cabrera 2009-09-15 14:49 ` Eric Schulte 2009-09-15 17:26 ` Sebastian Rose 2009-10-09 12:54 ` Org-babel for jython? Eric S Fraga 3 siblings, 1 reply; 16+ messages in thread From: Miguel Fernando Cabrera @ 2009-09-15 13:31 UTC (permalink / raw To: Org Mode [-- Attachment #1.1: Type: text/plain, Size: 3340 bytes --] Dan and Eric, Just reading the documentation one can get excited by the possibilities it brings to org-mode. Thank you for this great contribution. I have one question, as mentioned in the document on can pass a table to the code block. Is possible to send a as a parameter a dynamic clock table?. For example to create a pie-chart of the clock-table data using R? -- Miguel Fernando Cabrera <http://mfcabrera.com/>"A los hombres fuertes les pasa lo que a los barriletes; se elevan cuando es mayor el viento que se opone a su ascenso." - José Ingenieros On Mon, Sep 14, 2009 at 8:44 AM, Eric Schulte <schulte.eric@gmail.com>wrote: > Dan Davison and I (Eric Schulte) are happy to announce that Org-babel > has now been released as a contributed package in Org-mode with > corresponding documentation on worg [1]. > > Org-babel provides the following functionality: > - Source-code execution and control of output in org buffers > - currently supported languages [2]: > - emacs-lisp > - shell scripts > - R > - ruby > - python > - SQL > - gnuplot > - dot > - ditaa > - asymptote > - Haskell > - OCaml > - css > - sass > - results of code execution can be [3]: > - passed to other source-code blocks > - inserted into Org buffer as Org-mode table > - inserted into Org buffer as escaped text > - inserted into Org buffer as raw Org-mode text > - dropped to a file and linked to from Org-mode buffer (e.g. ditaa) > - ignored > - Meta-programming language for org mode: each source-code block is > treated as a function which can accept arguments in the form of: > - entire org-mode tables > - output of other source-code blocks > - raw text > - values of cells in Org-mode tables using the Org spreadsheet > functionality > - Spreadsheet enhancement: source-code blocks can be called from > spreadsheet functions within tables > - Community maintained library of useful code blocks [4] > - reproducible research [5] > - literate programming with org-mode [6] > - Org-babel has special support for embedding your emacs > initialization in literate Org-mode files [7] > > To activate Org-babel simply grab the latest version of Org-mode and add > the following to your Emacs init (more complete instructions at [8]). > > (require 'org-babel-init) > > Thanks -- Eric > > Footnotes: > [1] http://orgmode.org/worg/org-contrib/babel/org-babel.php > > [2] http://orgmode.org/worg/org-contrib/babel/org-babel.php#languages > > [3] > http://orgmode.org/worg/org-contrib/babel/org-babel.php#header-arguments > > [4] > http://orgmode.org/worg/org-contrib/babel/org-babel.php#library-of-babel > > [5] > http://orgmode.org/worg/org-contrib/babel/org-babel.php#reproducable-research > > [6] > http://orgmode.org/worg/org-contrib/babel/org-babel.php#literate-programming > > [7] > http://orgmode.org/worg/org-contrib/babel/org-babel.php#literate-emacs-initialization > > [8] > http://orgmode.org/worg/org-contrib/babel/org-babel.php#getting-started > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > [-- Attachment #1.2: Type: text/html, Size: 4851 bytes --] [-- Attachment #2: Type: text/plain, Size: 204 bytes --] _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Announcement] Org-babel initial release 2009-09-15 13:31 ` Miguel Fernando Cabrera @ 2009-09-15 14:49 ` Eric Schulte 2009-09-15 15:10 ` Eric Schulte 0 siblings, 1 reply; 16+ messages in thread From: Eric Schulte @ 2009-09-15 14:49 UTC (permalink / raw To: Miguel Fernando Cabrera; +Cc: Org Mode Hi Miguel, This feature is currently not implemented, however I will take a look at including it. For such a feature to work you would have to add a name to your dynamic clock table, something like... #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t :name todays-clock #+END: clocktable I'll let you know if I get this working. -- Eric Miguel Fernando Cabrera <mfcabrera@gmail.com> writes: > Dan and Eric, > > Just reading the documentation one can get excited by the possibilities it brings to org-mode. > Thank you for this great contribution. > > I have one question, as mentioned in the document on can pass a table to the code block. Is possible > to send a as a parameter a dynamic clock table?. For example to create a pie-chart of the > clock-table data using R? > > -- > Miguel Fernando Cabrera > "A los hombres fuertes les pasa lo que a los barriletes; se elevan cuando es > mayor el viento que se opone a su ascenso." - José Ingenieros > > On Mon, Sep 14, 2009 at 8:44 AM, Eric Schulte <schulte.eric@gmail.com> wrote: > > Dan Davison and I (Eric Schulte) are happy to announce that Org-babel > has now been released as a contributed package in Org-mode with > corresponding documentation on worg [1]. > > Org-babel provides the following functionality: > - Source-code execution and control of output in org buffers > - currently supported languages [2]: > - emacs-lisp > - shell scripts > - R > - ruby > - python > - SQL > - gnuplot > - dot > - ditaa > - asymptote > - Haskell > - OCaml > - css > - sass > - results of code execution can be [3]: > - passed to other source-code blocks > - inserted into Org buffer as Org-mode table > - inserted into Org buffer as escaped text > - inserted into Org buffer as raw Org-mode text > - dropped to a file and linked to from Org-mode buffer (e.g. ditaa) > - ignored > - Meta-programming language for org mode: each source-code block is > treated as a function which can accept arguments in the form of: > - entire org-mode tables > - output of other source-code blocks > - raw text > - values of cells in Org-mode tables using the Org spreadsheet > functionality > - Spreadsheet enhancement: source-code blocks can be called from > spreadsheet functions within tables > - Community maintained library of useful code blocks [4] > - reproducible research [5] > - literate programming with org-mode [6] > - Org-babel has special support for embedding your emacs > initialization in literate Org-mode files [7] > > To activate Org-babel simply grab the latest version of Org-mode and add > the following to your Emacs init (more complete instructions at [8]). > > (require 'org-babel-init) > > Thanks -- Eric > > Footnotes: > [1] http://orgmode.org/worg/org-contrib/babel/org-babel.php > > [2] http://orgmode.org/worg/org-contrib/babel/org-babel.php#languages > > [3] http://orgmode.org/worg/org-contrib/babel/org-babel.php#header-arguments > > [4] http://orgmode.org/worg/org-contrib/babel/org-babel.php#library-of-babel > > [5] http://orgmode.org/worg/org-contrib/babel/org-babel.php#reproducable-research > > [6] http://orgmode.org/worg/org-contrib/babel/org-babel.php#literate-programming > > [7] http://orgmode.org/worg/org-contrib/babel/org-babel.php#literate-emacs-initialization > > [8] http://orgmode.org/worg/org-contrib/babel/org-babel.php#getting-started > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Announcement] Org-babel initial release 2009-09-15 14:49 ` Eric Schulte @ 2009-09-15 15:10 ` Eric Schulte 0 siblings, 0 replies; 16+ messages in thread From: Eric Schulte @ 2009-09-15 15:10 UTC (permalink / raw To: Miguel Fernando Cabrera; +Cc: Org Mode Hi Miguel, It seems I spoke too soon, It looks like the current version of Org-babel will support dynamic clock tables if they are structured as the following with a #+tblname: line preceding the block. --8<---------------cut here---------------start------------->8--- #+TBLNAME: todays-clock #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t Clock summary at [2009-09-15 Tue 08:51], for Tuesday, September 15, 2009. | L | Headline | Time | | |---+--------------+--------+------| | | *Total time* | *1:10* | | |---+--------------+--------+------| | 1 | top | 1:10 | | | 2 | show all | | 1:00 | | 2 | later | | 0:10 | #+END: clocktable #+begin_src emacs-lisp :var data=todays-clock (length (car data)) #+end_src #+resname: : 4 #+begin_src emacs-lisp :var data=todays-clock (length data) #+end_src #+resname: : 4 --8<---------------cut here---------------end--------------->8--- Unfortunately I don't know much about R, so converting the times to something easily graphed in a pie chart may be a little bit more difficult. Best -- Eric ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Announcement] Org-babel initial release 2009-09-14 13:44 [Announcement] Org-babel initial release Eric Schulte 2009-09-15 8:20 ` Carsten Dominik 2009-09-15 13:31 ` Miguel Fernando Cabrera @ 2009-09-15 17:26 ` Sebastian Rose 2009-09-15 17:54 ` Eric Schulte 2009-09-15 17:56 ` Rick Moynihan 2009-10-09 12:54 ` Org-babel for jython? Eric S Fraga 3 siblings, 2 replies; 16+ messages in thread From: Sebastian Rose @ 2009-09-15 17:26 UTC (permalink / raw To: Eric Schulte; +Cc: Org Mode "Eric Schulte" <schulte.eric@gmail.com> writes: > Dan Davison and I (Eric Schulte) are happy to announce that Org-babel > has now been released as a contributed package in Org-mode with > corresponding documentation on worg [1]. What else should I say - THIS IS GREAT NEWS!! I wonder how complicated it would be to add more languages. Especially PHP, JavaScript (e.g. per rhino) and Perl. Is there some documentation or advice on the net in that concern? I'd like to add a language I understand besides Bash... :) Hmmm - maybe `org-babel-sh.el' is a good starting point. * Some thoughts I actually wonder, if all those interpreted languages are different at all. Why not add an generic call to interpreters. Executing Shell scripts or Perl, Php, JavaScript... makes no big difference here. On Linux at least, they all work with either shebang or called with OPTION FILENAME. To execute a temporary file without shebang, all interpreters take a filename: rhino -f FILE # -f is optional php -f FILE # -f is optional perl FILE Or execute code directly (which is useless for us, since we would need to quote the code correctly...): rhino -e CODE... perl -e CODE... php -r CODE... So how about: #+srcname: generic-circumference(a) #+begin_src javascript :interpreter rhino -f print ( "Write me to temp file and call `rhino -f TMPFILE'" ) java.lang.System.out.println ( 2 * a * java.lang.Math.PI ) #+end_src This way, a source block written on my Linux-System would execute on her MAC and his Windows machine without change (provided the interpreter is installed and in $PATH... `org-program-exists' ... to use interpreters without having them in $PATH, a customizable map could be used). BTW: I just discovered rhino - looks interesting, seems you can (de-)serialize Java(Script) objects... and thus keep track of things between sessions ;) start programs, call Java Methods... See https://developer.mozilla.org/en/Rhino_Shell Best wishes, Sebastian ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Announcement] Org-babel initial release 2009-09-15 17:26 ` Sebastian Rose @ 2009-09-15 17:54 ` Eric Schulte 2009-09-15 19:15 ` Sebastian Rose 2009-09-15 17:56 ` Rick Moynihan 1 sibling, 1 reply; 16+ messages in thread From: Eric Schulte @ 2009-09-15 17:54 UTC (permalink / raw To: Sebastian Rose; +Cc: Org Mode Hi Sebastian, Sebastian Rose <sebastian_rose@gmx.de> writes: > "Eric Schulte" <schulte.eric@gmail.com> writes: >> Dan Davison and I (Eric Schulte) are happy to announce that Org-babel >> has now been released as a contributed package in Org-mode with >> corresponding documentation on worg [1]. > > > What else should I say - THIS IS GREAT NEWS!! > Thanks, I hope fellow Orgers find it useful > > I wonder how complicated it would be to add more languages. Especially > PHP, JavaScript (e.g. per rhino) and Perl. > Yes, I must admit the current set of implemented language is very specific to Dan and my personal needs. I really hope that other people add the languages they need/use, and I tried to design the structure of org-babel to make the addition of new languages as painless as possible. > > Is there some documentation or advice on the net in that concern? I'd > like to add a language I understand besides Bash... :) > > Hmmm - maybe `org-babel-sh.el' is a good starting point. > Yes, currently the best way to get a feel for how to add languages would be to start with an existing language file (I'd suggest org-babel-python.el or org-babel-ruby.el, or for simpler less comprehensive language support look at org-babel-ditaa or org-babel-haskell) and make changes from there. I agree that a brief tutorial for adding language support would be helpful. Basically Org-babel expects any new language file to define two functions... - org-babel-execute:lang-name (body params) :: which executes the code in body according to the header arguments in params, and - org-babel-prep-session:ruby (session params) :: which starts an interactive session in session setting any variables from params > > * Some thoughts > > > I actually wonder, if all those interpreted languages are different at > all. Why not add an generic call to interpreters. Executing Shell > scripts or Perl, Php, JavaScript... makes no big difference here. On > Linux at least, they all work with either shebang or called with OPTION > FILENAME. > There are two key language specific features which keep us from treating all interpreted languages identically. 1) Org-babel collects the last value of a source-code block to be returned (see [1]) and this value needs to be collected and potentially converted into elisp in a language specific manner 2) Org-babel has support for evaluation in a session allowing persistence of state between different blocks which use the same session. I now notice that the :session header argument is not currently documented on the Worg page. I'll try to add this documentation soon. The sessions are handled through Emacs comint buffers which are very language specific. > > To execute a temporary file without shebang, all interpreters take a > filename: > > rhino -f FILE # -f is optional > php -f FILE # -f is optional > perl FILE > > Or execute code directly (which is useless for us, since we would need > to quote the code correctly...): > > rhino -e CODE... > perl -e CODE... > php -r CODE... > I agree that it would be possible to implement a much more general code-evaluation mechanism based on execution of temporary files, but we would lose the nice features mentioned above. > > > So how about: > > #+srcname: generic-circumference(a) > #+begin_src javascript :interpreter rhino -f > > print ( "Write me to temp file and call `rhino -f TMPFILE'" ) > java.lang.System.out.println ( 2 * a * java.lang.Math.PI ) > > #+end_src > > This way, a source block written on my Linux-System would execute on her > MAC and his Windows machine without change (provided the interpreter is > installed and in $PATH... `org-program-exists' ... to use interpreters > without having them in $PATH, a customizable map could be used). > Under the current setup, all source-code blocks should be executable on *any* system which supports the required language and Emacs modes mentioned in the commented elisp block at [2] Best -- Eric > > > > > > > BTW: I just discovered rhino - looks interesting, seems you can > (de-)serialize Java(Script) objects... and thus keep track of things > between sessions ;) start programs, call Java Methods... See > https://developer.mozilla.org/en/Rhino_Shell > > > > Best wishes, > > Sebastian Footnotes: [1] http://orgmode.org/worg/org-contrib/babel/org-babel.php#results [2] http://orgmode.org/worg/org-contrib/babel/org-babel.php#languages ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Announcement] Org-babel initial release 2009-09-15 17:54 ` Eric Schulte @ 2009-09-15 19:15 ` Sebastian Rose 2009-09-15 20:03 ` Eric Schulte 0 siblings, 1 reply; 16+ messages in thread From: Sebastian Rose @ 2009-09-15 19:15 UTC (permalink / raw To: Eric Schulte; +Cc: Org Mode "Eric Schulte" <schulte.eric@gmail.com> writes: > Thanks, I hope fellow Orgers find it useful Sure they do! Make Emacs+Org-mode the `killer-application' :) >> I wonder how complicated it would be to add more languages. Especially >> PHP, JavaScript (e.g. per rhino) and Perl. ... >> Hmmm - maybe `org-babel-sh.el' is a good starting point. >> > > Yes, currently the best way to get a feel for how to add languages would > be to start with an existing language file (I'd suggest > org-babel-python.el or org-babel-ruby.el, or for simpler less > comprehensive language support look at org-babel-ditaa or > org-babel-haskell) and make changes from there. I agree that a brief > tutorial for adding language support would be helpful. A skeleton maybe? And just a few comments describing the I/O of the basic functions (and/or the global vars/containers that take the results). > Basically Org-babel expects any new language file to define two > functions... > > - org-babel-execute:lang-name (body params) :: which executes the code > in body according to the header arguments in params, and > > - org-babel-prep-session:ruby (session params) :: which starts an > interactive session in session setting any variables from params OK. I'll look at those... > There are two key language specific features which keep us from treating > all interpreted languages identically. > 1) Org-babel collects the last value of a source-code block to be > returned (see [1]) and this value needs to be collected and > potentially converted into elisp in a language specific manner > 2) Org-babel has support for evaluation in a session allowing > persistence of state between different blocks which use the same > session. I now notice that the :session header argument is not > currently documented on the Worg page. I'll try to add this > documentation soon. The sessions are handled through Emacs comint > buffers which are very language specific. Ahhh, I now comprehend. You're library makes all kinds of source blocks work together as a whole. Great! I now understand your intention! Make that old joke become true: "Emacs is a great OS, it's just missing a good editor" :-D ..... Nachtigall ick hör dir trappsen ... Seriously: There's not that much code to write in the language files. The features seem more than worth it. I just had little snippets in mind... hrm, sorry. > Footnotes: > [1] http://orgmode.org/worg/org-contrib/babel/org-babel.php#results > > [2] http://orgmode.org/worg/org-contrib/babel/org-babel.php#languages OK - not _really_ RTFM :-D I remember I stared at those sections last night - seems I was half asleep already. Best wishes Sebastian ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Announcement] Org-babel initial release 2009-09-15 19:15 ` Sebastian Rose @ 2009-09-15 20:03 ` Eric Schulte 2009-09-15 20:53 ` Sebastian Rose 0 siblings, 1 reply; 16+ messages in thread From: Eric Schulte @ 2009-09-15 20:03 UTC (permalink / raw To: Sebastian Rose; +Cc: Org Mode [-- Attachment #1: Type: text/plain, Size: 961 bytes --] Sebastian Rose <sebastian_rose@gmx.de> writes: > "Eric Schulte" <schulte.eric@gmail.com> writes: >> >> Yes, currently the best way to get a feel for how to add languages would >> be to start with an existing language file (I'd suggest >> org-babel-python.el or org-babel-ruby.el, or for simpler less >> comprehensive language support look at org-babel-ditaa or >> org-babel-haskell) and make changes from there. I agree that a brief >> tutorial for adding language support would be helpful. > > > A skeleton maybe? > And just a few comments describing the I/O of the basic functions > (and/or the global vars/containers that take the results). > > Good idea, I'm attaching an org-babel-template.el file which tries to be just that. I'd be interested to hear how it works for you, or if you want to make any changes. Once there is a good version maybe it would be a good thing to either add to the babel/lisp/langs directory, or at least to post on Worg. [-- Attachment #2: org-babel-template.el --] [-- Type: application/emacs-lisp, Size: 5549 bytes --] [-- Attachment #3: Type: text/plain, Size: 1218 bytes --] >> There are two key language specific features which keep us from treating >> all interpreted languages identically. >> 1) Org-babel collects the last value of a source-code block to be >> returned (see [1]) and this value needs to be collected and >> potentially converted into elisp in a language specific manner >> 2) Org-babel has support for evaluation in a session allowing >> persistence of state between different blocks which use the same >> session. I now notice that the :session header argument is not >> currently documented on the Worg page. I'll try to add this >> documentation soon. The sessions are handled through Emacs comint >> buffers which are very language specific. > > > Ahhh, I now comprehend. You're library makes all kinds of source blocks > work together as a whole. Great! I now understand your intention! Make > that old joke become true: "Emacs is a great OS, it's just missing a > good editor" :-D > ..... Nachtigall ick hör dir trappsen ... > :) heh, I hadn't thought of it that way, but yea, the idea is to allow different languages to interact all using emacs-lisp as the lower-common-denominator. Best -- Eric [-- Attachment #4: Type: text/plain, Size: 204 bytes --] _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Announcement] Org-babel initial release 2009-09-15 20:03 ` Eric Schulte @ 2009-09-15 20:53 ` Sebastian Rose 0 siblings, 0 replies; 16+ messages in thread From: Sebastian Rose @ 2009-09-15 20:53 UTC (permalink / raw To: Eric Schulte; +Cc: Org Mode "Eric Schulte" <schulte.eric@gmail.com> writes: > Sebastian Rose <sebastian_rose@gmx.de> writes: > >> "Eric Schulte" <schulte.eric@gmail.com> writes: > >>> >>> Yes, currently the best way to get a feel for how to add languages would >>> be to start with an existing language file (I'd suggest >>> org-babel-python.el or org-babel-ruby.el, or for simpler less >>> comprehensive language support look at org-babel-ditaa or >>> org-babel-haskell) and make changes from there. I agree that a brief >>> tutorial for adding language support would be helpful. >> >> >> A skeleton maybe? >> And just a few comments describing the I/O of the basic functions >> (and/or the global vars/containers that take the results). >> >> > > Good idea, I'm attaching an org-babel-template.el file which tries to be > just that. I'd be interested to hear how it works for you, or if you > want to make any changes. Once there is a good version maybe it would > be a good thing to either add to the babel/lisp/langs directory, or at > least to post on Worg. Ahhh - now that I get simple output from PHP... simple already worked for my, by taking the org-babel-python.el, replacing org-babel-python-evaluate by org-babel-sh-evaluate and replace all `python' and `sh' by `php'. (OK - and wrap the `full-body' into `<?php ' and ' ?>'). But then I screwed it up by replacing the modified org-babel-sh-evaluate by the org-babel-python-evaluate function again - now I don't get the results out... but I'm on the track. OK - I'll try the template. I need to understand the whole thing anyway :) Best wishes Sebastian ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Announcement] Org-babel initial release 2009-09-15 17:26 ` Sebastian Rose 2009-09-15 17:54 ` Eric Schulte @ 2009-09-15 17:56 ` Rick Moynihan 2009-09-15 20:07 ` Eric Schulte 2009-09-15 22:02 ` Eric Schulte 1 sibling, 2 replies; 16+ messages in thread From: Rick Moynihan @ 2009-09-15 17:56 UTC (permalink / raw To: Sebastian Rose; +Cc: Org Mode Reply below: 2009/9/15 Sebastian Rose <sebastian_rose@gmx.de>: > > * Some thoughts > > > I actually wonder, if all those interpreted languages are different at > all. Why not add an generic call to interpreters. Executing Shell > scripts or Perl, Php, JavaScript... makes no big difference here. On > Linux at least, they all work with either shebang or called with OPTION > FILENAME. > > To execute a temporary file without shebang, all interpreters take a > filename: > > rhino -f FILE # -f is optional > php -f FILE # -f is optional > perl FILE > > Or execute code directly (which is useless for us, since we would need > to quote the code correctly...): > > rhino -e CODE... > perl -e CODE... > php -r CODE... > > > So how about: > > #+srcname: generic-circumference(a) > #+begin_src javascript :interpreter rhino -f > > print ( "Write me to temp file and call `rhino -f TMPFILE'" ) > java.lang.System.out.println ( 2 * a * java.lang.Math.PI ) > > #+end_src > > This way, a source block written on my Linux-System would execute on her > MAC and his Windows machine without change (provided the interpreter is > installed and in $PATH... `org-program-exists' ... to use interpreters > without having them in $PATH, a customizable map could be used). > Was having a similar idea, as I language I'd love to use with this is my current fave clojure: http://clojure.org/ It's a language based on the JVM and consequently being able to pass in command line options to the interpreter is important... I'd imagine most of the time the source blocks within a single file would share the vast majority of environment settings too (for example setting the JVM's class path) so being able to specify these values to pass to the interpreter, once at the top of the file would be really nice. R. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Announcement] Org-babel initial release 2009-09-15 17:56 ` Rick Moynihan @ 2009-09-15 20:07 ` Eric Schulte 2009-09-15 22:02 ` Eric Schulte 1 sibling, 0 replies; 16+ messages in thread From: Eric Schulte @ 2009-09-15 20:07 UTC (permalink / raw To: Rick Moynihan; +Cc: Org Mode Rick Moynihan <rick.moynihan@gmail.com> writes: > > Was having a similar idea, as I language I'd love to use with this is > my current fave clojure: > > http://clojure.org/ > Everyone I talk to seems to love clojure, I need to find an excuse to use it myself. > > It's a language based on the JVM and consequently being able to pass > in command line options to the interpreter is important... I'd > imagine most of the time the source blocks within a single file would > share the vast majority of environment settings too (for example > setting the JVM's class path) so being able to specify these values to > pass to the interpreter, once at the top of the file would be really > nice. > This should be easily implemented using a new header argument (languages are free to define new header arguments as they see fit). For an example of a language passing command line options through header arguments, see the org-babel-ditaa.el file which defines a :cmdline header argument allowing arguments to be passed to the ditaa command as in the example below where the -r and -S options are passed to the ditaa command. --8<---------------cut here---------------start------------->8--- #+begin_src ditaa :file blue.png :cmdline -r -S +---------+ | cBLU | | | | +----+ | |cPNK| | | | +----+----+ #+end_src --8<---------------cut here---------------end--------------->8--- Cheers -- Eric > > R. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Announcement] Org-babel initial release 2009-09-15 17:56 ` Rick Moynihan 2009-09-15 20:07 ` Eric Schulte @ 2009-09-15 22:02 ` Eric Schulte 2009-10-09 16:38 ` Marcelo de Moraes Serpa 1 sibling, 1 reply; 16+ messages in thread From: Eric Schulte @ 2009-09-15 22:02 UTC (permalink / raw To: Rick Moynihan; +Cc: Org Mode Rick Moynihan <rick.moynihan@gmail.com> writes: > I'd imagine most of the time the source blocks within a single file > would share the vast majority of environment settings too (for example > setting the JVM's class path) so being able to specify these values to > pass to the interpreter, once at the top of the file would be really > nice. > I addressed the "passing command line" portion of your comment earlier but neglected the "setting file-wide header arguments" portion. RE: "setting file-wide header arguments" it is now possible to set header arguments for subtrees of a file using properties, for example the following will have :results silent set for all of it's code blocks. * silent :PROPERTIES: :results: silent :END: I agree file-wide settings would be useful, but they are not yet implemented. Best -- Eric ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Announcement] Org-babel initial release 2009-09-15 22:02 ` Eric Schulte @ 2009-10-09 16:38 ` Marcelo de Moraes Serpa 0 siblings, 0 replies; 16+ messages in thread From: Marcelo de Moraes Serpa @ 2009-10-09 16:38 UTC (permalink / raw To: Eric Schulte; +Cc: Org Mode [-- Attachment #1.1: Type: text/plain, Size: 1435 bytes --] That's awesome news! Thank you for this great contribution. Now I can use my beloved ruby to write view-extensions to my org PIM :D (even though I'm very interested in learning elisp, but this makes things much more practical and powerful!). Marcelo. On Tue, Sep 15, 2009 at 5:02 PM, Eric Schulte <schulte.eric@gmail.com>wrote: > Rick Moynihan <rick.moynihan@gmail.com> writes: > > > I'd imagine most of the time the source blocks within a single file > > would share the vast majority of environment settings too (for example > > setting the JVM's class path) so being able to specify these values to > > pass to the interpreter, once at the top of the file would be really > > nice. > > > > I addressed the "passing command line" portion of your comment earlier > but neglected the "setting file-wide header arguments" portion. > > RE: "setting file-wide header arguments" > > it is now possible to set header arguments for subtrees of a file using > properties, for example the following will have :results silent set for > all of it's code blocks. > > * silent > :PROPERTIES: > :results: silent > :END: > > I agree file-wide settings would be useful, but they are not yet > implemented. > > Best -- Eric > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > [-- Attachment #1.2: Type: text/html, Size: 2154 bytes --] [-- Attachment #2: Type: text/plain, Size: 204 bytes --] _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ^ permalink raw reply [flat|nested] 16+ messages in thread
* Org-babel for jython? 2009-09-14 13:44 [Announcement] Org-babel initial release Eric Schulte ` (2 preceding siblings ...) 2009-09-15 17:26 ` Sebastian Rose @ 2009-10-09 12:54 ` Eric S Fraga 2009-10-09 15:34 ` Dan Davison 3 siblings, 1 reply; 16+ messages in thread From: Eric S Fraga @ 2009-10-09 12:54 UTC (permalink / raw To: Eric Schulte; +Cc: Org Mode At Mon, 14 Sep 2009 07:44:57 -0600, Eric Schulte wrote: > > Dan Davison and I (Eric Schulte) are happy to announce that Org-babel > has now been released as a contributed package in Org-mode with > corresponding documentation on worg [1]. > > Org-babel provides the following functionality: > - Source-code execution and control of output in org buffers > - currently supported languages [2]: > - emacs-lisp > - shell scripts > - R > - ruby > - python Eric et al., any chance of creating a jython interface? Or has anybody else done this already? I've tried creating one from your org-babel-python.el file by changing all occurrences of python to jython (bar one: the run-python command as that actually does run jython automatically, much to my surprise!). That works for single shot executions. It does not work for sessions and I really don't know where to start looking... Any pointers or suggestions more than welcome, of course. What I've done may work for (un?)-tangled code but haven't tried yet. Thanks, eric ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Org-babel for jython? 2009-10-09 12:54 ` Org-babel for jython? Eric S Fraga @ 2009-10-09 15:34 ` Dan Davison 0 siblings, 0 replies; 16+ messages in thread From: Dan Davison @ 2009-10-09 15:34 UTC (permalink / raw To: Eric S Fraga; +Cc: Org Mode Eric S Fraga <ucecesf@ucl.ac.uk> writes: > Eric et al., > > any chance of creating a jython interface? Or has anybody else done > this already? > > I've tried creating one from your org-babel-python.el file by changing > all occurrences of python to jython (bar one: the run-python command > as that actually does run jython automatically, much to my surprise!). Hi Eric, Would you like to put your jython work so far in a public git branch, for example (pending responses to my excellent suggestion the other day...) http://repo.or.cz/w/org-mode/babel.git [normal webpage; not a git url] That way we can all have a go at it when time permits. If you email me offline I can send you the admin password to give yourself push permission. Dan > That works for single shot executions. It does not work for sessions > and I really don't know where to start looking... Any pointers or > suggestions more than welcome, of course. > > What I've done may work for (un?)-tangled code but haven't tried yet. > > Thanks, > eric > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2009-10-09 16:38 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-09-14 13:44 [Announcement] Org-babel initial release Eric Schulte 2009-09-15 8:20 ` Carsten Dominik 2009-09-15 13:31 ` Miguel Fernando Cabrera 2009-09-15 14:49 ` Eric Schulte 2009-09-15 15:10 ` Eric Schulte 2009-09-15 17:26 ` Sebastian Rose 2009-09-15 17:54 ` Eric Schulte 2009-09-15 19:15 ` Sebastian Rose 2009-09-15 20:03 ` Eric Schulte 2009-09-15 20:53 ` Sebastian Rose 2009-09-15 17:56 ` Rick Moynihan 2009-09-15 20:07 ` Eric Schulte 2009-09-15 22:02 ` Eric Schulte 2009-10-09 16:38 ` Marcelo de Moraes Serpa 2009-10-09 12:54 ` Org-babel for jython? Eric S Fraga 2009-10-09 15:34 ` Dan Davison
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.