Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

running scheme from emacs

Tags:

emacs

lisp

scheme

I'm a newbie to LISP.

I am attempting to invoke the scheme interpreter from within emacs (version 23 running on windows). I loaded the xscheme library by telling emacs to M-x load-library and then entering xscheme at the prompt in the minibuffer. The library loaded, and then I issued the M-x run-scheme command. (I realize that all this loading can be done from .emacs at startup, but I am not concerned with that at the moment.)

So far so good - the *scheme* buffer has been created, and now I'm hoping that I'm able to talk to the scheme interpreter.

However, when I try to evaluate something in that *scheme*buffer (e.g. (define shoe-size 14)), I get this Output file descriptor of scheme is closed message in the minibuffer.

Does anybody know how to fix this in emacs?

(Also, how does one set the major-mode as REPL in the *scheme* buffer?)

Thank you.

like image 734
dave Avatar asked Mar 07 '12 14:03

dave


People also ask

How do I run a Scheme program?

To run Scheme from within Emacs, start emacs, and then use the command M-x run-scheme. (That is, press the ESC key, then x then at the prompt run-scheme ). This will create a buffer called *scheme*, which will be in "inferior scheme mode".

How do I load a Scheme file?

To load your file of Scheme definitions into the interpreter, type control-c control-l in either buffer. (The Scheme command (load "file. scm") at the Scheme prompt still works as well.) If you modify and save your Scheme source file, you should reload it by using the load command again.


2 Answers

Try setting the scheme-program-name variable to the path to your Scheme interpreter. The major-mode of the scheme buffer is probably just comint and you cannot do much about it unless you switch to something more capable like Geiser - something that I'd recommend you do.

like image 85
Bozhidar Batsov Avatar answered Oct 20 '22 09:10

Bozhidar Batsov


Add this line to your .emacs file:

(setq scheme-program-name "gsi")

(Replace "gsi" with the name of your Scheme interpreter.)

You can then start the interpreter with M-x run-scheme. You can evaluate pieces of code by using C-x C-e (to evaluate the sexp before the point) or with C-M-x to evaluate the sexp you're in right now. You can also load a file with C-c C-l.

like image 36
gnuvince Avatar answered Oct 20 '22 07:10

gnuvince