From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: Re: Wish: babel for python3 Date: Tue, 18 Oct 2011 17:56:25 +0900 Message-ID: <4E9D3F39.6020703@gmail.com> References: <87y5wntz12.fsf@yahoo.de> <1641361.izftS2FJEB@fluss> <3500778.0hWYKf89pM@fluss> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:46445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RG5TP-00075I-Gx for emacs-orgmode@gnu.org; Tue, 18 Oct 2011 04:56:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RG5TJ-0007gM-Tx for emacs-orgmode@gnu.org; Tue, 18 Oct 2011 04:56:35 -0400 Received: from mail-yw0-f41.google.com ([209.85.213.41]:56107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RG5TJ-0007gA-QL for emacs-orgmode@gnu.org; Tue, 18 Oct 2011 04:56:29 -0400 Received: by ywb3 with SMTP id 3so419131ywb.0 for ; Tue, 18 Oct 2011 01:56:29 -0700 (PDT) In-Reply-To: <3500778.0hWYKf89pM@fluss> 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: Arne Babenhauserheide Cc: emacs-orgmode@gnu.org Hi, (sorry Arne for the eventual double post, I forogot to attt the mailing list) >>>> Is there a way to get python3 support for Babel into org-mode >>>> cleanly? >> Something like: >> -*- org-babel-python-command: "python3" alternatively (a trick Eric is never tired to mention to me ) you could add a little lisp block which change all kind of language related aspects for you. This could include many more options and modify your emacs environment just to your personal needs for a certain language. Make one for python2 and one for python3 and execute them dependent on which system you are going to use. Without testing and without guarantee it should be something like the below code. To demonstrate some more functionality lets change the modebar background colour to make it more visible which python mode you are currently using. #+srcname: python2_env #+begin_src emacs-lisp (setq org-babel-python-command "python") (set-face-background 'modeline "#4477aa") #+end_src #+srcname: python3_env #+begin_src emacs-lisp (setq org-babel-python-command "python3") (set-face-background 'modeline "#771944") #+end_src Sure both could be done with file bounded variables too. But know you can switch between both environments within the same buffer, e.g., to check if the code runs on both python versions Regards Totti