Mercurial > emacs
comparison src/window.c @ 8323:30755be9badb
(Fnext_window, Fprevious_window): Don't get stuck in a loop
in the minibuffer frame.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 24 Jul 1994 20:02:37 +0000 |
parents | bae811318a57 |
children | 3be9c6b57956 |
comparison
equal
deleted
inserted
replaced
8322:faedd07b38ed | 8323:30755be9badb |
---|---|
878 Decide if it does. */ | 878 Decide if it does. */ |
879 if (NILP (minibuf)) | 879 if (NILP (minibuf)) |
880 minibuf = (minibuf_level ? Qt : Qlambda); | 880 minibuf = (minibuf_level ? Qt : Qlambda); |
881 | 881 |
882 #ifdef MULTI_FRAME | 882 #ifdef MULTI_FRAME |
883 /* all_frames == nil doesn't specify which frames to include. | 883 /* all_frames == nil doesn't specify which frames to include. */ |
884 Decide which frames it includes. */ | |
885 if (NILP (all_frames)) | 884 if (NILP (all_frames)) |
886 all_frames = (EQ (minibuf, Qt) | 885 all_frames = (EQ (minibuf, Qt) |
887 ? (FRAME_MINIBUF_WINDOW | 886 ? (FRAME_MINIBUF_WINDOW |
888 (XFRAME | 887 (XFRAME |
889 (WINDOW_FRAME | 888 (WINDOW_FRAME |
890 (XWINDOW (window))))) | 889 (XWINDOW (window))))) |
891 : Qnil); | 890 : Qnil); |
892 else if (EQ (all_frames, Qvisible)) | 891 else if (EQ (all_frames, Qvisible)) |
893 ; | 892 ; |
894 else if (XFASTINT (all_frames) == 0) | 893 else if (XFASTINT (all_frames) == 0) |
895 ; | 894 ; |
896 else if (! EQ (all_frames, Qt)) | 895 else if (! EQ (all_frames, Qt)) |
916 /* We've reached the end of this frame. | 915 /* We've reached the end of this frame. |
917 Which other frames are acceptable? */ | 916 Which other frames are acceptable? */ |
918 tem = WINDOW_FRAME (XWINDOW (window)); | 917 tem = WINDOW_FRAME (XWINDOW (window)); |
919 #ifdef MULTI_FRAME | 918 #ifdef MULTI_FRAME |
920 if (! NILP (all_frames)) | 919 if (! NILP (all_frames)) |
921 tem = next_frame (tem, all_frames); | 920 { |
921 Lisp_Object tem1; | |
922 | |
923 tem1 = tem; | |
924 tem = next_frame (tem, all_frames); | |
925 /* In the case where the minibuffer is active, | |
926 and we include its frame as well as the selected one, | |
927 next_frame may get stuck in that frame. | |
928 If that happens, go back to the selected frame | |
929 so we can complete the cycle. */ | |
930 if (EQ (tem, tem1)) | |
931 XSET (tem, Lisp_Frame, selected_frame); | |
932 } | |
922 #endif | 933 #endif |
923 tem = FRAME_ROOT_WINDOW (XFRAME (tem)); | 934 tem = FRAME_ROOT_WINDOW (XFRAME (tem)); |
924 | 935 |
925 break; | 936 break; |
926 } | 937 } |
1048 forth around the ring. If we use next_frame here, | 1059 forth around the ring. If we use next_frame here, |
1049 then Fnext_window and Fprevious_window take different | 1060 then Fnext_window and Fprevious_window take different |
1050 paths through the set of acceptable windows. | 1061 paths through the set of acceptable windows. |
1051 window_loop assumes that these `ring' requirement are | 1062 window_loop assumes that these `ring' requirement are |
1052 met. */ | 1063 met. */ |
1053 tem = prev_frame (tem, all_frames); | 1064 { |
1065 Lisp_Object tem1; | |
1066 | |
1067 tem1 = tem; | |
1068 tem = prev_frame (tem, all_frames); | |
1069 /* In the case where the minibuffer is active, | |
1070 and we include its frame as well as the selected one, | |
1071 next_frame may get stuck in that frame. | |
1072 If that happens, go back to the selected frame | |
1073 so we can complete the cycle. */ | |
1074 if (EQ (tem, tem1)) | |
1075 XSET (tem, Lisp_Frame, selected_frame); | |
1076 } | |
1054 #endif | 1077 #endif |
1055 /* If this frame has a minibuffer, find that window first, | 1078 /* If this frame has a minibuffer, find that window first, |
1056 because it is conceptually the last window in that frame. */ | 1079 because it is conceptually the last window in that frame. */ |
1057 if (FRAME_HAS_MINIBUF_P (XFRAME (tem))) | 1080 if (FRAME_HAS_MINIBUF_P (XFRAME (tem))) |
1058 tem = FRAME_MINIBUF_WINDOW (XFRAME (tem)); | 1081 tem = FRAME_MINIBUF_WINDOW (XFRAME (tem)); |