Killing buffer dedicated to window.

Zajcev Evgeny <[email protected]> Thu, 22 Jan 2004 10:49:31 +0300
Newsgroups gmane.emacs.xemacs.design
Message-ID <[email protected]>
Normally when you kill buffer dedicated to window and the window is
only one in frame, frame will be deleted also.  But i found that if
frame is about to be deleted and there no other visible frames
`replace-buffer-in-windows' will skip value of
`allow-deletion-of-last-visible-frame' variable.  Is not it be correct
by `replace-buffer-in-windows' to regard value of
`allow-deletion-of-last-visible-frame'?

Here is simple patch to fix this up:

======= Cut here =======
--- window.orig.c       Thu Jan 22 10:19:33 2004
+++ window.c    Thu Jan 22 10:02:49 2004
@@ -61,6 +61,8 @@
 #endif
 #endif
 
+extern int allow_deletion_of_last_visible_frame;
+
 EXFUN (Fnext_window, 4);
 
 static int window_pixel_width_to_char_width (struct window *w,
@@ -2919,7 +2921,8 @@
                         of its own, kill the frame.  */
                      if (EQ (w, FRAME_ROOT_WINDOW (f))
                          && !NILP (p->dedicated)
-                         && other_visible_frames (f))
+                         && (allow_deletion_of_last_visible_frame
+                             || other_visible_frames (f)))
                        {
                          /* Skip the other windows on this frame.
                             There might be one, the minibuffer!  */
@@ -3371,7 +3374,8 @@
          if (!NILP (XWINDOW (window)->dedicated)
              && EQ (window,
                     FRAME_ROOT_WINDOW (XFRAME (frame)))
-             && other_visible_frames (XFRAME (frame)))
+             && (allow_deletion_of_last_visible_frame
+                 || other_visible_frames (XFRAME (frame))))
            {
              delete_frame_internal (XFRAME (frame), 0, 0, 0); /* GC */
            }
======= Cut ends here =======

Thanks!

-- 
lg