emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Lisp code blocks fail
@ 2013-11-13  5:04 Thomas S. Dye
  2013-11-13 14:18 ` Eric Schulte
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas S. Dye @ 2013-11-13  5:04 UTC (permalink / raw)
  To: Org-mode

Aloha all,

With a recent pull, Lisp code blocks that I'm fairly certain were
working previously started to fail. There is a backtrace below. The Lisp
code executes correctly, but Babel doesn't appear to get the results in
the form it expects (if I'm reading the backtrace correctly).

Have I mucked up somehow?

Debugger entered--Lisp error: (wrong-type-argument listp "((\"t2\" \"b\"))")
  byte-code("\b\211A@)\207" [result x] 2)
  org-babel-execute:lisp("(unless (boundp '*cycle-graph*)\n    (defvar *cycle-graph*))\n(setq *cycle-graph* (populate (make-instance 'digraph)))\n(let ((r)\n      (flag))\n  (dolist (e edges r)\n    (add-edge *cycle-graph*\n              (list (read-from-string (first e))\n                    (read-from-string (second e))))\n    (when (and (not flag) (setf flag (cycles *cycle-graph*))) (push e r))))" ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . "no") (:exports . "code") (:results . "silent") (:var edges ("t1" "a") ("a" "t2") ("b" "t1") ("t2" "b")) (:colnames . "yes") (:hlines . "no") (:session . "none") (:result-type . value) (:result-params "silent") (:rowname-names) (:colname-names (edges "older" "younger"))))
  org-babel-execute-src-block(nil)
  org-babel-execute-src-block-maybe()
  org-babel-execute-maybe()
  org-babel-execute-safely-maybe()
  run-hook-with-args-until-success(org-babel-execute-safely-maybe)
  org-ctrl-c-ctrl-c(nil)
  ad-Orig-call-interactively(org-ctrl-c-ctrl-c nil nil)
  (with-no-warnings (ad-Orig-call-interactively function record-flag keys))
  (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys)))
  (let ((ido-ubiquitous-next-override (ido-ubiquitous-get-command-override function))) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys))))
  (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override function) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys))))
  (let (ad-return-value) (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override function) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys)))) ad-return-value)
  call-interactively(org-ctrl-c-ctrl-c nil nil)

All the best,
Tom
-- 
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Lisp code blocks fail
  2013-11-13  5:04 Lisp code blocks fail Thomas S. Dye
@ 2013-11-13 14:18 ` Eric Schulte
  2013-11-13 21:18   ` Thomas S. Dye
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Schulte @ 2013-11-13 14:18 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Org-mode

Hi Tom,

Could you provide a minimal example?  I'm unable to debug from the stack
trace alone.

Thanks,

tsd@tsdye.com (Thomas S. Dye) writes:

> Aloha all,
>
> With a recent pull, Lisp code blocks that I'm fairly certain were
> working previously started to fail. There is a backtrace below. The Lisp
> code executes correctly, but Babel doesn't appear to get the results in
> the form it expects (if I'm reading the backtrace correctly).
>
> Have I mucked up somehow?
>
> Debugger entered--Lisp error: (wrong-type-argument listp "((\"t2\" \"b\"))")
>   byte-code("\b\211A@)\207" [result x] 2)
>   org-babel-execute:lisp("(unless (boundp '*cycle-graph*)\n (defvar
> *cycle-graph*))\n(setq *cycle-graph* (populate (make-instance
> digraph)))\n(let ((r)\n (flag))\n (dolist (e edges r)\n (add-edge
> *cycle-graph*\n (list (read-from-string (first e))\n (read-from-string
> (second e))))\n (when (and (not flag) (setf flag (cycles
> *cycle-graph*))) (push e r))))" ((:comments . "") (:shebang . "")
> (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . "no")
> (:exports . "code") (:results . "silent") (:var edges ("t1" "a") ("a"
> "t2") ("b" "t1") ("t2" "b")) (:colnames . "yes") (:hlines . "no")
> (:session . "none") (:result-type . value) (:result-params "silent")
> (:rowname-names) (:colname-names (edges "older" "younger"))))
>   org-babel-execute-src-block(nil)
>   org-babel-execute-src-block-maybe()
>   org-babel-execute-maybe()
>   org-babel-execute-safely-maybe()
>   run-hook-with-args-until-success(org-babel-execute-safely-maybe)
>   org-ctrl-c-ctrl-c(nil)
>   ad-Orig-call-interactively(org-ctrl-c-ctrl-c nil nil)
>   (with-no-warnings (ad-Orig-call-interactively function record-flag keys))
>   (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys)))
>   (let ((ido-ubiquitous-next-override
> (ido-ubiquitous-get-command-override function))) (setq ad-return-value
> (with-no-warnings (ad-Orig-call-interactively function record-flag
> keys))))
>   (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override
> function) (setq ad-return-value (with-no-warnings
> (ad-Orig-call-interactively function record-flag keys))))
>   (let (ad-return-value) (ido-ubiquitous-with-override
> (ido-ubiquitous-get-command-override function) (setq ad-return-value
> (with-no-warnings (ad-Orig-call-interactively function record-flag
> keys)))) ad-return-value)
>   call-interactively(org-ctrl-c-ctrl-c nil nil)
>
> All the best,
> Tom

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Lisp code blocks fail
  2013-11-13 14:18 ` Eric Schulte
@ 2013-11-13 21:18   ` Thomas S. Dye
  2013-11-13 21:33     ` Eric Schulte
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas S. Dye @ 2013-11-13 21:18 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org-mode

Hi Eric,

#+begin_src lisp
(+ 1 1)
#+end_src

Debugger entered--Lisp error: (wrong-type-argument listp "2")
  byte-code("\b\211A@)\207" [result x] 2)
  org-babel-execute:lisp("(+ 1 1)" ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . "no") (:exports . "code") (:results . "replace") (:session . "none") (:hlines . "no") (:result-type . value) (:result-params "replace") (:rowname-names) (:colname-names)))
  org-babel-execute-src-block(nil)
  org-babel-execute-src-block-maybe()
  org-babel-execute-maybe()
  org-babel-execute-safely-maybe()
  run-hook-with-args-until-success(org-babel-execute-safely-maybe)
  org-ctrl-c-ctrl-c(nil)
  ad-Orig-call-interactively(org-ctrl-c-ctrl-c nil nil)
  (with-no-warnings (ad-Orig-call-interactively function record-flag keys))
  (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys)))
  (let ((ido-ubiquitous-next-override (ido-ubiquitous-get-command-override function))) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys))))
  (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override function) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys))))
  (let (ad-return-value) (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override function) (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys)))) ad-return-value)
  call-interactively(org-ctrl-c-ctrl-c nil nil)

Org-mode version 8.2.3b (release_8.2.3b-200-gb6522a @ /Users/dk/.emacs.d/src/org-mode/lisp/)

All the best,
Tom

Eric Schulte <schulte.eric@gmail.com> writes:

> Hi Tom,
>
> Could you provide a minimal example?  I'm unable to debug from the stack
> trace alone.

-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Lisp code blocks fail
  2013-11-13 21:18   ` Thomas S. Dye
@ 2013-11-13 21:33     ` Eric Schulte
  2013-11-15 23:20       ` Thomas S. Dye
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Schulte @ 2013-11-13 21:33 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Org-mode

Hi Tom,

That example works for me.  Perhaps you could edebug (C-u C-M-x) the
`org-babel-execute:lisp' function and then run that code block again to
see at which statement the error is thrown.

I'm not sure what the problem could be.

Best,

tsd@tsdye.com (Thomas S. Dye) writes:

> Hi Eric,
>
> #+begin_src lisp
> (+ 1 1)
> #+end_src
>
> Debugger entered--Lisp error: (wrong-type-argument listp "2")
>   byte-code("\b\211A@)\207" [result x] 2)
>   org-babel-execute:lisp("(+ 1 1)" ((:comments . "") (:shebang . "")
> (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . "no")
> (:exports . "code") (:results . "replace") (:session . "none")
> (:hlines . "no") (:result-type . value) (:result-params "replace")
> (:rowname-names) (:colname-names)))
>   org-babel-execute-src-block(nil)
>   org-babel-execute-src-block-maybe()
>   org-babel-execute-maybe()
>   org-babel-execute-safely-maybe()
>   run-hook-with-args-until-success(org-babel-execute-safely-maybe)
>   org-ctrl-c-ctrl-c(nil)
>   ad-Orig-call-interactively(org-ctrl-c-ctrl-c nil nil)
>   (with-no-warnings (ad-Orig-call-interactively function record-flag keys))
>   (setq ad-return-value (with-no-warnings (ad-Orig-call-interactively function record-flag keys)))
>   (let ((ido-ubiquitous-next-override
> (ido-ubiquitous-get-command-override function))) (setq ad-return-value
> (with-no-warnings (ad-Orig-call-interactively function record-flag
> keys))))
>   (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override
> function) (setq ad-return-value (with-no-warnings
> (ad-Orig-call-interactively function record-flag keys))))
>   (let (ad-return-value) (ido-ubiquitous-with-override
> (ido-ubiquitous-get-command-override function) (setq ad-return-value
> (with-no-warnings (ad-Orig-call-interactively function record-flag
> keys)))) ad-return-value)
>   call-interactively(org-ctrl-c-ctrl-c nil nil)
>
> Org-mode version 8.2.3b (release_8.2.3b-200-gb6522a @ /Users/dk/.emacs.d/src/org-mode/lisp/)
>
> All the best,
> Tom
>
> Eric Schulte <schulte.eric@gmail.com> writes:
>
>> Hi Tom,
>>
>> Could you provide a minimal example?  I'm unable to debug from the stack
>> trace alone.

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Lisp code blocks fail
  2013-11-13 21:33     ` Eric Schulte
@ 2013-11-15 23:20       ` Thomas S. Dye
  2013-11-17 20:08         ` Thomas S. Dye
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas S. Dye @ 2013-11-15 23:20 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org-mode

Hi Eric,

An edebug adventure :)

AFAICT, the error is thrown by this call to a macro:
(org-babel-result-cond ("replace") (car result)), where result has been
set to "2" by the long (funcall) in (let).

Specifically, (org-babel-lisp-vector-to-list "2") appears to trigger the
(error)--at least that is the last code line edebug stops at before
getting to the (error) line. The modeline says Result: "2" just before
the error.

Does this help?

Tom

Eric Schulte <schulte.eric@gmail.com> writes:

> Hi Tom,
>
> That example works for me.  Perhaps you could edebug (C-u C-M-x) the
> `org-babel-execute:lisp' function and then run that code block again to
> see at which statement the error is thrown.
>
> I'm not sure what the problem could be.
>
> Best,
>
> tsd@tsdye.com (Thomas S. Dye) writes:
>
>> Hi Eric,
>>
>> #+begin_src lisp
>> (+ 1 1)
>> #+end_src
>>
>> Debugger entered--Lisp error: (wrong-type-argument listp "2")
>>   byte-code("\b\211A@)\207" [result x] 2)
>>   org-babel-execute:lisp("(+ 1 1)" ((:comments . "") (:shebang . "")
>> (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . "no")
>> (:exports . "code") (:results . "replace") (:session . "none")
>> (:hlines . "no") (:result-type . value) (:result-params "replace")
>> (:rowname-names) (:colname-names)))
>>   org-babel-execute-src-block(nil)
>>   org-babel-execute-src-block-maybe()
>>   org-babel-execute-maybe()
>>   org-babel-execute-safely-maybe()
>>   run-hook-with-args-until-success(org-babel-execute-safely-maybe)
>>   org-ctrl-c-ctrl-c(nil)
>>   ad-Orig-call-interactively(org-ctrl-c-ctrl-c nil nil)
>>   (with-no-warnings (ad-Orig-call-interactively function record-flag keys))
>>   (setq ad-return-value (with-no-warnings
>> (ad-Orig-call-interactively function record-flag keys)))
>>   (let ((ido-ubiquitous-next-override
>> (ido-ubiquitous-get-command-override function))) (setq ad-return-value
>> (with-no-warnings (ad-Orig-call-interactively function record-flag
>> keys))))
>>   (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override
>> function) (setq ad-return-value (with-no-warnings
>> (ad-Orig-call-interactively function record-flag keys))))
>>   (let (ad-return-value) (ido-ubiquitous-with-override
>> (ido-ubiquitous-get-command-override function) (setq ad-return-value
>> (with-no-warnings (ad-Orig-call-interactively function record-flag
>> keys)))) ad-return-value)
>>   call-interactively(org-ctrl-c-ctrl-c nil nil)
>>
>> Org-mode version 8.2.3b (release_8.2.3b-200-gb6522a @
>> /Users/dk/.emacs.d/src/org-mode/lisp/)
>>
>> All the best,
>> Tom
>>
>> Eric Schulte <schulte.eric@gmail.com> writes:
>>
>>> Hi Tom,
>>>
>>> Could you provide a minimal example?  I'm unable to debug from the stack
>>> trace alone.

-- 
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Lisp code blocks fail
  2013-11-15 23:20       ` Thomas S. Dye
@ 2013-11-17 20:08         ` Thomas S. Dye
  2013-11-19 16:09           ` Eric Schulte
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas S. Dye @ 2013-11-17 20:08 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org-mode

Hi Eric,

I understand this a bit better now.

In org-babel-execute:lisp, the local variable result is getting set to
("" "2").

With :results value, the call to read in org-babel-result-cond is being
passed "2" when it expects a list.  With :results output, it gets "",
which triggers the same error.

As I noted earlier, slime-eval executes the lisp code properly, but for
some reason it appears to be returning a string instead of a vector or a
list.

I'm not sure what I did to make this stop working.  It was fine
a week ago. I haven't changed slime in six months AFAIK.

Other babel languages work as usual. My problem appears to be confined
to lisp.

All the best,
Tom

tsd@tsdye.com (Thomas S. Dye) writes:

> Hi Eric,
>
> An edebug adventure :)
>
> AFAICT, the error is thrown by this call to a macro:
> (org-babel-result-cond ("replace") (car result)), where result has been
> set to "2" by the long (funcall) in (let).
>
> Specifically, (org-babel-lisp-vector-to-list "2") appears to trigger the
> (error)--at least that is the last code line edebug stops at before
> getting to the (error) line. The modeline says Result: "2" just before
> the error.
>
> Does this help?
>
> Tom
>
> Eric Schulte <schulte.eric@gmail.com> writes:
>
>> Hi Tom,
>>
>> That example works for me.  Perhaps you could edebug (C-u C-M-x) the
>> `org-babel-execute:lisp' function and then run that code block again to
>> see at which statement the error is thrown.
>>
>> I'm not sure what the problem could be.
>>
>> Best,
>>
>> tsd@tsdye.com (Thomas S. Dye) writes:
>>
>>> Hi Eric,
>>>
>>> #+begin_src lisp
>>> (+ 1 1)
>>> #+end_src
>>>
>>> Debugger entered--Lisp error: (wrong-type-argument listp "2")
>>>   byte-code("\b\211A@)\207" [result x] 2)
>>>   org-babel-execute:lisp("(+ 1 1)" ((:comments . "") (:shebang . "")
>>> (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . "no")
>>> (:exports . "code") (:results . "replace") (:session . "none")
>>> (:hlines . "no") (:result-type . value) (:result-params "replace")
>>> (:rowname-names) (:colname-names)))
>>>   org-babel-execute-src-block(nil)
>>>   org-babel-execute-src-block-maybe()
>>>   org-babel-execute-maybe()
>>>   org-babel-execute-safely-maybe()
>>>   run-hook-with-args-until-success(org-babel-execute-safely-maybe)
>>>   org-ctrl-c-ctrl-c(nil)
>>>   ad-Orig-call-interactively(org-ctrl-c-ctrl-c nil nil)
>>>   (with-no-warnings (ad-Orig-call-interactively function record-flag keys))
>>>   (setq ad-return-value (with-no-warnings
>>> (ad-Orig-call-interactively function record-flag keys)))
>>>   (let ((ido-ubiquitous-next-override
>>> (ido-ubiquitous-get-command-override function))) (setq ad-return-value
>>> (with-no-warnings (ad-Orig-call-interactively function record-flag
>>> keys))))
>>>   (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override
>>> function) (setq ad-return-value (with-no-warnings
>>> (ad-Orig-call-interactively function record-flag keys))))
>>>   (let (ad-return-value) (ido-ubiquitous-with-override
>>> (ido-ubiquitous-get-command-override function) (setq ad-return-value
>>> (with-no-warnings (ad-Orig-call-interactively function record-flag
>>> keys)))) ad-return-value)
>>>   call-interactively(org-ctrl-c-ctrl-c nil nil)
>>>
>>> Org-mode version 8.2.3b (release_8.2.3b-200-gb6522a @
>>> /Users/dk/.emacs.d/src/org-mode/lisp/)
>>>
>>> All the best,
>>> Tom
>>>
>>> Eric Schulte <schulte.eric@gmail.com> writes:
>>>
>>>> Hi Tom,
>>>>
>>>> Could you provide a minimal example?  I'm unable to debug from the stack
>>>> trace alone.

-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Lisp code blocks fail
  2013-11-17 20:08         ` Thomas S. Dye
@ 2013-11-19 16:09           ` Eric Schulte
  2013-11-19 18:50             ` Thomas S. Dye
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Schulte @ 2013-11-19 16:09 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Org-mode

Hi Tom,

Sorry about the slow reply, I've been busy as usual.

I just pushed up a fix for this problem.  As you've discovered, the
slime function returns a two-element list holding any strings written to
STDOUT, and the value of the evaluated code.  In two different places
org-babel-execute:lisp was trying to split this list into the separate
values however by the second time the list had been reduced to "2".

I've just pushed up a fix.

Best,

tsd@tsdye.com (Thomas S. Dye) writes:

> Hi Eric,
>
> I understand this a bit better now.
>
> In org-babel-execute:lisp, the local variable result is getting set to
> ("" "2").
>
> With :results value, the call to read in org-babel-result-cond is being
> passed "2" when it expects a list.  With :results output, it gets "",
> which triggers the same error.
>
> As I noted earlier, slime-eval executes the lisp code properly, but for
> some reason it appears to be returning a string instead of a vector or a
> list.
>
> I'm not sure what I did to make this stop working.  It was fine
> a week ago. I haven't changed slime in six months AFAIK.
>
> Other babel languages work as usual. My problem appears to be confined
> to lisp.
>
> All the best,
> Tom
>
> tsd@tsdye.com (Thomas S. Dye) writes:
>
>> Hi Eric,
>>
>> An edebug adventure :)
>>
>> AFAICT, the error is thrown by this call to a macro:
>> (org-babel-result-cond ("replace") (car result)), where result has been
>> set to "2" by the long (funcall) in (let).
>>
>> Specifically, (org-babel-lisp-vector-to-list "2") appears to trigger the
>> (error)--at least that is the last code line edebug stops at before
>> getting to the (error) line. The modeline says Result: "2" just before
>> the error.
>>
>> Does this help?
>>
>> Tom
>>
>> Eric Schulte <schulte.eric@gmail.com> writes:
>>
>>> Hi Tom,
>>>
>>> That example works for me.  Perhaps you could edebug (C-u C-M-x) the
>>> `org-babel-execute:lisp' function and then run that code block again to
>>> see at which statement the error is thrown.
>>>
>>> I'm not sure what the problem could be.
>>>
>>> Best,
>>>
>>> tsd@tsdye.com (Thomas S. Dye) writes:
>>>
>>>> Hi Eric,
>>>>
>>>> #+begin_src lisp
>>>> (+ 1 1)
>>>> #+end_src
>>>>
>>>> Debugger entered--Lisp error: (wrong-type-argument listp "2")
>>>>   byte-code("\b\211A@)\207" [result x] 2)
>>>>   org-babel-execute:lisp("(+ 1 1)" ((:comments . "") (:shebang . "")
>>>> (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . "no")
>>>> (:exports . "code") (:results . "replace") (:session . "none")
>>>> (:hlines . "no") (:result-type . value) (:result-params "replace")
>>>> (:rowname-names) (:colname-names)))
>>>>   org-babel-execute-src-block(nil)
>>>>   org-babel-execute-src-block-maybe()
>>>>   org-babel-execute-maybe()
>>>>   org-babel-execute-safely-maybe()
>>>>   run-hook-with-args-until-success(org-babel-execute-safely-maybe)
>>>>   org-ctrl-c-ctrl-c(nil)
>>>>   ad-Orig-call-interactively(org-ctrl-c-ctrl-c nil nil)
>>>>   (with-no-warnings (ad-Orig-call-interactively function record-flag keys))
>>>>   (setq ad-return-value (with-no-warnings
>>>> (ad-Orig-call-interactively function record-flag keys)))
>>>>   (let ((ido-ubiquitous-next-override
>>>> (ido-ubiquitous-get-command-override function))) (setq ad-return-value
>>>> (with-no-warnings (ad-Orig-call-interactively function record-flag
>>>> keys))))
>>>>   (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override
>>>> function) (setq ad-return-value (with-no-warnings
>>>> (ad-Orig-call-interactively function record-flag keys))))
>>>>   (let (ad-return-value) (ido-ubiquitous-with-override
>>>> (ido-ubiquitous-get-command-override function) (setq ad-return-value
>>>> (with-no-warnings (ad-Orig-call-interactively function record-flag
>>>> keys)))) ad-return-value)
>>>>   call-interactively(org-ctrl-c-ctrl-c nil nil)
>>>>
>>>> Org-mode version 8.2.3b (release_8.2.3b-200-gb6522a @
>>>> /Users/dk/.emacs.d/src/org-mode/lisp/)
>>>>
>>>> All the best,
>>>> Tom
>>>>
>>>> Eric Schulte <schulte.eric@gmail.com> writes:
>>>>
>>>>> Hi Tom,
>>>>>
>>>>> Could you provide a minimal example?  I'm unable to debug from the stack
>>>>> trace alone.

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Lisp code blocks fail
  2013-11-19 16:09           ` Eric Schulte
@ 2013-11-19 18:50             ` Thomas S. Dye
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas S. Dye @ 2013-11-19 18:50 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org-mode

Hi Eric,

No problem with the "slow" reply. Thanks for the fix, which gets me back
up and running.

All the best,
Tom

Eric Schulte <schulte.eric@gmail.com> writes:

> Hi Tom,
>
> Sorry about the slow reply, I've been busy as usual.
>
> I just pushed up a fix for this problem.  As you've discovered, the
> slime function returns a two-element list holding any strings written to
> STDOUT, and the value of the evaluated code.  In two different places
> org-babel-execute:lisp was trying to split this list into the separate
> values however by the second time the list had been reduced to "2".
>
> I've just pushed up a fix.
>
> Best,
>
> tsd@tsdye.com (Thomas S. Dye) writes:
>
>> Hi Eric,
>>
>> I understand this a bit better now.
>>
>> In org-babel-execute:lisp, the local variable result is getting set to
>> ("" "2").
>>
>> With :results value, the call to read in org-babel-result-cond is being
>> passed "2" when it expects a list.  With :results output, it gets "",
>> which triggers the same error.
>>
>> As I noted earlier, slime-eval executes the lisp code properly, but for
>> some reason it appears to be returning a string instead of a vector or a
>> list.
>>
>> I'm not sure what I did to make this stop working.  It was fine
>> a week ago. I haven't changed slime in six months AFAIK.
>>
>> Other babel languages work as usual. My problem appears to be confined
>> to lisp.
>>
>> All the best,
>> Tom
>>
>> tsd@tsdye.com (Thomas S. Dye) writes:
>>
>>> Hi Eric,
>>>
>>> An edebug adventure :)
>>>
>>> AFAICT, the error is thrown by this call to a macro:
>>> (org-babel-result-cond ("replace") (car result)), where result has been
>>> set to "2" by the long (funcall) in (let).
>>>
>>> Specifically, (org-babel-lisp-vector-to-list "2") appears to trigger the
>>> (error)--at least that is the last code line edebug stops at before
>>> getting to the (error) line. The modeline says Result: "2" just before
>>> the error.
>>>
>>> Does this help?
>>>
>>> Tom
>>>
>>> Eric Schulte <schulte.eric@gmail.com> writes:
>>>
>>>> Hi Tom,
>>>>
>>>> That example works for me.  Perhaps you could edebug (C-u C-M-x) the
>>>> `org-babel-execute:lisp' function and then run that code block again to
>>>> see at which statement the error is thrown.
>>>>
>>>> I'm not sure what the problem could be.
>>>>
>>>> Best,
>>>>
>>>> tsd@tsdye.com (Thomas S. Dye) writes:
>>>>
>>>>> Hi Eric,
>>>>>
>>>>> #+begin_src lisp
>>>>> (+ 1 1)
>>>>> #+end_src
>>>>>
>>>>> Debugger entered--Lisp error: (wrong-type-argument listp "2")
>>>>>   byte-code("\b\211A@)\207" [result x] 2)
>>>>>   org-babel-execute:lisp("(+ 1 1)" ((:comments . "") (:shebang . "")
>>>>> (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . "no")
>>>>> (:exports . "code") (:results . "replace") (:session . "none")
>>>>> (:hlines . "no") (:result-type . value) (:result-params "replace")
>>>>> (:rowname-names) (:colname-names)))
>>>>>   org-babel-execute-src-block(nil)
>>>>>   org-babel-execute-src-block-maybe()
>>>>>   org-babel-execute-maybe()
>>>>>   org-babel-execute-safely-maybe()
>>>>>   run-hook-with-args-until-success(org-babel-execute-safely-maybe)
>>>>>   org-ctrl-c-ctrl-c(nil)
>>>>>   ad-Orig-call-interactively(org-ctrl-c-ctrl-c nil nil)
>>>>>   (with-no-warnings (ad-Orig-call-interactively function record-flag keys))
>>>>>   (setq ad-return-value (with-no-warnings
>>>>> (ad-Orig-call-interactively function record-flag keys)))
>>>>>   (let ((ido-ubiquitous-next-override
>>>>> (ido-ubiquitous-get-command-override function))) (setq ad-return-value
>>>>> (with-no-warnings (ad-Orig-call-interactively function record-flag
>>>>> keys))))
>>>>>   (ido-ubiquitous-with-override (ido-ubiquitous-get-command-override
>>>>> function) (setq ad-return-value (with-no-warnings
>>>>> (ad-Orig-call-interactively function record-flag keys))))
>>>>>   (let (ad-return-value) (ido-ubiquitous-with-override
>>>>> (ido-ubiquitous-get-command-override function) (setq ad-return-value
>>>>> (with-no-warnings (ad-Orig-call-interactively function record-flag
>>>>> keys)))) ad-return-value)
>>>>>   call-interactively(org-ctrl-c-ctrl-c nil nil)
>>>>>
>>>>> Org-mode version 8.2.3b (release_8.2.3b-200-gb6522a @
>>>>> /Users/dk/.emacs.d/src/org-mode/lisp/)
>>>>>
>>>>> All the best,
>>>>> Tom
>>>>>
>>>>> Eric Schulte <schulte.eric@gmail.com> writes:
>>>>>
>>>>>> Hi Tom,
>>>>>>
>>>>>> Could you provide a minimal example?  I'm unable to debug from the stack
>>>>>> trace alone.

-- 
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-11-19 18:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-13  5:04 Lisp code blocks fail Thomas S. Dye
2013-11-13 14:18 ` Eric Schulte
2013-11-13 21:18   ` Thomas S. Dye
2013-11-13 21:33     ` Eric Schulte
2013-11-15 23:20       ` Thomas S. Dye
2013-11-17 20:08         ` Thomas S. Dye
2013-11-19 16:09           ` Eric Schulte
2013-11-19 18:50             ` Thomas S. Dye

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).