[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Error when running org-babel-execute-buffer -- Wrong type

From: Nick Dokos
Subject: Re: [Orgmode] Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil
Date: Fri, 19 Nov 2010 02:46:46 -0500

Eric Schulte <address@hidden> wrote:

> Thanks for doing most of the debugging on this.
> After much banging of my head, I stumbled onto this very nice page of
> common problems with compiled Macros in Emacs Lisp [1], it looks like
> this sort of thing has happened before. :)
> I realized I was guilty of one of the macro sins specified above, and
> after rectifying that design flaw I believe (at least for my simple test
> case) this error should be fixed.  Please let me know if you continue to
> run into this problem with the byte-compiled version of this macro.
> ...
> Footnotes: 
> [1]  
> http://www.gnu.org/s/emacs/manual/html_node/elisp/Problems-with-Macros.html

After Konrad reported that this doesn't fix it, I tried it too with his
simple org file and got the same error [fn:1].

So after trying the usual debugging tricks and coming up empty, I took a
look at the ob.elc file and the problem was obvious: the macro was not
expanded during compilation.  I'm not sure how exactly we get to the
``consp nil'' error that way, but I'm pretty sure that the solution is
to change the order of the macro and the function that uses it in ob.el,
so the definition precedes the use.


PS. I can now go to bed in peace...

[fn:1] OT to the above: I had to name the session , otherwise python would 

| Traceback (most recent call last):
|   File "<stdin>", line 5, in <module>
|   File "<stdin>", line 3, in main
| NameError: global name 'days' is not defined

Here for reference is my modification to Konrad's original example:

--8<---------------cut here---------------start------------->8---
* Vacation days
#+begin_src python :session foo :results silent
  days = 32+2+9

** Vacation <2010-10-28 Thu>-<2010-10-29 Fri>
#+begin_src python :session foo :results silent
  days -= 2

** Remaining days
#+begin_src python :session foo :results value

: 41
--8<---------------cut here---------------end--------------->8---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]