If the current window is a side window, and you attempt to switch perspectives (via persp-switch), the following error occurs: Cannot make side window the only window, leaving persp-mode in a broken state.
side windows are a new feature in Emacs 26. They can be detected via the window-side window parameter and opened with display-buffer-in-side-window.
The error is caused by calling delete-other-windows from a side window.
The error originates from persp-restore-window-conf, which calls delete-other-windowson line 3567.
Steps to reproduce
Opens Emacs 26+
Create a new perspective: (persp-add-new "X") (don't switch to it)
If the current window is a side window, and you attempt to switch perspectives (via
persp-switch
), the following error occurs:Cannot make side window the only window
, leaving persp-mode in a broken state.window-side
window parameter and opened withdisplay-buffer-in-side-window
.delete-other-windows
from a side window.persp-restore-window-conf
, which callsdelete-other-windows
on line 3567.Steps to reproduce
(persp-add-new "X")
(don't switch to it)M-x persp-switch
.I'm not sure how you want to handle this edge case. The workaround I am currently using is: