comparison src/window.c @ 3723:ccb9c93aac80

(Fdelete_window): Handle deleting a parent of the selected window. (Fdelete_window): Mostly undo last change which made `frame' a FRAME_PTR. Don't initialize `frame' in the declaration.
author Richard M. Stallman <rms@gnu.org>
date Mon, 14 Jun 1993 07:07:05 +0000
parents b9f27ed0228c
children bde2da377085
comparison
equal deleted inserted replaced
3722:c9938769a6b7 3723:ccb9c93aac80
698 698
699 windows_or_buffers_changed++; 699 windows_or_buffers_changed++;
700 700
701 /* Are we trying to delete any frame's selected window? */ 701 /* Are we trying to delete any frame's selected window? */
702 { 702 {
703 FRAME_PTR frame = WINDOW_FRAME (XWINDOW (window)); 703 Lisp_Object frame, pwindow;
704 704
705 if (EQ (window, FRAME_SELECTED_WINDOW (frame))) 705 /* See if the frame's selected window is either WINDOW
706 or any subwindow of it, by finding all that window's parents
707 and comparing each one with WINDOW. */
708 frame = WINDOW_FRAME (XWINDOW (window));
709 pwindow = FRAME_SELECTED_WINDOW (XFRAME (frame));
710
711 while (!NILP (pwindow))
712 {
713 if (EQ (window, pwindow))
714 break;
715 pwindow = XWINDOW (pwindow)->parent;
716 }
717
718 if (EQ (window, pwindow))
706 { 719 {
707 Lisp_Object alternative = Fnext_window (window, Qlambda, Qnil); 720 Lisp_Object alternative = Fnext_window (window, Qlambda, Qnil);
708 721
709 /* If we're about to delete the selected window on the 722 /* If we're about to delete the selected window on the
710 selected frame, then we should use Fselect_window to select 723 selected frame, then we should use Fselect_window to select
712 delete the selected window on any other frame, we shouldn't do 725 delete the selected window on any other frame, we shouldn't do
713 anything but set the frame's selected_window slot. */ 726 anything but set the frame's selected_window slot. */
714 if (EQ (window, selected_window)) 727 if (EQ (window, selected_window))
715 Fselect_window (alternative); 728 Fselect_window (alternative);
716 else 729 else
717 FRAME_SELECTED_WINDOW (frame) = alternative; 730 FRAME_SELECTED_WINDOW (XFRAME (frame)) = alternative;
718 } 731 }
719 } 732 }
720 733
721 tem = p->buffer; 734 tem = p->buffer;
722 /* tem is null for dummy parent windows 735 /* tem is null for dummy parent windows