[slime-devel] abcl problems

Andras Simon andras at renyi.hu
Thu Jun 29 20:41:08 UTC 2006


[I'm resending this because it bounced on Tuesday, due to the recent c-l.net
troubles. Apologies if you get it twice. In the meantime I committed
Helmut's patch to abcl.]


On Tue, 27 Jun 2006, Helmut Eller wrote:

> * Andras Simon [2006-06-27 12:03+0200] writes:
>
> > Anyway, I'd be grateful for any hints on how to start debugging this.
>
> At the lisp side we create a thread which periodically flushes some
> output streams.  We do this so that any buffered output shows up on
> the Emacs side only after a short delay.
>
> We could work around the problem with (:write-string "") in our code,
> if we test for empty strings.  But the real problem seems to be that
> ABCL's SlimeOutputStream writes the buffered text, but doesn't clear
> the buffer afterwards.  The following patch might be more appropriate:
>
> --- SlimeOutputStream.java.orig	2006-06-27 18:47:43.000000000 +0200
> +++ SlimeOutputStream.java	2006-06-27 19:48:44.000000000 +0200
> @@ -105,11 +105,12 @@
>
>      public void _finishOutput() throws ConditionThrowable
>      {
> -        try {
> -            LispThread.currentThread().execute(f, new SimpleString(stringWriter.toString()));
> +	super._finishOutput ();
> +	if (stringWriter.getBuffer().length() > 0) {
> +	    String s = stringWriter.toString();
> +	    stringWriter.getBuffer().setLength(0);
> +	    LispThread.currentThread().execute(f, new SimpleString(s));
>          }
> -        catch (Throwable t) {}
> -        super._finishOutput();
>      }
>
>      public String toString()
>

This does the trick! Thanks, Helmut!

Andras






More information about the slime-devel mailing list