]> git.eshelyaron.com Git - emacs.git/commitdiff
(window_loop, UNSHOW_BUFFER case):
authorRichard M. Stallman <rms@gnu.org>
Mon, 23 May 1994 05:41:58 +0000 (05:41 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 23 May 1994 05:41:58 +0000 (05:41 +0000)
Put prev change in #ifdef MULTI_FRAME.

src/window.c

index 3994f3b80887e9ce7618cbe20c382f0be74b162f..133229af5f6c005668be75488b9e2b1606ebadbc 100644 (file)
@@ -1265,14 +1265,27 @@ window_loop (type, obj, mini, frames)
              {
                /* Find another buffer to show in this window.  */
                Lisp_Object another_buffer;
+               FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (w)));
                another_buffer = Fother_buffer (obj, Qnil);
                if (NILP (another_buffer))
                  another_buffer
                    = Fget_buffer_create (build_string ("*scratch*"));
-               XWINDOW (w)->dedicated = Qnil;
-               Fset_window_buffer (w, another_buffer);
-               if (EQ (w, selected_window))
-                 Fset_buffer (XWINDOW (w)->buffer);
+#ifdef MULTI_FRAME
+               /* If this window is dedicated, and in a frame of its own,
+                  kill the frame.  */
+               if (EQ (w, FRAME_ROOT_WINDOW (f))
+                   && XWINDOW (w)->dedicated
+                   && other_visible_frames (f))
+                 Fdelete_frame (WINDOW_FRAME (XWINDOW (w)), Qnil);
+               else
+#endif
+                 {
+                   /* Otherwise show a different buffer in the window.  */
+                   XWINDOW (w)->dedicated = Qnil;
+                   Fset_window_buffer (w, another_buffer);
+                   if (EQ (w, selected_window))
+                     Fset_buffer (XWINDOW (w)->buffer);
+                 }
              }
            break;
          }