diff options
| author | Richard M. Stallman | 1994-07-24 20:02:37 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-07-24 20:02:37 +0000 |
| commit | 1bb80f722ba693d3d72cf9921eb107dd2d2499f1 (patch) | |
| tree | 2bf508d4c428348e0fc595efb63dee7de0fa07d5 /src/window.c | |
| parent | 13118fc3d8270fb22ef2d194d14b538222e91183 (diff) | |
| download | emacs-1bb80f722ba693d3d72cf9921eb107dd2d2499f1.tar.gz emacs-1bb80f722ba693d3d72cf9921eb107dd2d2499f1.zip | |
(Fnext_window, Fprevious_window): Don't get stuck in a loop
in the minibuffer frame.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/src/window.c b/src/window.c index 493e2889537..f4cfcb2b725 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -880,15 +880,14 @@ DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0, | |||
| 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) |
| @@ -918,7 +917,19 @@ DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0, | |||
| 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 | ||
| @@ -1050,7 +1061,19 @@ DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0, | |||
| 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. */ |