summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-07-23 07:11:26 +0000
committerRichard M. Stallman <rms@gnu.org>1995-07-23 07:11:26 +0000
commit8f31ca5d068d3f165b24e2acd0fcc163a2c30148 (patch)
treea5eedf929c815b0d840940eb7376e0119ca57e5f /src/window.c
parentc6b437a6b0cf77c7c49abc7b03ed8a4a237854d5 (diff)
downloademacs-8f31ca5d068d3f165b24e2acd0fcc163a2c30148.tar.gz
(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,
/* 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 @@ DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0,
}
/* 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 @@ DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0,
/* 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 @@ DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0,
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;
}