Re: [Orgmode] Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil

2010-11-19 Thread Eric Schulte
Thanks for the suggestion Nick,

I've moved the macro definition up towards the top of ob.el, and for
good measure I am now autoloading it.  After this change I am able to
call both ob-execute-subtree and ob-execute-buffer without error on the
following simple Org-mode file

* top
** first
#+begin_src emacs-lisp
  (+ 1 1 1 1 1)
#+end_src

** second
#+begin_src emacs-lisp
  (message even more)
#+end_src

Could you and/or Konrad let me know if this now works on your systems,
and if not could you send me an example file that exercises the error?

Thanks -- Eric

Nick Dokos nicholas.do...@hp.com writes:

 Eric Schulte schulte.e...@gmail.com 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 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:

 * 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
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil

2010-11-19 Thread Konrad Hinsen

On 19 Nov 2010, at 09:19, Eric Schulte wrote:


Could you and/or Konrad let me know if this now works on your systems,
and if not could you send me an example file that exercises the error?


It works fine now!

Thanks,
  Konrad.


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil

2010-11-18 Thread Konrad Hinsen

On 18 Nov 2010, at 01:07, 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.


Yes, nothing has changed: it works fine when I run from source code,  
it breaks (same error message as before) if I do a make in my org  
directory before starting emacs.


Sorry,
  Konrad.

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil

2010-11-18 Thread Nick Dokos
Eric Schulte schulte.e...@gmail.com 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 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
#+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---


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil

2010-11-17 Thread Eric Schulte
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.

Best -- Eric

David Maus dm...@ictsoc.de writes:

 At Mon, 08 Nov 2010 09:45:25 -0500,
 Nick Dokos wrote:
 Something to do with the compilation of the org-babel-map-src-blocks
 macro, no doubt.  I don't see it with uncompiled files.

 Not a solution, but some debugging showed that
 `org-babel-get-src-block-info' fails to get the info of the source
 block when run byte-compiled.

 If I change the last sexp of the function

 (when info (append info (list name indent)))

 to

 (if info (append info (list name indent))
  (error EMPTY INFO))

 And run byte-compiled Org, the EMPTY INFO error is thrown before the
 invalid argument.

 Best,
   -- David
 --
 OpenPGP... 0x99ADB83B5A4478E6
 Jabber dmj...@jabber.org
 Email. dm...@ictsoc.de
 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Footnotes: 
[1]  http://www.gnu.org/s/emacs/manual/html_node/elisp/Problems-with-Macros.html


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil

2010-11-14 Thread David Maus
At Mon, 08 Nov 2010 09:45:25 -0500,
Nick Dokos wrote:
 Something to do with the compilation of the org-babel-map-src-blocks
 macro, no doubt.  I don't see it with uncompiled files.

Not a solution, but some debugging showed that
`org-babel-get-src-block-info' fails to get the info of the source
block when run byte-compiled.

If I change the last sexp of the function

(when info (append info (list name indent)))

to

(if info (append info (list name indent))
 (error EMPTY INFO))

And run byte-compiled Org, the EMPTY INFO error is thrown before the
invalid argument.

Best,
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber dmj...@jabber.org
Email. dm...@ictsoc.de


pgpWX3S6edexH.pgp
Description: PGP signature
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil

2010-11-08 Thread Konrad Hinsen
On 02.11.2010, at 17:09, Ista Zahn wrote:

 I recently upgraded to version 7.3 (from 7.01), and discovered that
 org-babel-execute-buffer no longer works, returning Wrong type
 argument: consp, nil.

I just ran into the same problem... Did you find a workaround, other than going 
back to some older release?

Konrad.


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil

2010-11-08 Thread Eric Schulte
I'm unable to re-create this problem.  Could you please send a minimal
example file in which the problem occurs?

Thanks -- Eric

Konrad Hinsen konrad.hin...@fastmail.net writes:

 On 02.11.2010, at 17:09, Ista Zahn wrote:

 I recently upgraded to version 7.3 (from 7.01), and discovered that
 org-babel-execute-buffer no longer works, returning Wrong type
 argument: consp, nil.

 I just ran into the same problem... Did you find a workaround, other than 
 going back to some older release?

 Konrad.


 ___
 Emacs-orgmode mailing list
 Please use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil

2010-11-08 Thread Konrad Hinsen
On 08.11.2010, at 14:49, Eric Schulte wrote:

 I'm unable to re-create this problem.  Could you please send a minimal
 example file in which the problem occurs?

Here is an example file. Open it and run org-babel-execute-buffer, and you will 
get Wrong type argument: consp, nil. Then type C-c C-c on the three code 
blocks in order: everything works as expected. Do org-babel-execute-buffer 
again, and it will complain about an undefined function 
org-babel-map-src-blocks.

Konrad.


test.org
Description: Binary data
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil

2010-11-08 Thread Eric S Fraga
Konrad Hinsen konrad.hin...@fastmail.net writes:

 On 08.11.2010, at 14:49, Eric Schulte wrote:

 I'm unable to re-create this problem.  Could you please send a minimal
 example file in which the problem occurs?

 Here is an example file. Open it and run org-babel-execute-buffer, and you 
 will get Wrong type
 argument: consp, nil. Then type C-c C-c on the three code blocks in order: 
 everything works as
 expected. Do org-babel-execute-buffer again, and it will complain about an 
 undefined function
 org-babel-map-src-blocks.

 Konrad.

Data point: this fails for me as well with the same error.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.3 (release_7.3.43.g10c8)

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil

2010-11-08 Thread Nick Dokos
Konrad Hinsen konrad.hin...@fastmail.net wrote:

 On 08.11.2010, at 14:49, Eric Schulte wrote:
 
  I'm unable to re-create this problem.  Could you please send a minimal
  example file in which the problem occurs?
 
 Here is an example file. Open it and run org-babel-execute-buffer, and
 you will get Wrong type argument: consp, nil. Then type C-c C-c on
 the three code blocks in order: everything works as expected. Do
 org-babel-execute-buffer again, and it will complain about an
 undefined function org-babel-map-src-blocks.
 

Something to do with the compilation of the org-babel-map-src-blocks
macro, no doubt.  I don't see it with uncompiled files.

HTH,
Nick

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil

2010-11-08 Thread Konrad Hinsen
On 08.11.2010, at 15:45, Nick Dokos wrote:

 Konrad Hinsen konrad.hin...@fastmail.net wrote:
 
 On 08.11.2010, at 14:49, Eric Schulte wrote:
 
 I'm unable to re-create this problem.  Could you please send a minimal
 example file in which the problem occurs?
 
 Here is an example file. Open it and run org-babel-execute-buffer, and
 you will get Wrong type argument: consp, nil. Then type C-c C-c on
 the three code blocks in order: everything works as expected. Do
 org-babel-execute-buffer again, and it will complain about an
 undefined function org-babel-map-src-blocks.
 
 
 Something to do with the compilation of the org-babel-map-src-blocks
 macro, no doubt.  I don't see it with uncompiled files.

I confirm. Removing all the byte-compiled files from my org-mode directory and 
restarting emacs solves the problem. That's already a useful workaround, thanks!

Konrad.
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Error when running org-babel-execute-buffer -- Wrong type argument: consp, nil

2010-11-02 Thread Ista Zahn
Hi,
I recently upgraded to version 7.3 (from 7.01), and discovered that
org-babel-execute-buffer no longer works, returning Wrong type
argument: consp, nil. This behavior is exists even with the simplest
of examples, such as

#+begin_src R
2+2
#+end_src

and persists even when I reduce my .emacs file down to a bare minimum of

;;Set up org mode
(require 'org-install)
(add-to-list 'auto-mode-alist '(\\.org$ . org-mode))
(define-key global-map \C-cl 'org-store-link)
(define-key global-map \C-ca 'org-agenda)
;; Enable R, latex, lisp support
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)
   (latex . t)))

org-babel-execute-src_block works. If all blocks have been evaluated,
then running org-babel-execute-buffer  works (even if  a block has
changed), although it returns a message saying Invalid function:
org-babel-map-src-blocks (I don't know if this is related or not). In
other words, org-babel-execute-buffer works to update blocks that have
previously been evaluated, but fails when the buffer contains
unevaluated blocks.

This is with org version 7.3, and I get the same behavior using emacs
version 23.2.1 and emacs version 24.0.50.1

Any help will be appreciated.

Best,
-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode