Index: slime/ChangeLog diff -u slime/ChangeLog:1.1449 slime/ChangeLog:1.1453 --- slime/ChangeLog:1.1449 Tue Aug 12 13:54:43 2008 +++ slime/ChangeLog Thu Aug 14 11:32:40 2008 @@ -1,3 +1,47 @@ +2008-08-14 Tobias C. Rittweiler tcr@freebits.de + + If another frame is already displaying a REPL, `C-c C-z' will now + select this window instead of splitting the current frame, and + displaying the REPL in the newly created window. + + * slime.el (slime-switch-to-output-buffer-search-all-frames): New + variable to customize this behaviour, as it may not be optimal for + people using multiple screens at once. + (slime-switch-to-output-buffer): Adapted accordingly. + +2008-08-14 Tobias C. Rittweiler tcr@freebits.de + + Xref buffers: `M-,' in an Xref buffer will now revert to an Emacs + state as of before the Xref command. + + * slime.el (slime-xref-mode-map): Add `slime-xref-retract' as `M-,' + (slime-xref-retract): New. Restores the emacs snapshot unconditionally. + (slime-xref-quit): Use it. + +2008-08-14 Tobias C. Rittweiler tcr@freebits.de + + Xref buffers: `q', and `SPC' will push onto the find-definition + stack such that M-, will work afterwards. + + * slime.el (defstruct slime-emacs-snapshot): Also save the point + explicitly. It is implicitly stored already in the + window-configuration, but inaccessible therein. + (slime-current-emacs-snapshot, slime-set-emacs-snapshot): Adapted. + (slime-push-definition-stack-from-snapshot): New. Reason for above + changes. + + (slime-with-popup-buffer): Make sure that the current + emacs-snapshot is taken, not only when the :emacs-snapshot + argument is NIL at expansion time, but also on runtime. + + (slime-with-xref-buffer): The name of the Xref buffer was created + at expansion time, but must be computed at runtime. Fix that. + (slime-xref-quit): Use `slime-push-definition-stack-from-snapshot' + (sime-xref-goto): Adapted to also push onto the stack. + + * slime.el (slime-compute-modeline-package): Cleaned up. + (slime-update-modeline-string): Ditto. + 2008-08-12 Helmut Eller heller@common-lisp.net
Add a dump-image function to the loader.
On Aug 15, 2008, at 06:35 , Marco Baringer wrote:
+2008-08-14 Tobias C. Rittweiler tcr@freebits.de
- If another frame is already displaying a REPL, `C-c C-z' will now
- select this window instead of splitting the current frame, and
- displaying the REPL in the newly created window.
I am using the described behavior already for some time (GNU Emacs, REPL in a dedicated frame, C-c C-z activating the frame). I did this by customizing special-display-regexps, and perhaps a couple more variables; there are several (special-display-function, special-window- regexps, ...).
Cheers, Michael
Michael Weber michaelw+slime@foldr.org writes:
On Aug 15, 2008, at 06:35 , Marco Baringer wrote:
+2008-08-14 Tobias C. Rittweiler tcr@freebits.de
- If another frame is already displaying a REPL, `C-c C-z' will now
- select this window instead of splitting the current frame, and
- displaying the REPL in the newly created window.
I am using the described behavior already for some time (GNU Emacs, REPL in a dedicated frame, C-c C-z activating the frame). I did this by customizing special-display-regexps, and perhaps a couple more variables; there are several (special-display-function, special-window- regexps, ...).
The difference is that C-c C-z will pop up a new REPL window if no REPL is being displayed. So this is orthogonal to a dedicated REPL frame.
-T.
On Aug 15, 2008, at 10:21 , Tobias C. Rittweiler wrote:
The difference is that C-c C-z will pop up a new REPL window if no REPL is being displayed. So this is orthogonal to a dedicated REPL frame.
Same thing here. If the REPL buffer is not visible, a new frame pops up. Otherwise it's activated.
I have special-display-function set to special-display-popup-frame, FWIW.
M.
* Michael Weber [2008-08-15 10:37+0200] writes:
On Aug 15, 2008, at 10:21 , Tobias C. Rittweiler wrote:
The difference is that C-c C-z will pop up a new REPL window if no REPL is being displayed. So this is orthogonal to a dedicated REPL frame.
Same thing here. If the REPL buffer is not visible, a new frame pops up. Otherwise it's activated.
I have special-display-function set to special-display-popup-frame, FWIW.
Do you mean that we should simply use pop-to-buffer?
Despite the variables you mention, Emacs has already a variable display-buffer-reuse-frames which probably does what slime-switch-to-output-buffer-search-all-frames was supposed to do.
Helmut.
On Aug 17, 2008, at 13:10 , Helmut Eller wrote:
Do you mean that we should simply use pop-to-buffer?
I have no fully-formed opinion yet, but at the moment it seems to me that this gives the most consistent and customizable behaviour with the least amount of code. FWIW, attached is a patch which I have been using for quite a while. I found the resulting slime-selector behavior much nicer, YMMV of course.
Despite the variables you mention, Emacs has already a variable display-buffer-reuse-frames which probably does what slime-switch-to-output-buffer-search-all-frames was supposed to do.
Yes, there are several variables and mechanisms which customize buffer/ window/frame behaviour and they also interact. It requires a bit of fiddling to get the desired outcome.
M/
Michael Weber michaelw+slime@foldr.org writes:
On Aug 17, 2008, at 13:10 , Helmut Eller wrote:
Despite the variables you mention, Emacs has already a variable display-buffer-reuse-frames which probably does what slime-switch-to-output-buffer-search-all-frames was supposed to do.
Yes, there are several variables and mechanisms which customize buffer/ window/frame behaviour and they also interact. It requires a bit of fiddling to get the desired outcome.
I have no luck at customizing this through the variables described in `(elisp)Choosing Window'. And I begin to doubt that these variables are even meant to let you customize it. They're to customize the way buffers are _displayed_, but what slime-switch-to-output-buffer does it more, it's also about setting the input focus, and selecting the window if appropriate.
If you currently operate within one frame only, and that frame is split vertically, left displaying the REPL, right your .lisp buffer, and within your .lisp buffer you press C-c C-z, the left window is selected.
What I did a few days ago was to make this behaviour also happen when having two frames side-by-side, some window in the left frame displaying the REPL, the right frame displaying .lisp buffers. So I regarded my work as improving consistency.
What I want is the following behaviour:
(let ((repl-window (get-buffer-window repl-buffer t))) (if repl-window (progn (select-frame-set-input-focus (window-frame repl-window)) (select-window repl-window)) (pop-to-buffer repl-buffer t)))
Setting display-buffer-reuse-frames to t results in C-c C-z being a NOP because the REPL window is already displayed in a frame, but the window within that frame isn't selected and input focus isn't updated accordingly.
I also tried to adapt special-display-regexps, but the function I specified to be used for displaying REPL buffer doesn't seem to be invoked by the pop-to-buffers in the current implementation of C-c C-z.
Help greatly appreciated,
-T.
* Tobias C. Rittweiler [2008-08-19 11:10+0200] writes:
I have no luck at customizing this through the variables described in `(elisp)Choosing Window'.
Hmm, I had the same problem. First I implemented focus switching manually; upgraded Emacs from CVS; dropped the focus switching code and everything seemed to work. But now it doesn't.
And I begin to doubt that these variables are even meant to let you customize it. They're to customize the way buffers are _displayed_, but what slime-switch-to-output-buffer does it more, it's also about setting the input focus, and selecting the window if appropriate.
Well, the docstring of pop-to-buffer says explicitly that it uses display-buffer. So every variable that is meant for display-buffer is also usable for pop-to-buffer.
pop-to-buffer is just (select-window (display-buffer ...)). The question is why select-window doesn't switch the input focus.
Obviously (form the source), select-window calls select-frame. But select-frame doesn't seem to switch the focus. It looks kinda strange, or at least unusual to select a frame without switching focus. Maybe it's intended for things like read-from-minibuffer.
What I did a few days ago was to make this behaviour also happen when having two frames side-by-side, some window in the left frame displaying the REPL, the right frame displaying .lisp buffers. So I regarded my work as improving consistency.
But we shouldn't ignore or reinvent standard customization variables.
What I want is the following behaviour:
(let ((repl-window (get-buffer-window repl-buffer t))) (if repl-window (progn (select-frame-set-input-focus (window-frame repl-window)) (select-window repl-window)) (pop-to-buffer repl-buffer t)))
If pop-to-buffer can't be used directly, I rather want:
(let ((window (display-buffer repl-buffer))) (select-window window) (select-frame-set-input-focus (window-frame window)))
In fact, I think pop-to-buffer should do that.
Setting display-buffer-reuse-frames to t results in C-c C-z being a NOP because the REPL window is already displayed in a frame, but the window within that frame isn't selected and input focus isn't updated accordingly.
It's not quite a NOP for me: if I hide one frame behind the other, C-c C-z brings the hidden frame in front. It still isn't selected, though.
Help greatly appreciated,
Maybe we just should ask the Emacs maintainers why pop-to-buffer doesn't what we expect.
Helmut.
* Helmut Eller [2008-08-19 23:20+0200] writes:
Maybe we just should ask the Emacs maintainers why pop-to-buffer doesn't what we expect.
I filed a bug report here:
http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=745
But later I discovered this one:
http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=30
So, there is little hope that they will fix the issue.
Helmut.
On Aug 19, 2008, at 11:10 , Tobias C. Rittweiler wrote:
Setting display-buffer-reuse-frames to t results in C-c C-z being a NOP because the REPL window is already displayed in a frame, but the window within that frame isn't selected and input focus isn't updated accordingly.
Ho-hum, look what I found stashed away in a config file:
(defadvice slime-switch-to-output-buffer (after mwe-slime-switch-to-output-buffer activate) (select-frame-set-input-focus (selected-frame)))
This gives focus to the frame showing the repl buffer (I am using the previous slime-s-t-o-b). Other than that I think you need to set display-buffer-reuse-frames to t. Or alternatively, set special-display-regexps to (("slime-repl" (same-frame . t)))
M/
Helmut Eller heller@common-lisp.net writes:
Despite the variables you mention, Emacs has already a variable display-buffer-reuse-frames which probably does what slime-switch-to-output-buffer-search-all-frames was supposed to do.
IIRC, I tried it. Perhaps that was on another occasion, though.
-T.