I've been having trouble with Emacs + SLIME + Clojure. I've been using Bill Clementson's setup, and it was working when I fetched all the required projects via his clj-build script. However, when I fetched new versions using this script yesterday, Emacs gave me the following error when I ran "run-clojure":
error in process filter: Symbol's function definition is void: slime-redirect-inferior-output
I get an *inferior-lisp* buffer that works (is hooked to Clojure), and I can evaluate Clojure buffers, but I don't get a SLIME REPL buffer, nor does syntax highlighting work (I made sure that font-lock-mode is set). All of those things worked before. I'm attaching a file containing the relevant part of my .emacs file. The trouble seems to be near the end, where the hook after slime connects calls "slime-redirect-inferior-output". I can't find this function anywhere in SLIME or in clojure-swank. If I comment out this call, I get another error saying that
error in process filter: Symbol's value as variable is void: slime-repl-mode-map
and the troubles stay. Anybody know how I could work around the problem or even fix it altogether?
On Wed, Dec 31, 2008 at 4:44 PM, Mark Hoemmen <mark.hoem...@gmail.com> wrote: > I've been having trouble with Emacs + SLIME + Clojure. I've been > using Bill Clementson's setup, and it was working when I fetched all > the required projects via his clj-build script. However, when I > fetched new versions using this script yesterday, Emacs gave me the > following error when I ran "run-clojure":
> error in process filter: Symbol's function definition is void: > slime-redirect-inferior-output
> I get an *inferior-lisp* buffer that works (is hooked to Clojure), and > I can evaluate Clojure buffers, but I don't get a SLIME REPL buffer, > nor does syntax highlighting work (I made sure that font-lock-mode is > set). All of those things worked before. I'm attaching a file > containing the relevant part of my .emacs file. The trouble seems to > be near the end, where the hook after slime connects calls > "slime-redirect-inferior-output". I can't find this function anywhere > in SLIME or in clojure-swank. If I comment out this call, I get > another error saying that
> error in process filter: Symbol's value as variable is void: slime-repl-mode-map
> and the troubles stay. Anybody know how I could work around the > problem or even fix it altogether?
There are currently some "breaking" refactorings that are being done to slime. The slime repl has been moved out to the contribs directory and has to now be explicitly specified when you startup slime. However, the necessary changes to swank-clojure haven't been made yet. Therefore, you can do one of a number of things:
1. Don't upgrade to any slime later than December 22. This is your easiest option at the moment. Jeffrey Chou usually updates swank-clojure pretty quickly when there are bugs or slime changes, so it shouldn't be too long before you can start using the latest cvs slime once again. 2. Use an alternative repl with slime. There are actually 3 different repl's that you can potentially use with slime: a. The inferior-lisp repl that starts up when you launch slime (before Dec 23, it would launch the slime-repl automatically after establishing communications with the underlying Lisp implementation (Clojure in your case). However, post-Dec 23, it will only optionally launch the slime-repl). b. An enhanced inferior-lisp repl that has most of the key bindings that are available in the "normal" slime repl. To enable this, modify your startup to use this line: (slime-setup '(inferior-slime)) instead of the: (slime-setup) line that was in my setup instructions. c. The "normal" slime-repl that has all the bells & whistles (you can't use this one at the moment with the latest slime cvs code) 3. Use an alternative to slime for the time being. I suggested one emacs alternative in a weblog post: http://bc.tech.coop/blog/081118.html
If you go with #1, then you don't have to change your setup. If you go with #3, then you lose much of the functionality which you may have grown accustomed to having with slime. If you go with #2a or #2b, you will have to comment out (or remove) any mods that directly reference the slime-repl mode (which is created when 2.c is started up and which is the one that is started automatically by pre-Dec23 versions of slime). In your specific case, you will have to comment out lines in your setup as follows: (add-hook 'slime-connected-hook (lambda () ;(slime-redirect-inferior-output) (define-key slime-mode-map (kbd "<return>") 'newline-and-indent) (define-key slime-mode-map (kbd "C-j") 'newline) (define-key slime-mode-map (kbd "C-c b") 'slime-browse-local-javadoc) ;(define-key slime-repl-mode-map (kbd "C-c b") 'slime-browse-local-javadoc) (define-key slime-mode-map (kbd "C-c d") 'slime-java-describe) ;(define-key slime-repl-mode-map (kbd "C-c d") 'slime-java-describe) (define-key slime-mode-map (kbd "C-c D") 'slime-javadoc) ;(define-key slime-repl-mode-map (kbd "C-c D") 'slime-javadoc) ))
You could change the slime-repl-mode-map entries to instead refer to the equivalent inferior-lisp repl mode map; however, you'll just have to change them back again when slime-repl becomes available again.
So, I recommend you stick with #1 until swank-clojure is updated as necessary. The slime-repl has more features/functionality than the inferior-lisp repl alternatives.
Hope that helps and that my explanation wasn't more information than you really wanted. ;-)
On Thu, Jan 1, 2009 at 1:44 AM, Mark Hoemmen <mark.hoem...@gmail.com> wrote:
> I've been having trouble with Emacs + SLIME + Clojure. I've been
> using Bill Clementson's setup, and it was working when I fetched all
> the required projects via his clj-build script. However, when I
> fetched new versions using this script yesterday, Emacs gave me the
> following error when I ran "run-clojure":
> error in process filter: Symbol's function definition is void:
> slime-redirect-inferior-output
> I get an *inferior-lisp* buffer that works (is hooked to Clojure), and
> I can evaluate Clojure buffers, but I don't get a SLIME REPL buffer,
> nor does syntax highlighting work (I made sure that font-lock-mode is
> set). All of those things worked before. I'm attaching a file
> containing the relevant part of my .emacs file. The trouble seems to
> be near the end, where the hook after slime connects calls
> "slime-redirect-inferior-output". I can't find this function anywhere
> in SLIME or in clojure-swank. If I comment out this call, I get
> another error saying that
> error in process filter: Symbol's value as variable is void: slime-repl-mode-map
> and the troubles stay. Anybody know how I could work around the
> problem or even fix it altogether?
> On Thu, Jan 1, 2009 at 1:44 AM, Mark Hoemmen <mark.hoem...@gmail.com> wrote:
>> I've been having trouble with Emacs + SLIME + Clojure. I've been
>> using Bill Clementson's setup, and it was working when I fetched all
>> the required projects via his clj-build script. However, when I
>> fetched new versions using this script yesterday, Emacs gave me the
>> following error when I ran "run-clojure":
>> error in process filter: Symbol's function definition is void:
>> slime-redirect-inferior-output
>> I get an *inferior-lisp* buffer that works (is hooked to Clojure), and
>> I can evaluate Clojure buffers, but I don't get a SLIME REPL buffer,
>> nor does syntax highlighting work (I made sure that font-lock-mode is
>> set). All of those things worked before. I'm attaching a file
>> containing the relevant part of my .emacs file. The trouble seems to
>> be near the end, where the hook after slime connects calls
>> "slime-redirect-inferior-output". I can't find this function anywhere
>> in SLIME or in clojure-swank. If I comment out this call, I get
>> another error saying that
>> error in process filter: Symbol's value as variable is void: slime-repl-mode-map
>> and the troubles stay. Anybody know how I could work around the
>> problem or even fix it altogether?
It should be noted that (in order to use the new slime-repl mods (if
you download the latest slime and apply Remco's patch), you will have
to modify your .emacs startup to include the following:
(slime-setup '(slime-repl))
>> On Thu, Jan 1, 2009 at 1:44 AM, Mark Hoemmen <mark.hoem...@gmail.com> wrote:
>>> I've been having trouble with Emacs + SLIME + Clojure. I've been
>>> using Bill Clementson's setup, and it was working when I fetched all
>>> the required projects via his clj-build script. However, when I
>>> fetched new versions using this script yesterday, Emacs gave me the
>>> following error when I ran "run-clojure":
>>> error in process filter: Symbol's function definition is void:
>>> slime-redirect-inferior-output
>>> I get an *inferior-lisp* buffer that works (is hooked to Clojure), and
>>> I can evaluate Clojure buffers, but I don't get a SLIME REPL buffer,
>>> nor does syntax highlighting work (I made sure that font-lock-mode is
>>> set). All of those things worked before. I'm attaching a file
>>> containing the relevant part of my .emacs file. The trouble seems to
>>> be near the end, where the hook after slime connects calls
>>> "slime-redirect-inferior-output". I can't find this function anywhere
>>> in SLIME or in clojure-swank. If I comment out this call, I get
>>> another error saying that
>>> error in process filter: Symbol's value as variable is void: slime-repl-mode-map
>>> and the troubles stay. Anybody know how I could work around the
>>> problem or even fix it altogether?
> Once I dismiss the exception, the repl itself works fine.
> Thanks y'all!
I don't know how to fix it, but it appears to be related to the synchronization of the notion of the current namespace between swank and slime. This incantation works around it:
> and the SLIME repl works, but the following exception is thrown > whenever the dynamic documentation for a function would be displayed:
> java.lang.Exception: Unable to resolve symbol: user in this context > (NO_SOURCE_FILE: > 0) > [Thrown class clojure.lang.Compiler$CompilerException]
> Once I dismiss the exception, the repl itself works fine.
After downloading the latest slime and applying Remco's patch and modifying my .emacs file, I haven't been able to replicate this particular error. When you say that the "exception is thrown whenever the dynamic documentation for a function would be displayed", are you saying that the exception is occurring when you press "C-c C-d C-d" on a function name? It works fine for me. Or is there some other "dynamic documentation for a function" that you're referring to?
On Jan 1, 2009, at 7:57 PM, Bill Clementson wrote:
> Or is there some other "dynamic > documentation for a function" that you're referring to?
For me, it throws the exception when I type a space and SLIME tries to look up the arguments for the current function. For example, in a fresh SLIME repl:
user> (a
On typing a space after the "(a", the exception is thrown:
java.lang.Exception: Unable to resolve symbol: user in this context (NO_SOURCE_FILE:0) [Thrown class clojure.lang.Compiler$CompilerException]
On Jan 1, 5:44 pm, "Stephen C. Gilardi" <squee...@mac.com> wrote:
> On Jan 1, 2009, at 7:57 PM, Bill Clementson wrote:
> > Or is there some other "dynamic
> > documentation for a function" that you're referring to?
> For me, it throws the exception when I type a space and SLIME tries to
> look up the arguments for the current function.
That's what I mean -- I should have been more specific. Oddly enough,
the online documentation works fine when I'm coding in a non-REPL
buffer (it doesn't throw an exception then), nor do I get an exception
when I use C-c C-e to evaluate a one-line Clojure expression.
I'll refetch everything, apply the Swank patch and try again --
On Thu, Jan 1, 2009 at 6:02 PM, Mark H. <mark.hoem...@gmail.com> wrote:
> On Jan 1, 5:44 pm, "Stephen C. Gilardi" <squee...@mac.com> wrote: >> On Jan 1, 2009, at 7:57 PM, Bill Clementson wrote:
>> > Or is there some other "dynamic >> > documentation for a function" that you're referring to?
>> For me, it throws the exception when I type a space and SLIME tries to >> look up the arguments for the current function.
> That's what I mean -- I should have been more specific. Oddly enough, > the online documentation works fine when I'm coding in a non-REPL > buffer (it doesn't throw an exception then), nor do I get an exception > when I use C-c C-e to evaluate a one-line Clojure expression.
> I'll refetch everything, apply the Swank patch and try again --
Looks like the correct patch to basic.clj should be: (defslimefn create-repl [target] '("user" user))