diff options
| author | Martin Rudalics | 2008-10-31 14:06:33 +0000 |
|---|---|---|
| committer | Martin Rudalics | 2008-10-31 14:06:33 +0000 |
| commit | ab6d1131b48de3491ef1fb3e0ac2753ed89cbe2b (patch) | |
| tree | 60430edd7af4a231d182c3a16369e9f189ebdd0d /src/window.c | |
| parent | 5c17a891263f4afe1c2e2489cde9262fa073b543 (diff) | |
| download | emacs-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.c | 111 |
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 | ||
| 1984 | DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0, | 1984 | DEFUN ("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. |
| 1986 | If omitted, WINDOW defaults to the selected window. | 1986 | WINDOW defaults to the selected window. The optional arguments |
| 1987 | MINIBUF and ALL-FRAMES specify the set of windows to consider. | ||
| 1987 | 1988 | ||
| 1988 | Optional second arg MINIBUF t means count the minibuffer window even | 1989 | MINIBUF t means consider the minibuffer window even if the |
| 1989 | if not active. MINIBUF nil or omitted means count the minibuffer iff | 1990 | minibuffer is not active. MINIBUF nil or omitted means consider |
| 1990 | it is active. MINIBUF neither t nor nil means not to count the | 1991 | the minibuffer window only if the minibuffer is active. Any |
| 1991 | minibuffer even if it is active. | 1992 | other value means do not consider the minibuffer window even if |
| 1993 | the minibuffer is active. | ||
| 1992 | 1994 | ||
| 1993 | Several frames may share a single minibuffer; if the minibuffer | 1995 | Several frames may share a single minibuffer; if the minibuffer |
| 1994 | counts, all windows on all frames that share that minibuffer count | 1996 | is active, all windows on all frames that share that minibuffer |
| 1995 | too. Therefore, `next-window' can be used to iterate through the | 1997 | are considered too. Therefore, if you are using a separate |
| 1996 | set of windows even when the minibuffer is on another frame. If the | 1998 | minibuffer frame and the minibuffer is active and MINIBUF says it |
| 1997 | minibuffer does not count, only windows from WINDOW's frame count. | 1999 | counts, `next-window' considers the windows in the frame from |
| 1998 | 2000 | which you entered the minibuffer, as well as the minibuffer | |
| 1999 | Optional third arg ALL-FRAMES t means include windows on all frames. | 2001 | window. |
| 2000 | ALL-FRAMES nil or omitted means cycle within the frames as specified | 2002 | |
| 2001 | above. ALL-FRAMES = `visible' means include windows on all visible frames. | 2003 | ALL-FRAMES nil or omitted means consider all windows on WINDOW's |
| 2002 | ALL-FRAMES = 0 means include windows on all visible and iconified frames. | 2004 | frame, plus the minibuffer window if specified by the MINIBUF |
| 2003 | If ALL-FRAMES is a frame, restrict search to windows on that frame. | 2005 | argument, see above. If the minibuffer counts, consider all |
| 2004 | Anything else means restrict to WINDOW's frame. | 2006 | windows on all frames that share that minibuffer too. |
| 2007 | ALL-FRAMES t means consider all windows on all existing frames. | ||
| 2008 | ALL-FRAMES `visible' means consider all windows on all visible | ||
| 2009 | frames. | ||
| 2010 | ALL-FRAMES 0 means consider all windows on all visible and | ||
| 2011 | iconified frames. | ||
| 2012 | ALL-FRAMES a frame means consider all windows on that frame only. | ||
| 2013 | Anything else means consider all windows on WINDOW's frame and no | ||
| 2014 | others. | ||
| 2005 | 2015 | ||
| 2006 | If you use consistent values for MINIBUF and ALL-FRAMES, you can use | 2016 | If 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 | ||
| 2017 | DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0, | 2027 | DEFUN ("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. |
| 2019 | If omitted, WINDOW defaults to the selected window. | 2029 | WINDOW defaults to the selected window. The optional arguments |
| 2020 | 2030 | MINIBUF and ALL-FRAMES specify the set of windows to consider. | |
| 2021 | Optional second arg MINIBUF t means count the minibuffer window even | 2031 | For the precise meaning of these arguments see `next-window'. |
| 2022 | if not active. MINIBUF nil or omitted means count the minibuffer iff | 2032 | |
| 2023 | it is active. MINIBUF neither t nor nil means not to count the | 2033 | If you use consistent values for MINIBUF and ALL-FRAMES, you can |
| 2024 | minibuffer even if it is active. | 2034 | use `previous-window' to iterate through the entire cycle of |
| 2025 | 2035 | acceptable windows, eventually ending up back at the window you | |
| 2026 | Several frames may share a single minibuffer; if the minibuffer | 2036 | started with. `next-window' traverses the same cycle, in the |
| 2027 | counts, all windows on all frames that share that minibuffer count | 2037 | reverse order. */) |
| 2028 | too. Therefore, `previous-window' can be used to iterate through | ||
| 2029 | the set of windows even when the minibuffer is on another frame. If | ||
| 2030 | the minibuffer does not count, only windows from WINDOW's frame count | ||
| 2031 | |||
| 2032 | Optional third arg ALL-FRAMES t means include windows on all frames. | ||
| 2033 | ALL-FRAMES nil or omitted means cycle within the frames as specified | ||
| 2034 | above. ALL-FRAMES = `visible' means include windows on all visible frames. | ||
| 2035 | ALL-FRAMES = 0 means include windows on all visible and iconified frames. | ||
| 2036 | If ALL-FRAMES is a frame, restrict search to windows on that frame. | ||
| 2037 | Anything else means restrict to WINDOW's frame. | ||
| 2038 | |||
| 2039 | If you use consistent values for MINIBUF and ALL-FRAMES, you can use | ||
| 2040 | `previous-window' to iterate through the entire cycle of acceptable | ||
| 2041 | windows, 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 | ||
| 2050 | DEFUN ("other-window", Fother_window, Sother_window, 1, 2, "p", | 2045 | DEFUN ("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. |
| 2052 | All windows on current frame are arranged in a cyclic order. | 2047 | COUNT specifies the number of windows to skip, starting with the |
| 2053 | This command selects the window ARG steps away in that order. | 2048 | selected window, before making the selection. If COUNT is |
| 2054 | A negative ARG moves in the opposite order. The optional second | 2049 | positive, skip COUNT windows forwards. If COUNT is negative, |
| 2055 | argument ALL-FRAMES has the same meaning as in `next-window', which see. */) | 2050 | skip -COUNT windows backwards. COUNT zero means do not skip any |
| 2056 | (arg, all_frames) | 2051 | window, so select the selected window. In an interactive call, |
| 2057 | Lisp_Object arg, all_frames; | 2052 | COUNT is the numeric prefix argument. Return nil. |
| 2053 | |||
| 2054 | This function uses `next-window' for finding the window to select. | ||
| 2055 | The argument ALL-FRAMES has the same meaning as in `next-window', | ||
| 2056 | but the MINIBUF argument of `next-window' is always effectively | ||
| 2057 | nil. */) | ||
| 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 | ||
| 2102 | static Lisp_Object | 2104 | static Lisp_Object |
| @@ -3643,7 +3645,8 @@ static Lisp_Object | |||
| 3643 | select_window_norecord (window) | 3645 | select_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 | ||
| 3649 | Lisp_Object | 3652 | Lisp_Object |