From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Stoehr Subject: Re: Getting source code to work Date: Wed, 1 Aug 2012 14:11:38 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SweKv-00069N-Ey for emacs-orgmode@gnu.org; Wed, 01 Aug 2012 15:12:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SweKu-0002PM-28 for emacs-orgmode@gnu.org; Wed, 01 Aug 2012 15:12:01 -0400 Received: from mail-yx0-f169.google.com ([209.85.213.169]:38680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SweKt-0002Of-UY for emacs-orgmode@gnu.org; Wed, 01 Aug 2012 15:11:59 -0400 Received: by yenr5 with SMTP id r5so8916037yen.0 for ; Wed, 01 Aug 2012 12:11:59 -0700 (PDT) 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: "Thomas S. Dye" Cc: emacs-orgmode@gnu.org Thanks Tom, I do have (org-babel-do-load-languages 'org-babel-load-languages '((python . t) (R . t))) in my ~/.emacs.d/init.el and my version (from M-x org-version) is Org-mode version 7.8.11 Cheers, Mark On Wed, Aug 1, 2012 at 2:07 PM, Thomas S. Dye wrote: > Aloha Mark, > > Mark Stoehr writes: > >> Hi, I'm trying to include python source code in my document and I'm >> finding that org-babel-execute-buffer ( as well as C-c C-c at the end >> of a code block) does not successfully run my code, instead I get an >> error "Invalid function: org-save-outline-visibility". I saw messages >> earlier >> >> http://thread.gmane.org/gmane.emacs.orgmode/28048/focus=28049 >> >> regarding an apparently similar problem but my understanding of emacs >> lisp is insufficient for me to make sense of it. My program: >> >> #+BEGIN_SRC python >> print "Hello World" >> return 1+2 >> #+END_SRC >> >> >> I also have trouble getting tangle to work. With the following problem >> >> >> #+BEGIN_SRC python :tangle yes >> print "Hello World" >> return 1+2 >> #+END_SRC >> >> both C-c C-v t and M-x org-babel-tangle fail saying that 0 blocks have >> been tangled. I also tried the examples with the #+BEGIN_SRC and >> #+END_SRC being in lowercase and that didn't change anything. >> >> > > Your source code block evaluates fine on my setup: > > #+BEGIN_SRC python > print "Hello World" > return 1+2 > #+END_SRC > > #+RESULTS: > : 3 > > The error message you are getting refers to a bug that was apparently > fixed some time ago. What version of Org mode are you running? > > Also, did you tell Org mode that you will be evaluating Python code? > You should have something like this in .emacs: > > (org-babel-do-load-languages > 'org-babel-load-languages > '((R . t) > (C . t) > (ditaa . t) > (dot . t) > (emacs-lisp . t) > (gnuplot . nil) > (haskell . nil) > (latex . t) > (lisp . t) > (ocaml . nil) > (org . t) > (perl . t) > (python . t) # This is the line you'll need > (ruby . nil) > (screen . nil) > (sh . t) > (sql . nil) > (sqlite . t))) > > hth, > Tom > > -- > Thomas S. Dye > http://www.tsdye.com >