Hi,
There was a discussion on comp.emacs.xemacs regarding the different
behaviors of function `pop-to-buffer' based on different buffer names.
Basically, if the current XEmacs session has only one frame that
contains only one window, (pop-to-buffer "*shell*") will switch the
window to the shell buffer WITHOUT splitting the current window, but
(pop-to-buffer "b.txt") (here "b.txt" is just a regular buffer) will
always split the window into two first and then switch one of them to
"b.txt".
The problem is that buffer name "*shell*" appears in variable
`same-window-buffer-names' (or matches one element in
`same-window-regexps'), so when `pop-to-buffer' calls `display-buffer'
to display the shell buffer, it won't try to split the window.
Stephen J. Turnbull thinks that this is a documentation bug in
`pop-to-buffer', and suggested that I should report this problem to
xemacs-patches(a)xemacs.org. So here comes this email and the following
patch that I can think of (the patch is based on the version coming with
XEmacs 21.4.17):
------------------------------------------------------------------------
$ diff buffer.el buffer.el.new
69c69,71
< If `pop-up-windows' is non-nil, windows can be split to do this.
---
If `pop-up-windows' is non-nil, and the buffer name does not
appear
in `same-window-buffer-names' or match any element in `same-window-regexps',
windows can be split to do this.
------------------------------------------------------------------------
ChangLog for this fix can be something like this (manually edited ...)
2005-02-15 Baoqiu Cui <cbaoqiu(a)yahoo.com>
* buffer.el (pop-to-buffer): Mention variables
same-window-buffer-names and same-window-regexps in the
docstring.
Hope this fix can be accepted.
Regards,
--
Baoqiu Cui <cbaoqiu at yahoo.com>