Kaarthik Sivakumar <kaarthik(a)comcast.net> wrote:
I get a "Cannot switch buffers in minibuffer window" error
message
when I do the following. I can reproduce this at will with 'xemacs -q'.
1. Start with a single buffer.
2. Do 'C-x 2'
3. Go to the bottom buffer.
4. Do 'C-x 3'
5. Go the right hand side buffer.
6. Do 'C-x b' (switch-to-buffer here). Give any buffer name or even
'RET' for the default choice.
I see the following error:
Signaling: (error "Cannot switch buffers in minibuffer window")
signal(error ("Cannot switch buffers in minibuffer window"))
cerror("Cannot switch buffers in minibuffer window")
apply(cerror "Cannot switch buffers in minibuffer window" nil)
error("Cannot switch buffers in minibuffer window")
switch-to-buffer("*Backtrace*")
call-interactively(switch-to-buffer)
(dispatch-event "[internal]")
This seems to be related to Nickolay Pakoulin's later message, entitled
"[21.5] [BUG] save/restore window configuration". After creating these
three windows, "C-x b" ultimately causes a call to read-from-minibuffer.
That function sets oconfig to the value of
(current-window-configuration) before doing its work, then evaluates
(set-window-configuration oconfig) just before returning. However, the
set-window-configuration call fails to do the right thing. It creates
two windows instead of three, and then selects the minibuffer as the
current window, resulting in the error reported above.
Try this:
1. Start xemacs with -q
2. C-x 2
3. C-x o
4. C-x 3
5. C-x o
6. (setq my-config (current-window-configuration)) C-j
7. C-x 1
8. (set-window-configuration my-config) C-j
At this point, there are 2 windows showing *scratch*, and the cursor is
in the (empty) minibuffer. Further experiments show that
set-window-configuration works correctly with two windows, whether split
horizontally or vertically, but if I make 4 windows by doing C-x 2 and
then splitting the top and bottom both with C-x 3, then
set-window-configuration does this:
_____________________________________
| | |
| | |
| | |
| | |
_____________________________________
| |
| |
| |
| |
_____________________________________
and once again puts point into the minibuffer. It looks like
set-window-configuration can't handle having the bottom window split.
--
Jerry James
http://www.ittc.ku.edu/~james/