aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorRichard M. Stallman1995-07-23 07:11:26 +0000
committerRichard M. Stallman1995-07-23 07:11:26 +0000
commitfbdc1545c3792104f9afa3ac448d5a29e4bb8207 (patch)
treea488481bf438c51b63bc0da3e830da425ca088ce /src/window.c
parent3be3c08ef8142ada51a065831d3350bf39a786e8 (diff)
downloademacs-fbdc1545c3792104f9afa3ac448d5a29e4bb8207.tar.gz
emacs-fbdc1545c3792104f9afa3ac448d5a29e4bb8207.zip
(Fprevious_window, Fnext_window): When minibuf = nil,
accept only the minibuffer window that is currently active.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/src/window.c b/src/window.c
index 7d970d758ed..4c1a5e8bee1 100644
--- a/src/window.c
+++ b/src/window.c
@@ -916,12 +916,17 @@ DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0,
916 /* minibuf == nil may or may not include minibuffers. 916 /* minibuf == nil may or may not include minibuffers.
917 Decide if it does. */ 917 Decide if it does. */
918 if (NILP (minibuf)) 918 if (NILP (minibuf))
919 minibuf = (minibuf_level ? Qt : Qlambda); 919 minibuf = (minibuf_level ? minibuf_window : Qlambda);
920 else if (! EQ (minibuf, Qt))
921 minibuf = Qlambda;
922 /* Now minibuf can be t => count all minibuffer windows,
923 lambda => count none of them,
924 or a specific minibuffer window (the active one) to count. */
920 925
921#ifdef MULTI_FRAME 926#ifdef MULTI_FRAME
922 /* all_frames == nil doesn't specify which frames to include. */ 927 /* all_frames == nil doesn't specify which frames to include. */
923 if (NILP (all_frames)) 928 if (NILP (all_frames))
924 all_frames = (EQ (minibuf, Qt) 929 all_frames = (! EQ (minibuf, Qlambda)
925 ? (FRAME_MINIBUF_WINDOW 930 ? (FRAME_MINIBUF_WINDOW
926 (XFRAME 931 (XFRAME
927 (WINDOW_FRAME 932 (WINDOW_FRAME
@@ -994,11 +999,13 @@ DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0,
994 } 999 }
995 /* Which windows are acceptible? 1000 /* Which windows are acceptible?
996 Exit the loop and accept this window if 1001 Exit the loop and accept this window if
997 this isn't a minibuffer window, or 1002 this isn't a minibuffer window,
998 we're accepting minibuffer windows, or 1003 or we're accepting all minibuffer windows,
1004 or this is the active minibuffer and we are accepting that one, or
999 we've come all the way around and we're back at the original window. */ 1005 we've come all the way around and we're back at the original window. */
1000 while (MINI_WINDOW_P (XWINDOW (window)) 1006 while (MINI_WINDOW_P (XWINDOW (window))
1001 && ! EQ (minibuf, Qt) 1007 && ! EQ (minibuf, Qt)
1008 && ! EQ (minibuf, window)
1002 && ! EQ (window, start_window)); 1009 && ! EQ (window, start_window));
1003 1010
1004 return window; 1011 return window;
@@ -1055,13 +1062,18 @@ DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0,
1055 /* minibuf == nil may or may not include minibuffers. 1062 /* minibuf == nil may or may not include minibuffers.
1056 Decide if it does. */ 1063 Decide if it does. */
1057 if (NILP (minibuf)) 1064 if (NILP (minibuf))
1058 minibuf = (minibuf_level ? Qt : Qlambda); 1065 minibuf = (minibuf_level ? minibuf_window : Qlambda);
1066 else if (! EQ (minibuf, Qt))
1067 minibuf = Qlambda;
1068 /* Now minibuf can be t => count all minibuffer windows,
1069 lambda => count none of them,
1070 or a specific minibuffer window (the active one) to count. */
1059 1071
1060#ifdef MULTI_FRAME 1072#ifdef MULTI_FRAME
1061 /* all_frames == nil doesn't specify which frames to include. 1073 /* all_frames == nil doesn't specify which frames to include.
1062 Decide which frames it includes. */ 1074 Decide which frames it includes. */
1063 if (NILP (all_frames)) 1075 if (NILP (all_frames))
1064 all_frames = (EQ (minibuf, Qt) 1076 all_frames = (! EQ (minibuf, Qlambda)
1065 ? (FRAME_MINIBUF_WINDOW 1077 ? (FRAME_MINIBUF_WINDOW
1066 (XFRAME 1078 (XFRAME
1067 (WINDOW_FRAME 1079 (WINDOW_FRAME
@@ -1147,14 +1159,16 @@ DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0,
1147 window = tem; 1159 window = tem;
1148 } 1160 }
1149 } 1161 }
1150 /* Which windows are acceptable? 1162 /* Which windows are acceptible?
1151 Exit the loop and accept this window if 1163 Exit the loop and accept this window if
1152 this isn't a minibuffer window, or 1164 this isn't a minibuffer window,
1153 we're accepting minibuffer windows, or 1165 or we're accepting all minibuffer windows,
1166 or this is the active minibuffer and we are accepting that one, or
1154 we've come all the way around and we're back at the original window. */ 1167 we've come all the way around and we're back at the original window. */
1155 while (MINI_WINDOW_P (XWINDOW (window)) 1168 while (MINI_WINDOW_P (XWINDOW (window))
1156 && !EQ (minibuf, Qt) 1169 && ! EQ (minibuf, Qt)
1157 && !EQ (window, start_window)); 1170 && ! EQ (minibuf, window)
1171 && ! EQ (window, start_window));
1158 1172
1159 return window; 1173 return window;
1160} 1174}