Hello slime hackers.
I'm having trouble with latest version of Slime -- I can't evaluate (as in C-M-x) or macroexpand (C-c C-m) forms. Emacs complains with message: 'Symbol's value as variable is void: package'. I've traced the problem to the function SLIME-EVAL-WITH-TRANSCRIPT. I debugged it with EDebug and here's what I found: when entering the function, arguments FORM, PACKAGE and FN have their intended values. I checked it with EDebug's eval facility. Then, after passing the SLIME-WITH-OUTPUT-END-MARK, I tried evaluating PACKAGE again, and it no longer had a value.
This might have something to do with the WITH-LEXICAL-BINDINGS macro, but I'm not any good at debugging emacs code. So now I stick without macroexpand and use C-c C-c (which works!) instead of C-M-x.
Any suggestions?
Janis Dzerins jdz@dir.lv writes:
This might have something to do with the WITH-LEXICAL-BINDINGS macro, but I'm not any good at debugging emacs code. So now I stick without macroexpand and use C-c C-c (which works!) instead of C-M-x.
This problem doesn't occur here. What Emacs version are you using? Could you send a backtrace? Set debug-on-error to t, expand a macro, and send the contents of the "*Backtrace*" buffer.
Helmut.
Helmut Eller wrote:
Janis Dzerins jdz@dir.lv writes:
This might have something to do with the WITH-LEXICAL-BINDINGS macro, but I'm not any good at debugging emacs code. So now I stick without macroexpand and use C-c C-c (which works!) instead of C-M-x.
This problem doesn't occur here. What Emacs version are you using? Could you send a backtrace? Set debug-on-error to t, expand a macro, and send the contents of the "*Backtrace*" buffer.
The funny thing is, as I found out yesterday, that macroexand and eval work for other projects. Thus I managed to find the cause for this problem: slime does not like the mode line at the top of the buffer.
It is easy to roproduce: - create a new lisp file with following contents:
---8<---cut-here---8<--- ;;; -*- mode: LISP; package: FOO -*-
(defpackage :foo (:use :common-lisp))
(in-package :foo)
(foo) ---8<---cut-here---8<---
Now, there's no problem to try and macroexand or evaluate anything in this buffer.
But then close the buffer and open the file again. Now nothing works any more. If the mode line is removed, and file is reopened, everything is back to normal again.
Janis Dzerins jdz@dir.lv writes:
---8<---cut-here---8<--- ;;; -*- mode: LISP; package: FOO -*-
I just fixed this interesting bug. The code in question looks like this:
(defun slime-eval-with-transcript (form package &optional fn) (with-current-buffer (slime-output-buffer) (slime-eval-async form package ...
PACKAGE is unbound inside the with-current-buffer form, because package is a buffer local variable and the local binding is not in effect in the other buffer. Isn't this funny? I wonder how many people write code like the above and what would happen with a file specification like:
;;; -*- mode: LISP; string: FOO; buffer: FOO; list FOO ....
Helmut.