golden-ratio-mode breaks eyebrowse when using multiple windows
topher200 opened this issue Β· comments
Description ![:octocat: :octocat:](https://github.githubassets.com/images/icons/emoji/octocat.png)
Creating or moving to a eyebrowse workspace with a complex window arrangement while in golden-ratio-mode results in error.
Turning off golden-ratio-mode removes the error.
Observed on Spacemacs' master and develop.
Reproduction guide πͺ²
- Start Emacs
C-x b sc Enter
Navigate to *scratch* bufferSpace t g
Turn on golden-ratio-modeSpace w v
Split the window verticallySpace w h
Split the window horizontallySpace w v
Split the window vertically one more time- β There should be four windows
C-c C-w C-c
Attempt to create a new workspace
Observed behaviour: π π
The new workspace is created!
However, we stay in our original workspace. One of the windows has disappeared from our original workspace; we now have three windows.
This error appears in the status bar:
window--state-put-1: Cannot resize window #<window 3 on *temp*>
Expected behaviour: β€οΈ π
The new workspace is created. We move to the new workspace. Our original workspace is unmodified.
System Info π»
- OS: darwin
- Emacs: 25.1.1
- Spacemacs: 0.200.5
- Spacemacs branch: develop (rev. fea919c)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
(sql auto-completion emacs-lisp
(evil-snipe :variables evil-snipe-enable-alternate-f-and-t-behaviors t)
(git :variables git-gutter-use-fringe t)
go helm html javascript markdown python shell
(syntax-checking :variables syntax-checking-enable-tooltips nil)
topher yaml)
- System configuration features: JPEG RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES
I'm sorry, but could you please provide a repro not involving your Emacs configuration, that is, Spacemacs?
Steps to reproduce without Spacemacs:
- Clear out your emacs configuration by deleting or moving your .emacs.d/
- Start Emacs
- Enable Marmalade repo (https://marmalade-repo.org/#download)
- Install eyebrowse using install-package
- Install el-get (https://github.com/dimitri/el-get)
- Install golden-ratio-mode using
el-get-install golden-ratio-mode
M-x eyebrowse-mode
Turn on eyebrowse modeM-x golden-ratio-mode
Turn on golden-ratio modeC-x 3
Split window on the rightC-x 2
Split window on the bottomC-x 3
Split window on the right- β There should be four windows
M-x eyebrowse-create-window-config
Create a new workspace using eyebrowse
Observe this error in Messages:
window--state-put-1: Cannot resize window #<window 20 on *temp*>
This should also work by installing everything from MELPA, right?
I would assume so! I've had no issues reproducing the issue no matter how the pieces were installed.
Hmm, I can switch window configurations, but get different errors in a minimal session. Can you enable backtraces with M-x toggle-debug-on-error
and include yours?
I tried, but no backtrace appears in Backtrace.
I'm going to modify the steps a bit by adding a step 8B, just so that we start with the exact same window configuration.
- Clear out your emacs configuration by deleting or moving your .emacs.d/
- Start Emacs
- Enable Marmalade repo (https://marmalade-repo.org/#download)
- Install eyebrowse using install-package
- Install el-get (https://github.com/dimitri/el-get)
- Install golden-ratio-mode using
el-get-install golden-ratio-mode
M-x eyebrowse-mode
Turn on eyebrowse modeM-x golden-ratio-mode
Turn on golden-ratio mode- Step 8B: Close all windows but one, using
C-x 0
. Load your*scratch*
buffer the one remaining window
- Step 8B: Close all windows but one, using
C-x 3
Split window on the rightC-x 2
Split window on the bottomC-x 3
Split window on the right- β There should be four windows
M-x eyebrowse-create-window-config
Create a new workspace using eyebrowse
Here's what I get in Messages with that configuration:
Debug on Error enabled globally
window--state-put-1: Cannot resize window #<window 56 on *temp*>
Notice that Messages says that I've enabled debug-on-error, but there is no Backtrace buffer.
@wasamasa If it would be helpful to do some kind of screenshare to debug the issue together I'd be happy to assist.
OK, can reproduce that one now. I have a partial fix that defers the error to happen a bit later. From what I can tell, golden-ratio does really weird things. One part is advicing/hooking nilly-willy, the other part is resizing windows shortly after the user performed a command (which is too late for packages to notice)
I have the other "fix". If you remove the part of golden-ratio-mode
that adds itself to window-configuration-change-hook
, the error is no more. Therefore I consider this to be a golden-ratio issue. Still, thanks for pointing this one out as I've made eyebrowse a bit more robust after the suggestion!
In case anyone else is having this problem, this pull request seems to solve the problem for me: roman/golden-ratio.el#66
I have only tested in two workspaces that I am using right now so far, so caveat emptor.
Same problem here.
@ChrisSalisbury no. if you open more than 2 windows the problem still occurred.
Steps:
- open eyebrowse workspace 1, 2 and 3
- open 1 window in w1, 3 windows in w2 and 3 windows in w3.
- try to switch workspace. The order of buffer will messed up and the error occurred again. (the error doesn't happen in w1 because it's only contain 1 window)
window--state-put-1: Cannot resize window #<window 69 on *temp*>
window--state-put-1: Cannot resize window #<window 78 on *temp*>
Please don't hijack existing threads for unrelated problems. Besides, I fail seeing what the problem is. All the profiler log shows here is that when windows are resized, both the eyebrowse indicator is recalculated and golden-ratio resizing is triggered as well. If you have an issue with golden-ratio triggering too often, complain on their bug tracker, not here.
Sorry for that. Will issue one there. I can delete this one if it is needed.
Yep, not fixed!