aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1997-05-10 21:44:11 +0000
committerRichard M. Stallman <[email protected]>1997-05-10 21:44:11 +0000
commit435bc8400e6cde55bb92302aff9f82d75a3da103 (patch)
tree451e82af3852f0be00f2683207fe04e29ecdd8b0 /src/buffer.c
parente2b307720fe09759adfb2b880b39022b80a0e644 (diff)
(Fbury_buffer): If buffer is in selected window, remove it.
Otherwise, remove it from other windows.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 343686d43f..1b5a66b098 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1534,9 +1534,6 @@ selected window if it is displayed there.")
if (NILP (buffer))
{
XSETBUFFER (buffer, current_buffer);
-
- /* If we're burying the current buffer, unshow it. */
- Fswitch_to_buffer (Fother_buffer (buffer, Qnil), Qnil);
}
else
{
@@ -1548,6 +1545,13 @@ selected window if it is displayed there.")
buffer = buf1;
}
+ /* Unshow the buffer in the selected window, if it is there. */
+ if (EQ (XWINDOW (selected_window)->buffer, buffer))
+ Fswitch_to_buffer (Fother_buffer (buffer, Qnil), Qnil);
+ /* Otherwise, unshow it in other frames. */
+ else
+ Freplace_buffer_in_windows (buffer);
+
/* Move buffer to the end of the buffer list. */
{
register Lisp_Object aelt, link;