aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorMartin Rudalics2008-10-31 14:06:33 +0000
committerMartin Rudalics2008-10-31 14:06:33 +0000
commitab6d1131b48de3491ef1fb3e0ac2753ed89cbe2b (patch)
tree60430edd7af4a231d182c3a16369e9f189ebdd0d /src/window.c
parent5c17a891263f4afe1c2e2489cde9262fa073b543 (diff)
downloademacs-ab6d1131b48de3491ef1fb3e0ac2753ed89cbe2b.tar.gz
emacs-ab6d1131b48de3491ef1fb3e0ac2753ed89cbe2b.zip
(Fnext_window, Fprevious_window): Rewrite doc-string.
(Fother_window): Rename argument and rewrite doc-string. (select_window_norecord): Fix return value. (Bug#1276)
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c111
1 files changed, 57 insertions, 54 deletions
diff --git a/src/window.c b/src/window.c
index c01dbf0232b..87f166fd7b4 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1910,7 +1910,7 @@ decode_next_window_args (window, minibuf, all_frames)
1910} 1910}
1911 1911
1912 1912
1913/* Return the next or previous window of WINDOW in canonical ordering 1913/* Return the next or previous window of WINDOW in cyclic ordering
1914 of windows. NEXT_P non-zero means return the next window. See the 1914 of windows. NEXT_P non-zero means return the next window. See the
1915 documentation string of next-window for the meaning of MINIBUF and 1915 documentation string of next-window for the meaning of MINIBUF and
1916 ALL_FRAMES. */ 1916 ALL_FRAMES. */
@@ -1982,26 +1982,36 @@ next_window (window, minibuf, all_frames, next_p)
1982 1982
1983 1983
1984DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0, 1984DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0,
1985 doc: /* Return next window after WINDOW in canonical ordering of windows. 1985 doc: /* Return window following WINDOW in cyclic ordering of windows.
1986If omitted, WINDOW defaults to the selected window. 1986WINDOW defaults to the selected window. The optional arguments
1987MINIBUF and ALL-FRAMES specify the set of windows to consider.
1987 1988
1988Optional second arg MINIBUF t means count the minibuffer window even 1989MINIBUF t means consider the minibuffer window even if the
1989if not active. MINIBUF nil or omitted means count the minibuffer iff 1990minibuffer is not active. MINIBUF nil or omitted means consider
1990it is active. MINIBUF neither t nor nil means not to count the 1991the minibuffer window only if the minibuffer is active. Any
1991minibuffer even if it is active. 1992other value means do not consider the minibuffer window even if
1993the minibuffer is active.
1992 1994
1993Several frames may share a single minibuffer; if the minibuffer 1995Several frames may share a single minibuffer; if the minibuffer
1994counts, all windows on all frames that share that minibuffer count 1996is active, all windows on all frames that share that minibuffer
1995too. Therefore, `next-window' can be used to iterate through the 1997are considered too. Therefore, if you are using a separate
1996set of windows even when the minibuffer is on another frame. If the 1998minibuffer frame and the minibuffer is active and MINIBUF says it
1997minibuffer does not count, only windows from WINDOW's frame count. 1999counts, `next-window' considers the windows in the frame from
1998 2000which you entered the minibuffer, as well as the minibuffer
1999Optional third arg ALL-FRAMES t means include windows on all frames. 2001window.
2000ALL-FRAMES nil or omitted means cycle within the frames as specified 2002
2001above. ALL-FRAMES = `visible' means include windows on all visible frames. 2003ALL-FRAMES nil or omitted means consider all windows on WINDOW's
2002ALL-FRAMES = 0 means include windows on all visible and iconified frames. 2004 frame, plus the minibuffer window if specified by the MINIBUF
2003If ALL-FRAMES is a frame, restrict search to windows on that frame. 2005 argument, see above. If the minibuffer counts, consider all
2004Anything else means restrict to WINDOW's frame. 2006 windows on all frames that share that minibuffer too.
2007ALL-FRAMES t means consider all windows on all existing frames.
2008ALL-FRAMES `visible' means consider all windows on all visible
2009 frames.
2010ALL-FRAMES 0 means consider all windows on all visible and
2011 iconified frames.
2012ALL-FRAMES a frame means consider all windows on that frame only.
2013Anything else means consider all windows on WINDOW's frame and no
2014 others.
2005 2015
2006If you use consistent values for MINIBUF and ALL-FRAMES, you can use 2016If you use consistent values for MINIBUF and ALL-FRAMES, you can use
2007`next-window' to iterate through the entire cycle of acceptable 2017`next-window' to iterate through the entire cycle of acceptable
@@ -2015,31 +2025,16 @@ windows, eventually ending up back at the window you started with.
2015 2025
2016 2026
2017DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0, 2027DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0,
2018 doc: /* Return the window preceding WINDOW in canonical ordering of windows. 2028 doc: /* Return window preceding WINDOW in cyclic ordering of windows.
2019If omitted, WINDOW defaults to the selected window. 2029WINDOW defaults to the selected window. The optional arguments
2020 2030MINIBUF and ALL-FRAMES specify the set of windows to consider.
2021Optional second arg MINIBUF t means count the minibuffer window even 2031For the precise meaning of these arguments see `next-window'.
2022if not active. MINIBUF nil or omitted means count the minibuffer iff 2032
2023it is active. MINIBUF neither t nor nil means not to count the 2033If you use consistent values for MINIBUF and ALL-FRAMES, you can
2024minibuffer even if it is active. 2034use `previous-window' to iterate through the entire cycle of
2025 2035acceptable windows, eventually ending up back at the window you
2026Several frames may share a single minibuffer; if the minibuffer 2036started with. `next-window' traverses the same cycle, in the
2027counts, all windows on all frames that share that minibuffer count 2037reverse order. */)
2028too. Therefore, `previous-window' can be used to iterate through
2029the set of windows even when the minibuffer is on another frame. If
2030the minibuffer does not count, only windows from WINDOW's frame count
2031
2032Optional third arg ALL-FRAMES t means include windows on all frames.
2033ALL-FRAMES nil or omitted means cycle within the frames as specified
2034above. ALL-FRAMES = `visible' means include windows on all visible frames.
2035ALL-FRAMES = 0 means include windows on all visible and iconified frames.
2036If ALL-FRAMES is a frame, restrict search to windows on that frame.
2037Anything else means restrict to WINDOW's frame.
2038
2039If you use consistent values for MINIBUF and ALL-FRAMES, you can use
2040`previous-window' to iterate through the entire cycle of acceptable
2041windows, eventually ending up back at the window you started with.
2042`next-window' traverses the same cycle, in the reverse order. */)
2043 (window, minibuf, all_frames) 2038 (window, minibuf, all_frames)
2044 Lisp_Object window, minibuf, all_frames; 2039 Lisp_Object window, minibuf, all_frames;
2045{ 2040{
@@ -2048,21 +2043,28 @@ windows, eventually ending up back at the window you started with.
2048 2043
2049 2044
2050DEFUN ("other-window", Fother_window, Sother_window, 1, 2, "p", 2045DEFUN ("other-window", Fother_window, Sother_window, 1, 2, "p",
2051 doc: /* Select the ARG'th different window on this frame. 2046 doc: /* Select another window in cyclic ordering of windows.
2052All windows on current frame are arranged in a cyclic order. 2047COUNT specifies the number of windows to skip, starting with the
2053This command selects the window ARG steps away in that order. 2048selected window, before making the selection. If COUNT is
2054A negative ARG moves in the opposite order. The optional second 2049positive, skip COUNT windows forwards. If COUNT is negative,
2055argument ALL-FRAMES has the same meaning as in `next-window', which see. */) 2050skip -COUNT windows backwards. COUNT zero means do not skip any
2056 (arg, all_frames) 2051window, so select the selected window. In an interactive call,
2057 Lisp_Object arg, all_frames; 2052COUNT is the numeric prefix argument. Return nil.
2053
2054This function uses `next-window' for finding the window to select.
2055The argument ALL-FRAMES has the same meaning as in `next-window',
2056but the MINIBUF argument of `next-window' is always effectively
2057nil. */)
2058 (count, all_frames)
2059 Lisp_Object count, all_frames;
2058{ 2060{
2059 Lisp_Object window; 2061 Lisp_Object window;
2060 int i; 2062 int i;
2061 2063
2062 CHECK_NUMBER (arg); 2064 CHECK_NUMBER (count);
2063 window = selected_window; 2065 window = selected_window;
2064 2066
2065 for (i = XINT (arg); i > 0; --i) 2067 for (i = XINT (count); i > 0; --i)
2066 window = Fnext_window (window, Qnil, all_frames); 2068 window = Fnext_window (window, Qnil, all_frames);
2067 for (; i < 0; ++i) 2069 for (; i < 0; ++i)
2068 window = Fprevious_window (window, Qnil, all_frames); 2070 window = Fprevious_window (window, Qnil, all_frames);
@@ -2096,7 +2098,7 @@ MINIBUF neither nil nor t means never include the minibuffer window. */)
2096} 2098}
2097 2099
2098 2100
2099/* Return a list of windows in canonical ordering. Arguments are like 2101/* Return a list of windows in cyclic ordering. Arguments are like
2100 for `next-window'. */ 2102 for `next-window'. */
2101 2103
2102static Lisp_Object 2104static Lisp_Object
@@ -3643,7 +3645,8 @@ static Lisp_Object
3643select_window_norecord (window) 3645select_window_norecord (window)
3644 Lisp_Object window; 3646 Lisp_Object window;
3645{ 3647{
3646 return Fselect_window (window, Qt); 3648 return WINDOW_LIVE_P (window)
3649 ? Fselect_window (window, Qt) : selected_window;
3647} 3650}
3648 3651
3649Lisp_Object 3652Lisp_Object