views:

168

answers:

3

This is a very simple question. I have installed Emacs 22.2.1 (from the Ubuntu (9.04) repo and I downloaded Slime-current from the repo on their homepage.

I followed the instructions provided with slime and it works. I can start slime and use it as expected.

However, when I enter lisp-mode (M-x lisp-mode) I can no longer interact with the REPL. Nothing I type works, the cursor just moves to the next line when I press enter.

Does anyone have a fix for this?

Edit:

Regarding the question of how I'm using Emacs. Yes, I start Emacs, then enter slime with M-x slime. I read that I could get proper syntax highlighting by next entering lisp mode with M-x lisp-mode.

It did provide syntax highlighting, but as pointed out below, it's meant for editing text files, not interacting with the REPL.

I also recently read that placing the following in my .emacs file will enable syntax highlighting (it did not work).

; Syntax Highlighting
(global-font-lock-mode 1)

; Enable slime
(add-to-list 'load-path "/home/doug/Software/slime/")  ; your SLIME directory
(setq inferior-lisp-program "/home/doug/Software/ccl/ccl") ; your Lisp system
(require 'slime)
(slime-setup)

; Enable psvn
(require 'psvn)

So I guess my question needs revising. Since lisp-mode isn't meant to simply enable lisp features for slime, then how I enable syntax highlighting in slime?

Edit 2:

The answer was provided in a comment.

Start slime then open/create a new file to work with. This is the buffer where lisp-mode is intended to be used.

The function is written, highlighted, and sent to the REPL. The output appears at the bottom.

The two are supposed to cooperate, not integrate.

+2  A: 

It sounds like you're entering lisp-mode in the buffer that has the REPL, yes? If that's the case, that's probably what you're doing wrong. The REPL buffer probably has its own mode.

Looking at the documentation, the way to interact with Slime (as with most Emacs' inferior processes) is to use bindings that evaluate the current sexp or region or buffer. See this page of the documentation. None of the bindings in that link are the simple RET key - which is leads me to believe you changed the mode of the REPL buffer.

More information would help of course.

Trey Jackson
+1  A: 

When you do M-x slime, Slime starts and shows the REPL (the buffer with the REPL will be in the slime-repl-mode major mode. This slime-repl-mode drives the REPL.

lisp-mode, according to its description, is a "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp". Lisp-mode is for editing files, not for REPL. This is intended behaviour.

Rather, why do you want to switch the REPL to lisp-mode?

dmitry_vk
+2  A: 

Moved out of comments: usually, you would not write big functions directly in the REPL buffer, but write them in another buffer and send them to the REPL via C-c C-c. The slime-repl-mode has its own highlighting, but with a different purpose: it shows input, output, and system messages in different colours (in my green-on-black setup, it shows input in green, system messages in red, and output in light blue).

Svante