changeset 12643:45ada337053e

(Fprevious_window, Fnext_window): When minibuf = nil, accept only the minibuffer window that is currently active.
author Richard M. Stallman <rms@gnu.org>
date Sun, 23 Jul 1995 07:11:26 +0000
parents cdfbcff1f22a
children 35800a352783
files src/window.c
diffstat 1 files changed, 25 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.c	Sat Jul 22 16:13:31 1995 +0000
+++ b/src/window.c	Sun Jul 23 07:11:26 1995 +0000
@@ -916,12 +916,17 @@
   /* minibuf == nil may or may not include minibuffers.
      Decide if it does.  */
   if (NILP (minibuf))
-    minibuf = (minibuf_level ? Qt : Qlambda);
+    minibuf = (minibuf_level ? minibuf_window : Qlambda);
+  else if (! EQ (minibuf, Qt))
+    minibuf = Qlambda;
+  /* Now minibuf can be t => count all minibuffer windows,
+     lambda => count none of them,
+     or a specific minibuffer window (the active one) to count.  */
 
 #ifdef MULTI_FRAME
   /* all_frames == nil doesn't specify which frames to include.  */
   if (NILP (all_frames))
-    all_frames = (EQ (minibuf, Qt)
+    all_frames = (! EQ (minibuf, Qlambda)
 		  ? (FRAME_MINIBUF_WINDOW
 		     (XFRAME
 		      (WINDOW_FRAME
@@ -994,11 +999,13 @@
     }
   /* Which windows are acceptible?
      Exit the loop and accept this window if
-     this isn't a minibuffer window, or
-     we're accepting minibuffer windows, or
+     this isn't a minibuffer window,
+     or we're accepting all minibuffer windows,
+     or this is the active minibuffer and we are accepting that one, or
      we've come all the way around and we're back at the original window.  */
   while (MINI_WINDOW_P (XWINDOW (window))
 	 && ! EQ (minibuf, Qt)
+	 && ! EQ (minibuf, window)
 	 && ! EQ (window, start_window));
 
   return window;
@@ -1055,13 +1062,18 @@
   /* minibuf == nil may or may not include minibuffers.
      Decide if it does.  */
   if (NILP (minibuf))
-    minibuf = (minibuf_level ? Qt : Qlambda);
+    minibuf = (minibuf_level ? minibuf_window : Qlambda);
+  else if (! EQ (minibuf, Qt))
+    minibuf = Qlambda;
+  /* Now minibuf can be t => count all minibuffer windows,
+     lambda => count none of them,
+     or a specific minibuffer window (the active one) to count.  */
 
 #ifdef MULTI_FRAME
   /* all_frames == nil doesn't specify which frames to include.
      Decide which frames it includes.  */
   if (NILP (all_frames))
-    all_frames = (EQ (minibuf, Qt)
+    all_frames = (! EQ (minibuf, Qlambda)
 		   ? (FRAME_MINIBUF_WINDOW
 		      (XFRAME
 		       (WINDOW_FRAME
@@ -1147,14 +1159,16 @@
 	    window = tem;
 	}
     }
-  /* Which windows are acceptable?
+  /* Which windows are acceptible?
      Exit the loop and accept this window if
-     this isn't a minibuffer window, or
-     we're accepting minibuffer windows, or
+     this isn't a minibuffer window,
+     or we're accepting all minibuffer windows,
+     or this is the active minibuffer and we are accepting that one, or
      we've come all the way around and we're back at the original window.  */
   while (MINI_WINDOW_P (XWINDOW (window))
-	 && !EQ (minibuf, Qt)
-	 && !EQ (window, start_window));
+	 && ! EQ (minibuf, Qt)
+	 && ! EQ (minibuf, window)
+	 && ! EQ (window, start_window));
 
   return window;
 }