Emacs racket auto-reboot file

I am new to the circuit, but I was able to run it in emacs. I like it when a file is opened in one buffer in emacs, and the presence of the racket interpreter is opened in another so that I can test when I write, etc. The problem is that every time I want to check something, I need to save the file (not a big deal), and then reload it in the interpreter using (enter! "Program name").

Is there anyway an automatic reboot every time a file is saved? It is very difficult for me to reload the file manually every time I change something, especially because I am still involved in the scheme, so I need to go back and forth to make changes to the LOT. Any help is much appreciated, thanks!

+4
source share
2 answers

Geiser and / or Quack are very nice modes for Emacs. Using DrRacket is also a great option.

But for a more-literal answer to your question:

You can add the following to your .emacs and bind it to the F5 key to roughly approximate the DrRacket Run command:

 (defun run-roughly-like-dr-racket () (interactive) (let ((w (selected-window))) (set-buffer-modified-p t) ;force save buffer so that enter! ... (save-buffer) ;...will re-evaluate (other-window -1) (run-scheme) (select-window w) (comint-send-string (get-buffer-process "*scheme*") (format "(enter! \"%s\")\n" (buffer-file-name))) (pop-to-buffer (get-buffer-process "*scheme*") t) (select-window w))) 
+3
source

The most useful option is probably Geiser .

It allows you, among other great things, to compile the current file with a keystroke or evaluate only the definition at a point. It is well documented and closest to SLIME for the schema you can get, I think.

If you can live without Emacs, DrRacket is also a great environment to work with.

+3
source

All Articles