Hi, I've been using slime casually for some time now and something always annoyed me, when the debug window pop up, it changes the size of the second window if there's one. I've searched for a ways to fix this behavior many times, but never found any simple solution. So today I've got myself into the code and made some changes. It works but the code is not really correct, one problem is that if you dig farther than the first cause and then use abort, it will hide the remaining debug buffers by restoring windows to their prior state. Can someone help me improve that code or show me a better way to achieve this?
Here's the patch:
--- slime.el.orig 2009-03-30 19:01:56.781250000 -0400 +++ slime.el 2009-12-10 00:28:27.984375000 -0500 @@ -1040,6 +1040,8 @@ (set-window-buffer popup-window old-buffer)))) (when (window-live-p selected-window) (select-window selected-window))) + (when sldb-last-window-configuration + (set-window-configuration sldb-last-window-configuration)) (kill-local-variable 'slime-popup-restore-data)))
(defmacro slime-save-local-variables (vars &rest body) @@ -4069,6 +4071,8 @@ ;;(when msg (slime-insert-transcript-delimiter msg)) ;;(setq slime-repl-popup-on-output (not no-popups)) (setq cont (or cont #'slime-display-eval-result)) + (when (null sldb-last-window-configuration) + (setq sldb-last-window-configuration (current-window-configuration))) (slime-rex (cont (buffer (current-buffer))) (form) ((:ok value) (slime-eval-with-transcript-cont t value cont buffer)) ((:abort) (slime-eval-with-transcript-cont nil nil nil buffer)))) @@ -5158,6 +5162,9 @@ :group 'slime-debugger :type 'integer)
+(defvar sldb-last-window-configuration nil + "Last window configuration before creating a new sldb buffer.") + ;;;;; Local variables in the debugger buffer
Thanks
I've posted the wrong patch in my first message, it was missing a line, here's the correct one:
--- slime.el.orig 2009-03-30 19:01:56.781250000 -0400 +++ slime.el 2009-12-10 00:58:25.843750000 -0500 @@ -1040,6 +1040,9 @@ (set-window-buffer popup-window old-buffer)))) (when (window-live-p selected-window) (select-window selected-window))) + (when sldb-last-window-configuration + (set-window-configuration sldb-last-window-configuration) + (setq sldb-last-window-configuration nil)) (kill-local-variable 'slime-popup-restore-data)))
(defmacro slime-save-local-variables (vars &rest body) @@ -4069,6 +4072,8 @@ ;;(when msg (slime-insert-transcript-delimiter msg)) ;;(setq slime-repl-popup-on-output (not no-popups)) (setq cont (or cont #'slime-display-eval-result)) + (when (null sldb-last-window-configuration) + (setq sldb-last-window-configuration (current-window-configuration))) (slime-rex (cont (buffer (current-buffer))) (form) ((:ok value) (slime-eval-with-transcript-cont t value cont buffer)) ((:abort) (slime-eval-with-transcript-cont nil nil nil buffer)))) @@ -5158,6 +5163,9 @@ :group 'slime-debugger :type 'integer)
+(defvar sldb-last-window-configuration nil + "Last window configuration before creating a new sldb buffer.") + ;;;;; Local variables in the debugger buffer
On Thu, Dec 10, 2009 at 12:55 AM, Nicolas Buduroi nbuduroi@gmail.comwrote:
Hi, I've been using slime casually for some time now and something always annoyed me, when the debug window pop up, it changes the size of the second window if there's one. I've searched for a ways to fix this behavior many times, but never found any simple solution. So today I've got myself into the code and made some changes. It works but the code is not really correct, one problem is that if you dig farther than the first cause and then use abort, it will hide the remaining debug buffers by restoring windows to their prior state. Can someone help me improve that code or show me a better way to achieve this?
Here's the patch:
--- slime.el.orig 2009-03-30 19:01:56.781250000 -0400 +++ slime.el 2009-12-10 00:28:27.984375000 -0500 @@ -1040,6 +1040,8 @@ (set-window-buffer popup-window old-buffer)))) (when (window-live-p selected-window) (select-window selected-window)))
- (when sldb-last-window-configuration
(kill-local-variable 'slime-popup-restore-data)))(set-window-configuration sldb-last-window-configuration))
(defmacro slime-save-local-variables (vars &rest body) @@ -4069,6 +4071,8 @@ ;;(when msg (slime-insert-transcript-delimiter msg)) ;;(setq slime-repl-popup-on-output (not no-popups)) (setq cont (or cont #'slime-display-eval-result))
- (when (null sldb-last-window-configuration)
- (setq sldb-last-window-configuration (current-window-configuration)))
(slime-rex (cont (buffer (current-buffer))) (form) ((:ok value) (slime-eval-with-transcript-cont t value cont buffer)) ((:abort) (slime-eval-with-transcript-cont nil nil nil buffer)))) @@ -5158,6 +5162,9 @@ :group 'slime-debugger :type 'integer)
+(defvar sldb-last-window-configuration nil
- "Last window configuration before creating a new sldb buffer.")
;;;;; Local variables in the debugger buffer
Thanks
Nicolas Buduroi nbuduroi@gmail.com writes:
Hi, I've been using slime casually for some time now and something always annoyed me, when the debug window pop up, it changes the size of the second window if there's one.
I cannot seem to reproduce this. Could you provide all steps beginning with M-x slime, then your window changing commands etc, please?
I've searched for a ways to fix this behavior many times, but never found any simple solution. So today I've got myself into the code and made some changes. It works but the code is not really correct, one problem is that if you dig farther than the first cause and then use abort, it will hide the remaining debug buffers by restoring windows to their prior state. Can someone help me improve that code or show me a better way to achieve this?
I don't know what our current policy regarding window configuration is because we tried so many, and everytime we annoyed someone.
I thought we were going to _get rid of_ automatically restoring configuration, and instead wanted to point people to `winner-mode'.
-T.
On Thu, Dec 10, 2009 at 4:13 AM, Tobias C. Rittweiler tcr@freebits.dewrote:
Hi, I've been using slime casually for some time now and something
always annoyed me, when the debug window pop up, it changes the size of the second window if there's one.
I cannot seem to reproduce this. Could you provide all steps beginning with M-x slime, then your window changing commands etc, please?
in a source code file buffer C-x 2 M-7 C-x ^ C-x o M-x slime C-x o eval some wrong code press zero to close the debug window the second window size is back to where it was before shrinking it
Maybe that's not a usual way to work for more experienced slimers. It also happen with elisp evaluation by the way. When the mini-buffer auto-completion window pop-up, it sometimes resize the second window, if it's too small I think, but restores window configuration afterward. I find this much less annoying. I didn't thought about looking at how it's made for auto-completion, just remembered that detail today.
I've searched for a ways to fix this behavior many times, but never found any simple solution. So today I've got myself into the code and made some changes. It works but the code is not really correct, one problem is that if you dig farther than the first cause and then use abort, it will hide the remaining debug buffers by restoring windows to their prior state. Can someone help me improve that code or show me a better way to achieve this?
I don't know what our current policy regarding window configuration is because we tried so many, and everytime we annoyed someone.
Slime is quite a beast, it must not be easy to maintain with lispers of all kind as users! While I'm still using just a fraction of it's power, I already think it's the best development environment ever.
I thought we were going to _get rid of_ automatically restoring
configuration, and instead wanted to point people to `winner-mode'.
Didn't knew about all this, that explain why the slime-set-emacs-snapshot function isn't being used. I've had a look at winner-mode and I'll certainly use it. But I think it doesn't really resolve this issue, as we still have to type 'C-c left' (I'm very lazy ;-).
- budu
Nicolas Buduroi nbuduroi@gmail.com writes:
On Thu, Dec 10, 2009 at 4:13 AM, Tobias C. Rittweiler tcr@freebits.dewrote:
Hi, I've been using slime casually for some time now and something
always annoyed me, when the debug window pop up, it changes the size of the second window if there's one.
I cannot seem to reproduce this. Could you provide all steps beginning with M-x slime, then your window changing commands etc, please?
in a source code file buffer C-x 2 M-7 C-x ^ C-x o M-x slime C-x o eval some wrong code press zero to close the debug window the second window size is back to where it was before shrinking it
Maybe that's not a usual way to work for more experienced slimers. It also happen with elisp evaluation by the way. When the mini-buffer auto-completion window pop-up, it sometimes resize the second window, if it's too small I think, but restores window configuration afterward. I find this much less annoying. I didn't thought about looking at how it's made for auto-completion, just remembered that detail today.
Ok, it seems to me that you want to set `even-window-heights' to nil.
-T.