From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel] Export problem (Wrong type argument: consp, nil) Date: Thu, 08 Sep 2011 11:33:31 -0600 Message-ID: <87hb4ndj1f.fsf@gmail.com> References: <80litzcbg1.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1ig1-0001qN-K1 for emacs-orgmode@gnu.org; Thu, 08 Sep 2011 13:46:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1ig0-0001es-6m for emacs-orgmode@gnu.org; Thu, 08 Sep 2011 13:46:13 -0400 Received: from mail-yw0-f41.google.com ([209.85.213.41]:63072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1ig0-0001ei-3U for emacs-orgmode@gnu.org; Thu, 08 Sep 2011 13:46:12 -0400 Received: by ywm13 with SMTP id 13so980282ywm.0 for ; Thu, 08 Sep 2011 10:46:11 -0700 (PDT) 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: Sebastien Vauban Cc: emacs-orgmode@gnu.org Hi Seb, All variables must be given a default value, which is why it is an error to write a code block like the following. #+source: circle(x) #+begin_src python return x*x #+end_src I've just pushed up a change which provides a better error message in this case. Best -- Eric "Sebastien Vauban" writes: > Hi, > > #+TITLE: Export problem > #+AUTHOR: Seb Vauban > #+DATE: 2011-09-08 > #+LANGUAGE: en > > * Works OK > > #+source: square(x=6) > #+begin_src python > return x*x > #+end_src > > * Does not work > > If there is no value assigned to the code block... > > #+source: circle(x) > #+begin_src python > return x*x > #+end_src > > ... there is no an error when exporting: > > #+begin_src text > Debugger entered--Lisp error: (wrong-type-argument consp nil) > setcdr(nil "nil=x") > (setf (cddr (nth variable-index vars)) (concat (symbol-name ...) "=" (cdr pair))) > (prog1 (setf (cddr ...) (concat ... "=" ...)) (incf variable-index)) > (if name (setq vars (append ... ...)) (prog1 (setf ... ...) (incf variable-index))) > (let ((name ...)) (if name (setq vars ...) (prog1 ... ...))) > (cond ((eql ... ...) (let ... ...)) ((eql ... ...) (setq results ...)) ((eql ... ...) (when ... ... ... ...)) ((eql ... ...) (setq exports ...)) ((eql ... ...) (setq tangle ...)) ((eql ... ...) (setq noweb ...)) ((eql ... ...) (setq cache ...)) ((eql ... ...) (setq padline ...)) ((eql ... ...) (setq shebang ...)) ((eql ... ...) (setq comments ...)) (t (setq params ...))) > (case (car pair) (:var (let ... ...)) (:results (setq results ...)) (:file (when ... ... ... ...)) (:exports (setq exports ...)) (:tangle (setq tangle ...)) (:noweb (setq noweb ...)) (:cache (setq cache ...)) (:padline (setq padline ...)) (:shebang (setq shebang ...)) (:comments (setq comments ...)) (t (setq params ...))) > (lambda (pair) (case (car pair) (:var ...) (:results ...) (:file ...) (:exports ...) (:tangle ...) (:noweb ...) (:cache ...) (:padline ...) (:shebang ...) (:comments ...) (t ...)))((:var . "x")) > mapc((lambda (pair) (case (car pair) (:var ...) (:results ...) (:file ...) (:exports ...) (:tangle ...) (:noweb ...) (:cache ...) (:padline ...) (:shebang ...) (:comments ...) (t ...))) ((:var . "x"))) > (lambda (plist) (mapc (lambda ... ...) plist))(((:var . "x"))) > mapc((lambda (plist) (mapc (lambda ... ...) plist)) (((:var . "x")) ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "code") (:results . "replace") (:padnewline . "yes") (:hlines . "no") (:session . "none")))) > (progn (fset (quote e-merge) (function* ...)) (mapc (lambda ... ...) plists)) > (unwind-protect (progn (fset ... ...) (mapc ... plists)) (if --cl-letf-bound-- (fset ... --cl-letf-save--) (fmakunbound ...))) > (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-protect (progn ... ...) (if --cl-letf-bound-- ... ...))) > (letf ((... ...)) (mapc (lambda ... ...) plists)) > (letf* ((... ...)) (mapc (lambda ... ...) plists)) > (flet ((e-merge ... ...)) (mapc (lambda ... ...) plists)) > (let ((results-exclusive-groups ...) (exports-exclusive-groups ...) (variable-index 0) params results exports tangle noweb cache vars shebang comments padline) (flet (...) (mapc ... plists)) (setq vars (reverse vars)) (while vars (setq params ...)) (mapc (lambda ... ...) (quote ...)) params) > org-babel-merge-params(((:var . "x")) ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "code") (:results . "replace") (:padnewline . "yes") (:hlines . "no") (:session . "none"))) > (setcar (nthcdr 2 info) (org-babel-merge-params (mapcar ... ...) (nth 2 info))) > (setf (nth 2 info) (org-babel-merge-params (mapcar ... ...) (nth 2 info))) > (progn (setf (nth 2 info) (org-babel-merge-params ... ...))) > (if (match-string 6) (progn (setf ... ...))) > (when (match-string 6) (setf (nth 2 info) (org-babel-merge-params ... ...))) > (progn (setq name (org-babel-clean-text-properties ...)) (when (match-string 6) (setf ... ...))) > #+end_src > > Best regards, > Seb -- Eric Schulte http://cs.unm.edu/~eschulte/