From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Re: [ANN] Org-babel integrated into Org-mode Date: Fri, 25 Jun 2010 10:28:19 +0200 Message-ID: References: <87wrtp78rg.fsf@gmail.com> <87aaqkvqdi.fsf@mundaneum.com> <87iq585rb9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1523102353==" Return-path: Received: from [140.186.70.92] (port=55903 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSD6O-0005eG-BZ for emacs-orgmode@gnu.org; Fri, 25 Jun 2010 13:54:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OS4Gt-00078Y-SG for emacs-orgmode@gnu.org; Fri, 25 Jun 2010 04:28:28 -0400 Received: from mail-pw0-f41.google.com ([209.85.160.41]:64660) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OS4Gt-00078L-DD for emacs-orgmode@gnu.org; Fri, 25 Jun 2010 04:28:23 -0400 Received: by pwi7 with SMTP id 7so8368501pwi.0 for ; Fri, 25 Jun 2010 01:28:20 -0700 (PDT) In-Reply-To: <87iq585rb9.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode@gnu.org --===============1523102353== Content-Type: multipart/alternative; boundary=0016e64cad34aaae5f0489d68d3b --0016e64cad34aaae5f0489d68d3b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi First of all thanks for integrating Org-babel into Org-mode. But for the less fluent elisp and org-mode users, I am slightly confused in the changes necessary on my side. I have the following in my emacs.org file: #+begin_src emacs-lisp (require 'org-babel-R) ;; requires R and ess-mode ;; (require 'org-babel-ruby) ;; requires ruby, irb, ruby-mode, and inf-ruby (require 'org-babel-python) ;; requires python, and python-mode ;; (require 'org-babel-clojure) ;; requires clojure, clojure-mode, swank-clojure and slime #+end_src *** Start babel #+begin_src emacs-lisp (org-babel-load-library-of-babel) #+end_src *** Customization of sh set shebang for sh script to "#!/bin/bash" and exclude additional comment= s (t) #+begin_src emacs-lisp (setq org-babel-tangle-langs (cons '("sh" "sh" "#!/bin/bash" t) (remove-if (lambda (el) (string=3D (car el) "sh")) org-babel-tangle-langs= ))) #+end_src *** Customization of R set shebang for R script to "" and exclude additional comments (t) #+begin_src emacs-lisp (setq org-babel-tangle-langs (cons '("R" "R") (remove-if (lambda (el) (string=3D (car el) "R")) org-babel-tangle-langs)= )) #+end_src which custimizes the shebang creation and the comments in the tangled file. Do I have to change any settings, and if yes, how? The previous conversatio= n seems to say "yes, it needs to be changed", but I don't understand what and how. Thanks, Rainer. On Thu, Jun 24, 2010 at 6:27 PM, Eric Schulte wrote= : > Hi S=E9bastien, > > S=E9bastien Vauban writes: > > [...] > > > > For my own understanding, what's the status of `Org-babel-screen', for > which > > I've never been able to understand completely all the differences with > `sh' in > > `Org-babel'? > > > > I believe screen has more of a focus on sustained interaction with an > interactive terminal, although to be honest I haven't really used it and > can't say for sure. Benjamin Andresen, the author, may have a more > satisfying answer for you. > > > > > Second, a problem with the following code: > > > > ;; Org-babel needs to be told to recognize awk source code blocks > and > > ;; how they should be tangled, which can be accomplished with the > > ;; following: > > (org-babel-add-interpreter "awk") > > (add-to-list 'org-babel-tangle-langs '("awk" "awk")) > > > > (org-babel-add-interpreter "fortran") > > (add-to-list 'org-babel-tangle-langs '("fortran" "f")) > > > > ;; ;; org-babel panics when trying to evaluate ruby code blocks > because > > ;; ;; you don't have the required ruby executables available on > your > > ;; ;; system. Probably the best way to deal with this is to remov= e > ruby > > ;; ;; from the list of languages supported by babel: > > ;; (setq org-babel-interpreters (delete "ruby" > org-babel-interpreters)) > > > > ;; make pre-built helper functions (`lob') available > > ;; (org-babel-load-library-of-babel) > > > > ;; mapping between languages (listings in LaTeX) and their major > mode > > ;; (in Emacs) > > (setq org-src-lang-modes > > '(("ocaml" . tuareg) > > ("elisp" . emacs-lisp) > > ;; ("Delphi" . perl) > > ("ditaa" . artist) > > ("asymptote" . asy) > > ("dot" . fundamental))) > > ;; ) > > > > Neither org-babel-add-interpreter, neither its shorter version do exist > now? > > > > Yes, thanks for bringing this up! I realized last night that I forgot to > mention this in the announcement. > > We have simplified the handling of languages in Org-babel, in that the > org-babel-interpreters and org-babel-tangle-langs variables have both > been removed. > > Rather than keeping explicit lists of supported languages, Babel will > now try to work with every language, and will only give up if it can't > find a needed function (e.g. if there is no org-babel-execute:foo > function defined then babel will give up on evaluating a foo code > block). The only remaining language list is > `org-babel-tangle-lang-exts' which can optionally be used to associate > file extensions with language names, but is *not* required for > evaluation or tangling. > > Given this, your configuration from above could be rewritten as > > --8<---------------cut here---------------start------------->8--- > ;; Org-babel now needs less hand-holding :) however it could be > ;; useful to know extensions for some languages > (add-to-list 'org-babel-tangle-lang-exts '("fortran" . "f")) > > ;; mapping between languages (listings in LaTeX) and their major mod= e > ;; (in Emacs) > (setq org-src-lang-modes > '(("ocaml" . tuareg) > ("elisp" . emacs-lisp) > ;; ("Delphi" . perl) > ("ditaa" . artist) > ("asymptote" . asy) > ("dot" . fundamental))) > ;; ) > --8<---------------cut here---------------end--------------->8--- > > Cheers -- Eric > > > > > Best regards, > > Seb > > _______________________________________________ > 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 > --=20 NEW GERMAN FAX NUMBER!!! Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Cell: +27 - (0)83 9479 042 Fax: +27 - (0)86 516 2782 Fax: +49 - (0)321 2125 2244 email: Rainer@krugs.de Skype: RMkrug Google: R.M.Krug@gmail.com --0016e64cad34aaae5f0489d68d3b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi

First of all thanks for integrating Org-babel into Or= g-mode.

But for the less fluent elisp and org-mode= users, I am slightly confused in the changes necessary on my side.

I have the following in my emacs.org file:


#+begin_s= rc emacs-lisp
=A0=A0(require 'org-babel-R) =A0 =A0 =A0 =A0 ;; requires R and ess= -mode
=A0=A0;; (require 'org-babel-ruby) =A0 =A0 =A0;;= requires ruby, irb, ruby-mode, and inf-ruby
=A0=A0(require 'org-babel-python) =A0 =A0;; requires python, and p= ython-mode
=A0=A0;; (require 'org-babel-clojure) =A0 ;= ; requires clojure, clojure-mode, swank-clojure and slime
#+end_src
*** Start babel
#+begin_sr= c emacs-lisp
=A0=A0(org-babel-load-library-of-babel)
#+end_src
*** Customization of sh
=A0=A0set shebang for sh scri= pt to "#!/bin/bash" and exclude additional comments (t)
#+begin_src emacs-lisp
=A0=A0(setq org-babel-tangle-l= angs
=A0=A0(cons
=A0=A0'("sh" "sh"= "#!/bin/bash" t)
=A0=A0(remove-if (lambda (el) (string=3D (car el) "sh")) org= -babel-tangle-langs)))
#+end_src
*** Customization of R
=A0=A0set shebang for R script= to "" and exclude additional comments (t)
#+begin_src emacs-lisp
=A0=A0(setq org-babel-tangle-l= angs
=A0=A0(cons
=A0=A0'("R" "R")<= /font>
=A0=A0(remove-if (lambda (el) (string=3D (car el) "R")) org-= babel-tangle-langs)))
#+end_src

which custimizes the shebang creation and the com= ments in the tangled file. Do I have to change any settings, and if yes, ho= w? The previous conversation seems to say "yes, it needs to be changed= ", but I don't understand what and how.


Thanks,

Rainer.=
On Thu, Jun 24, 2010 at 6:27 PM, Eric Schult= e <schulte.e= ric@gmail.com> wrote:
Hi S=E9bastien,

S=E9bastien Vauban <wxhgmq= zgwmuf@spammotel.com> writes:

[...]
>
> For my own understanding, what's the status of `Org-babel-screen&#= 39;, for which
> I've never been able to understand completely all the differences = with `sh' in
> `Org-babel'?
>

I believe screen has more of a focus on sustained interaction with an=
interactive terminal, although to be honest I haven't really used it an= d
can't say for sure. =A0Benjamin Andresen, the author, may have a more satisfying answer for you.

>
> Second, a problem with the following code:
>
> =A0 =A0 =A0 ;; Org-babel needs to be told to r= ecognize awk source code blocks and
> =A0 =A0 =A0 ;; how they should be tangled, which can be accomplished w= ith the
> =A0 =A0 =A0 ;; following:
> =A0 =A0 =A0 (org-babel-add-interpreter "awk")
> =A0 =A0 =A0 (add-to-list 'org-babel-tangle-langs '("awk&q= uot; "awk"))
>
> =A0 =A0 =A0 (org-babel-add-interpreter "fortran")
> =A0 =A0 =A0 (add-to-list 'org-babel-tangle-langs '("fortr= an" "f"))
>
> =A0 =A0 =A0 ;; ;; org-babel panics when trying to evaluate ruby code b= locks because
> =A0 =A0 =A0 ;; ;; you don't have the required ruby executables ava= ilable on your
> =A0 =A0 =A0 ;; ;; system. Probably the best way to deal with this is t= o remove ruby
> =A0 =A0 =A0 ;; ;; from the list of languages supported by babel:
> =A0 =A0 =A0 ;; (setq org-babel-interpreters (delete "ruby" o= rg-babel-interpreters))
>
> =A0 =A0 =A0 ;; make pre-built helper functions (`lob') available > =A0 =A0 =A0 ;; (org-babel-load-library-of-babel)
>
> =A0 =A0 =A0 ;; mapping between languages (listings in LaTeX) and their= major mode
> =A0 =A0 =A0 ;; (in Emacs)
> =A0 =A0 =A0 (setq org-src-lang-modes
> =A0 =A0 =A0 =A0 =A0 =A0 '(("ocaml" . tuareg)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 ("elisp" . emacs-lisp)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; ("Delphi" . perl)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 ("ditaa" . artist)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 ("asymptote" . asy)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 ("dot" . fundamental)))
> =A0 =A0 =A0 ;; )
>
> Neither org-babel-add-interpreter, neither its= shorter version do exist now?
>

Yes, thanks for bringing this up! I realized last night that I forgot= to
mention this in the announcement.

We have simplified the handling of languages in Org-babel, in that the
org-babel-interpreters and org-babel-tangle-langs variables have both
been removed.

Rather than keeping explicit lists of supported languages, Babel will
now try to work with every language, and will only give up if it can't<= br> find a needed function (e.g. if there is no org-babel-execute:foo
function defined then babel will give up on evaluating a foo code
block). =A0The only remaining language list is
`org-babel-tangle-lang-exts' which can optionally be used to associate<= br> file extensions with language names, but is *not* required for
evaluation or tangling.

Given this, your configuration from above could be rewritten as

--8<---------------cut here---------------start------------->8---
=A0 =A0 =A0;; Org-babel now needs less hand-holding :) however it co= uld be
=A0 =A0 =A0;; useful to know extensions for some languages
=A0 =A0 =A0(add-to-list 'org-babel-tangle-lang-exts '("fortra= n" . "f"))

=A0 =A0 =A0;; mapping between languages (listings in LaTeX) and their majo= r mode
=A0 =A0 =A0;; (in Emacs)
=A0 =A0 =A0(setq org-src-lang-modes
=A0 =A0 =A0 =A0 =A0 =A0'(("ocaml" . tuareg)
=A0 =A0 =A0 =A0 =A0 =A0 =A0("elisp" . emacs-lisp)
=A0 =A0 =A0 =A0 =A0 =A0 =A0;; ("Delphi" . perl)
=A0 =A0 =A0 =A0 =A0 =A0 =A0("ditaa" . artist)
=A0 =A0 =A0 =A0 =A0 =A0 =A0("asymptote" . asy)
=A0 =A0 =A0 =A0 =A0 =A0 =A0("dot" . fundamental)))
=A0 =A0 =A0;; )
--8<---------------cut here---------------end--------------->8---

Cheers -- Eric

>
> Best regards,
> =A0 Seb

_______________________________________________
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



--
NEW GERMAN = FAX NUMBER!!!

Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (= Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellen= ce for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch UniversityMain Campus, Merriman Avenue
Stellenbosch
South Africa

Cell:= =A0 =A0 =A0 =A0 =A0 +27 - (0)83 9479 042
Fax: =A0 =A0 =A0 =A0 =A0 =A0+2= 7 - (0)86 516 2782
Fax: =A0 =A0 =A0 =A0 =A0 =A0+49 - (0)321 2125 2244
email: =A0 =A0 =A0 = =A0 =A0Rainer@krugs.de

Skype:= =A0 =A0 =A0 =A0 =A0RMkrug
Google: =A0 =A0 =A0 =A0 R.M.Krug@gmail.com

--0016e64cad34aaae5f0489d68d3b-- --===============1523102353== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============1523102353==--