geiser-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Geiser-users] Graceful handling of long lines in the REPL


From: Jose A. Ortega Ruiz
Subject: Re: [Geiser-users] Graceful handling of long lines in the REPL
Date: Wed, 11 Jan 2012 19:26:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Heya Ludovic,

On Wed, Jan 11 2012, Ludovic Courtès wrote:

> Hello Geiserati!
>
> One problem I regularly stumble upon is that if you inadvertently write
> a large data structure in the REPL (say, (iota 10000000)), Emacs has a
> hard time displaying it and gets slower and slower, to the point where
> hitting C-c C-c in the REPL buffer has no effect other than displaying
> “C-c” after some delay.
>
> The workaround is to kill the REPL buffer (and associated process)
> before Emacs becomes completely unusable–which is inconvenient.
>
> Any ideas how to fix that?

There's a hook called by comint-mode before displaying its output,
comint-preoutput-filter-functions.  Functions registered there receive
the text to be output and must return a replacement for it.  The text
includes the prompt and comint and geiser use its form for various ends
(e.g., for detecting when the debugged is entered/exited), so you should
make sure that you don't modify that in the returned string.

Unfortunately, geiser does not provide an elisp sexp shortener (it uses
the scheme services for the shortened value that you see in the echo
area after evaluation, and does not interfere with evaluations performed
at the REPL), so you'd need to hack you own.

That could help if the slownes is due to displaying the value (as
opposed to transmitting it), but that sounds plausible.

HTH,
jao
-- 
Only those things are beautiful which are inspired by madness and
written by reason. -Andre Gide (1869-1951)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]