[slime-devel] 'q' in temporary buffer closes the window rather than returning to REPL

Helmut Eller heller at common-lisp.net
Sat Nov 22 11:41:20 UTC 2008


* Brett Hoerner [2008-11-21 01:02+0100] writes:

> The documentation says,
>
> "Temporary buffers can be dismissed by pressing q. This kills the
> buffer and restores the window configuration as it was before the
> buffer was displayed."
>
> Using emacs 22.3.1 (or the latest Aquamacs or CarbonEmacs) and a CVS
> checkout of SLIME (current) when I (for example) open documentation
> with C-c C-d C-d and press 'q', it closes the whole window.  I expect
> (based on the documentation above) that it should actually kill that
> buffer, show the REPL again, and put my cursor/focus back in my main
> window where I started, correct?

Yes.  The problem is that it's pretty hard to decide what should be
restored on pressing q.

Restoring the window config is easy to implement, but some people said
that unconditionally restoring the window config is to much.  E.g. if the
user opens a new window after C-c C-d C-d but before pressing q, that
new window would also disappear.

For some time we tried to detect that situation. We only restored the
window config if it was unchanged (modulo cursor positions).  If the
window config was changed we only buried the buffer [with bury-buffer,
which acts strangely incompatible in XEmacs.]

But that's also not exactly what I want.  I want that q deletes the
window if it was created for the temporary buffer.  Restoring the window
config also kills the temp window, but bury-buffer doesn't.  This scheme
also doesn't work well if, e.g. C-c C-d C-d is used (recursively) in the
doc buffer.

[Things get even more complicated if the temp buffer is displayed in a
new frame.  Presumably, new frames should only be created rarely and
stay there for a long time, i.e. 'q' shouldn't close them.]

Currently, q just kills windows displaying the buffer. Occasionally,
that kills a window that wasn't created specifically for a temp buffer.
I can live with that, because I don't use more than 2 windows anyway.
Not sure what other people need.

> Is there anything I could have set wrong, or somewhere I should look
> to debug this, if so?  It would save me so much time if I didn't have
> to kill buffer and change windows after each little lookup, etc.

Useful would be a description of the behavior that you want.  Even more
useful would be a test.

The current implementation kills the window (and buries the buffer) so
you don't have to do that manually.  If you are in a lisp buffer, press
C-c C-d C-d and press q quickly afterwards, you will end up in the
original buffer, right?  So maybe you need to say a bit more what you
need.

Helmut.





More information about the slime-devel mailing list