Re: [Orgmode] Re: Babel, Python and UTF-8

2010-12-06 Thread Thomas S. Dye
On Dec 6, 2010, at 8:07 AM, Achim Gratz wrote: "Thomas S. Dye" writes: Emacs configuration is one of the highest barriers to entry for potential adopters of Org-mode, IMO. The idea of context-sensitive configuration is potentially terrific. It gets the user to work more quickly than would o

[Orgmode] Re: Babel, Python and UTF-8

2010-12-06 Thread Dan Davison
"Thomas S. Dye" writes: > Hi Dan, > > Emacs configuration is one of the highest barriers to entry for > potential adopters of Org-mode, IMO. The idea of context-sensitive > configuration is potentially terrific. It gets the user to work more > quickly than would otherwise be the case. The prob

[Orgmode] Re: Babel, Python and UTF-8

2010-12-06 Thread Achim Gratz
"Thomas S. Dye" writes: > Emacs configuration is one of the highest barriers to entry for > potential adopters of Org-mode, IMO. The idea of context-sensitive > configuration is potentially terrific. It gets the user to work more > quickly than would otherwise be the case. The problem I've run

Re: [Orgmode] Re: Babel, Python and UTF-8

2010-12-06 Thread Thomas S. Dye
Hi Dan, Emacs configuration is one of the highest barriers to entry for potential adopters of Org-mode, IMO. The idea of context-sensitive configuration is potentially terrific. It gets the user to work more quickly than would otherwise be the case. The problem I've run into is that ex

Re: [Orgmode] Re: Babel, Python and UTF-8

2010-12-06 Thread Eric S Fraga
Dan Davison writes: > This makes me think of another good use of the sbe ("src block eval") > function. I'm often seeing Org documents with a src block like this, > > #+source: essential-document-config > #+begin_src emacs-lisp > ;; some essential document-specific configuration > #+end_src > > a

[Orgmode] Re: Babel, Python and UTF-8

2010-12-06 Thread Dan Davison
"Eric Schulte" writes: > Vincent Beffara writes: > >> Hi, >> (and it would be excellent to allow for a code block as a preamble, instead of a string in the header or as an alternative, because preambles once they are allowed tend to grow uncontrollably ;->) >>> >>> This is current

Re: [Orgmode] Re: Babel, Python and UTF-8

2010-12-05 Thread Eric Schulte
Vincent Beffara writes: > Hi, > >>> (and it would be excellent to allow for a code block as a preamble, >>> instead of a string in the header or as an alternative, because >>> preambles once they are allowed tend to grow uncontrollably ;->) >> >> This is currently possible using the `sbe' functio

[Orgmode] Re: Babel, Python and UTF-8

2010-12-03 Thread Vincent Beffara
Hi, >> (and it would be excellent to allow for a code block as a preamble, >> instead of a string in the header or as an alternative, because >> preambles once they are allowed tend to grow uncontrollably ;->) > > This is currently possible using the `sbe' function. Arbitrary emacs > lisp can be

Re: [Orgmode] Re: Babel, Python and UTF-8

2010-12-03 Thread Christopher Allan Webber
(Also worth mentioning that python 3 allows you to use actual unicode characters inside strings in the file, not \xff chars; not sure if org-babel needs to change its habits between python2 and python3?) Vincent Beffara writes: >>> #+begin_src python >>> # -*- coding: utf-8 -*- >>> s = "é" >>> #

Re: [Orgmode] Re: Babel, Python and UTF-8

2010-12-03 Thread Eric Schulte
Hi, Vincent Beffara writes: > Hi, > > "preamble" sounds fine As this seems to be the general consensus I've replaced "prefix" with "preamble" as the header argument name > (and it would be excellent to allow for a code block as a preamble, > instead of a string in the header or as an alternati

[Orgmode] Re: Babel, Python and UTF-8

2010-12-03 Thread Sébastien Vauban
Hi Vincent, Vincent Beffara wrote: > "preamble" sounds fine (and it would be excellent to allow for a code > block as a preamble, instead of a string in the header or as an > alternative, because preambles once they are allowed tend to grow > uncontrollably ;->) If you want a bigger preamble, jus

[Orgmode] Re: Babel, Python and UTF-8

2010-12-03 Thread Vincent Beffara
Hi, "preamble" sounds fine (and it would be excellent to allow for a code block as a preamble, instead of a string in the header or as an alternative, because preambles once they are allowed tend to grow uncontrollably ;->) >> The :shebang header argument is only used for tangling, not during >>

[Orgmode] Re: Babel, Python and UTF-8

2010-12-02 Thread Sébastien Vauban
Hi Eric, "Eric Schulte" wrote: > Sébastien Vauban writes: >> Isn't such a prefix already available through the "shebang" option: can't it >> be multiline? Anyway, I don't think it's the problem here... > > The :shebang header argument is only used for tangling, not during > evaluation, however i

[Orgmode] Re: Babel, Python and UTF-8

2010-12-02 Thread Sébastien Vauban
Hi Eric and Dan, "Eric Schulte" wrote: > Dan Davison writes: >> "Eric Schulte" writes: >>> >>> I've just pushed up a new prefix header argument. >> >> "preamble" might be a better name? or "header"? prefix makes me think of >> adding a string onto the front of a string[1]; > > Absolutely, "prefi

[Orgmode] Re: Babel, Python and UTF-8

2010-12-02 Thread Eric Schulte
Dan Davison writes: > "Eric Schulte" writes: > >> Hi, >> >> I've just pushed up a new prefix header argument. > > "preamble" might be a better name? or "header"? prefix makes me think of > adding a string onto the front of a string[1]; Absolutely, "prefix" was just the most obvious to me and I

Re: [Orgmode] Re: Babel, Python and UTF-8

2010-12-02 Thread Eric Schulte
Sébastien Vauban writes: > > Isn't such a prefix already available through the "shebang" option: can't it > be multiline? Anyway, I don't think it's the problem here... > The :shebang header argument is only used for tangling, not during evaluation, however if you ever needed to tangle python c

[Orgmode] Re: Babel, Python and UTF-8

2010-12-02 Thread Dan Davison
"Eric Schulte" writes: > Hi, > > I've just pushed up a new prefix header argument. "preamble" might be a better name? or "header"? prefix makes me think of adding a string onto the front of a string[1]; preamble and header are used by e.g. latex to refer to prelimary lines at the top of a file.

[Orgmode] Re: Babel, Python and UTF-8

2010-12-02 Thread Vincent Beffara
Hi, > I've just pushed up a new prefix header argument. Fantastic ! It works exactly as needed. Thanks a lot ! > This header argument only has meaning for python code blocks (since it > is tied into evaluation each language would have to handle it > separately). That's fine, most cases can pr

[Orgmode] Re: Babel, Python and UTF-8

2010-12-02 Thread Vincent Beffara
>> #+begin_src python >> # -*- coding: utf-8 -*- >> s = "é" >> #+end_src > > I'm not sure to understand your problem. In fact, the problem is not > about "inserting a prefix to the block", it's about the coding system > itself, I guess. > > Your "é" in your Org buffer, how is it encoded? Is your

[Orgmode] Re: Babel, Python and UTF-8

2010-12-02 Thread Sébastien Vauban
Hi Vincent and Eric, Vincent Beffara wrote: >> I would suggest just trying it out first and seeing if you get an error >> without such a line. > > Well, I do, that's why I'm asking ;-) > >> Also, you could try adding the line to the beginning of your code >> block. > > I tried like this : > > #+be

[Orgmode] Re: Babel, Python and UTF-8

2010-12-02 Thread Sébastien Vauban
Hi Vincent and Eric, Vincent Beffara wrote: >> I would suggest just trying it out first and seeing if you get an error >> without such a line. > > Well, I do, that's why I'm asking ;-) > >> Also, you could try adding the line to the beginning of your code >> block. > > I tried like this : > > #+be

Re: [Orgmode] Re: Babel, Python and UTF-8

2010-12-02 Thread Eric Schulte
Hi, I've just pushed up a new prefix header argument. This header argument only has meaning for python code blocks (since it is tied into evaluation each language would have to handle it separately). This is only used during external evaluation (i.e. not when :session is specified) and the value

[Orgmode] Re: Babel, Python and UTF-8

2010-12-01 Thread Vincent Beffara
Hi, > I would suggest just trying it out first and seeing if you get an error > without such a line. Well, I do, that's why I'm asking ;-) > Also, you could try adding the line to the beginning of your code > block. I tried like this : --8<---cut here---start--