[Note. All of these also occur in real XEmacs usages.
Maybe problems like these also cause the crashes Colin sees using
electric-buffer-list, because that uses the window configuration stuff]
Because in the window configurations, window sizes are stored in
pixels, but frame-sizes in lines we get breakage when there is a
redisplay in the save-window-excursion with a new fontheight.
xemacs -vanilla -eval '(progn (set-face-font (quote default)
"-*-courier-medium-r-*-*-*-140-*-*-*-*-iso8859-*") (save-window-excursion
(redisplay-device)))'
xemacs -vanilla -eval '(progn (set-face-font (quote default)
"-*-courier-medium-r-*-*-*-60-*-*-*-*-iso8859-*") (save-window-excursion
(redisplay-device)))'
[You can actually scroll the cursor off screen with this last one!].
There is code that tries to deal with this (and other frame size
changes) in Fset_window_configuration but it fails in the font size
change case (because in XEmacs 21.0 font size changes preserve the
lines*colums size, not the pixel size).
One identified it is easy to come up with other such problems
xemacs -vanilla -eval '(save-window-excursion (set-specifier default-toolbar nil)
(redisplay-frame))'
One could probably continue to do this ad infinitum,
(and I have actually seen this happen before).
Solution?
Maybe we should not blindly copy the window sizes in pixels... Instead
we should try to preserve relative sizes.
i.e. new-window-width = total-available-width *
(old-window-width / old-total-avaliable-with)
and the same for height. Of course the real code should do this
without floats, deal with over/underflows and should allocate the
rounding error pixels to one of the windows.
One could also argue that save-window-configuration should also save
the relevant specifiers for the tool-bar and the scrollbar etc.
Jan