Frage

When I accidentally make an infinite loop by evaluating a form in emacs with geiser + racket, after a minute or so of waiting, eventually emacs will start to respond again. Unfortunately, every eval after that takes at least a minute. Usually, after the second or third eval, emacs will stop responding at all, and the fastest thing to do at that point it to restart the Ubuntu machine.

Is there some setting to prevent this in geiser, or a way to tell emacs to kill geiser?

War es hilfreich?

Lösung

Here's what I do when something hangs up. Over the years, I don't recall Emacs being stuck in an unrecoverable state.

Use C-g. Repeatedly if needed. It calls keyboard-quit. This should break any stuck loop and give you the ability to enter commands.

Now if geiser or any other process is misbehaving, just kill the buffers that correspond to this process. C-x C-b will give you the list of all buffers. If you don't recognize the one that belongs to geiser, just restart Emacs and open only geiser and see the buffer list again.

Now mark the misbehaving buffers with d. Execute the deletion with x. That's it. You can now restart geiser or whatever else. This approach is completely generic.

By the way, restarting the Ubuntu machine is too drastic. When nothing works to stop the application with a window, but X still works, use xkill utility. I've bound it to Ctrl-Alt-F12 for instance. Then you just click on a window you don't like and it's gone.

If xkill doesn't work, switch to a virtual terminal with Ctrl-Alt-F1 and use htop to kill the application.

Andere Tipps

According to the REPL documentation, you should be able to use C-c C-q to kill the REPL. From the link to the REPL documentation, go to the First Aids section; it's near the bottom of it.

Geiser hangs on loops here also. In emacs 24.3.1 running on Debian 7 updated two days ago; M-x run-geiser; Then one gets a window with a REPL prompt. All is good, but then say > (define f (* f (- n 1))), then > (f 3) and the process in the buffer is locked up. C-c C-c and C-c C-q do nothing. Killing the buffer, answering yes to the query of killing subprocesses, and then restarting does get one to a REPL prompt with all definitions gone.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top