From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil Date: Fri, 19 Nov 2010 02:46:46 -0500 Message-ID: <20160.1290152806@gamaville.dokosmarshall.org> References: <0D7DA87B-B899-4BBF-9DAC-A39F0DB9E141@fastmail.net> <87vd48ncwf.fsf@gmail.com> <12A10080-909D-4C02-8081-2AAD03C2D113@fastmail.net> <4281.1289227525@gamaville.dokosmarshall.org> <87lj4vvhup.wl%dmaus@ictsoc.de> <874obfjxz3.fsf@gmail.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from [140.186.70.92] (port=48175 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJLgR-0001lu-U8 for emacs-orgmode@gnu.org; Fri, 19 Nov 2010 02:47:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJLgQ-000556-Ps for emacs-orgmode@gnu.org; Fri, 19 Nov 2010 02:46:59 -0500 Received: from vms173005pub.verizon.net ([206.46.173.5]:58877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJLgQ-000552-Kg for emacs-orgmode@gnu.org; Fri, 19 Nov 2010 02:46:58 -0500 Received: from gamaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173005.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LC400KW9G9YMR30@vms173005.mailsrvcs.net> for emacs-orgmode@gnu.org; Fri, 19 Nov 2010 01:46:47 -0600 (CST) In-reply-to: Message from "Eric Schulte" of "Wed, 17 Nov 2010 17:07:28 MST." <874obfjxz3.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: David Maus , Konrad Hinsen , nicholas.dokos@hp.com, emacs-orgmode Mailinglist , Ista Zahn Eric Schulte 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. Cheers, Nick PS. I can now go to bed in peace... Footnotes: [fn:1] OT to the above: I had to name the session , otherwise python would report ,---- | Traceback (most recent call last): | File "", line 5, in | File "", 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 #+end_src ** Vacation <2010-10-28 Thu>-<2010-10-29 Fri> #+begin_src python :session foo :results silent days -= 2 #+end_src ** Remaining days #+begin_src python :session foo :results value days #+end_src #+results: : 41 --8<---------------cut here---------------end--------------->8---