comparison src/window.c @ 83178:a79c4db19c4f

Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-450 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-451 Update from CVS: lisp/subr.el (get-buffer-window-list): Doc fix. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-452 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-453 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-218
author Karoly Lorentey <lorentey@elte.hu>
date Tue, 13 Jul 2004 15:45:15 +0000
parents dbcd0af66869 8eb84bf840a8
children 3864ee1088e9
comparison
equal deleted inserted replaced
83177:91cf385601e5 83178:a79c4db19c4f
393 CHECK_WINDOW (window); 393 CHECK_WINDOW (window);
394 return XWINDOW (window); 394 return XWINDOW (window);
395 } 395 }
396 396
397 DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, 397 DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
398 doc: /* Return the buffer that WINDOW is displaying. */) 398 doc: /* Return the buffer that WINDOW is displaying.
399 WINDOW defaults to the selected window. */)
399 (window) 400 (window)
400 Lisp_Object window; 401 Lisp_Object window;
401 { 402 {
402 return decode_window (window)->buffer; 403 return decode_window (window)->buffer;
403 } 404 }
1747 1748
1748 DEFUN ("other-window", Fother_window, Sother_window, 1, 2, "p", 1749 DEFUN ("other-window", Fother_window, Sother_window, 1, 2, "p",
1749 doc: /* Select the ARG'th different window on this frame. 1750 doc: /* Select the ARG'th different window on this frame.
1750 All windows on current frame are arranged in a cyclic order. 1751 All windows on current frame are arranged in a cyclic order.
1751 This command selects the window ARG steps away in that order. 1752 This command selects the window ARG steps away in that order.
1752 A negative ARG moves in the opposite order. If the optional second 1753 A negative ARG moves in the opposite order. The optional second
1753 argument ALL_FRAMES is non-nil, cycle through all frames. */) 1754 argument ALL_FRAMES has the same meaning as in `next-window', which see. */)
1754 (arg, all_frames) 1755 (arg, all_frames)
1755 Lisp_Object arg, all_frames; 1756 Lisp_Object arg, all_frames;
1756 { 1757 {
1757 Lisp_Object window; 1758 Lisp_Object window;
1758 int i; 1759 int i;
2066 } 2067 }
2067 2068
2068 DEFUN ("get-lru-window", Fget_lru_window, Sget_lru_window, 0, 1, 0, 2069 DEFUN ("get-lru-window", Fget_lru_window, Sget_lru_window, 0, 1, 0,
2069 doc: /* Return the window least recently selected or used for display. 2070 doc: /* Return the window least recently selected or used for display.
2070 Return a full-width window if possible. 2071 Return a full-width window if possible.
2072 A minibuffer window is never a candidate.
2071 If optional argument FRAME is `visible', search all visible frames. 2073 If optional argument FRAME is `visible', search all visible frames.
2072 If FRAME is 0, search all visible and iconified frames. 2074 If FRAME is 0, search all visible and iconified frames.
2073 If FRAME is t, search all frames. 2075 If FRAME is t, search all frames.
2074 If FRAME is nil, search only the selected frame. 2076 If FRAME is nil, search only the selected frame.
2075 If FRAME is a frame, search only that frame. */) 2077 If FRAME is a frame, search only that frame. */)
2085 return window_loop (GET_LRU_WINDOW, Qnil, 0, frame); 2087 return window_loop (GET_LRU_WINDOW, Qnil, 0, frame);
2086 } 2088 }
2087 2089
2088 DEFUN ("get-largest-window", Fget_largest_window, Sget_largest_window, 0, 1, 0, 2090 DEFUN ("get-largest-window", Fget_largest_window, Sget_largest_window, 0, 1, 0,
2089 doc: /* Return the largest window in area. 2091 doc: /* Return the largest window in area.
2092 A minibuffer window is never a candidate.
2090 If optional argument FRAME is `visible', search all visible frames. 2093 If optional argument FRAME is `visible', search all visible frames.
2091 If FRAME is 0, search all visible and iconified frames. 2094 If FRAME is 0, search all visible and iconified frames.
2092 If FRAME is t, search all frames. 2095 If FRAME is t, search all frames.
2093 If FRAME is nil, search only the selected frame. 2096 If FRAME is nil, search only the selected frame.
2094 If FRAME is a frame, search only that frame. */) 2097 If FRAME is a frame, search only that frame. */)
2099 frame); 2102 frame);
2100 } 2103 }
2101 2104
2102 DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 1, 2, 0, 2105 DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 1, 2, 0,
2103 doc: /* Return a window currently displaying BUFFER, or nil if none. 2106 doc: /* Return a window currently displaying BUFFER, or nil if none.
2107 BUFFER can be a buffer or a buffer name.
2104 If optional argument FRAME is `visible', search all visible frames. 2108 If optional argument FRAME is `visible', search all visible frames.
2105 If optional argument FRAME is 0, search all visible and iconified frames. 2109 If optional argument FRAME is 0, search all visible and iconified frames.
2106 If FRAME is t, search all frames. 2110 If FRAME is t, search all frames.
2107 If FRAME is nil, search only the selected frame. 2111 If FRAME is nil, search only the selected frame.
2108 If FRAME is a frame, search only that frame. */) 2112 If FRAME is a frame, search only that frame. */)
2181 } 2185 }
2182 2186
2183 DEFUN ("delete-windows-on", Fdelete_windows_on, Sdelete_windows_on, 2187 DEFUN ("delete-windows-on", Fdelete_windows_on, Sdelete_windows_on,
2184 1, 2, "bDelete windows on (buffer): ", 2188 1, 2, "bDelete windows on (buffer): ",
2185 doc: /* Delete all windows showing BUFFER. 2189 doc: /* Delete all windows showing BUFFER.
2190 BUFFER must be a buffer or the name of an existing buffer.
2186 Optional second argument FRAME controls which frames are affected. 2191 Optional second argument FRAME controls which frames are affected.
2187 If optional argument FRAME is `visible', search all visible frames. 2192 If optional argument FRAME is `visible', search all visible frames.
2188 If FRAME is 0, search all visible and iconified frames. 2193 If FRAME is 0, search all visible and iconified frames.
2189 If FRAME is nil, search all frames. 2194 If FRAME is nil, search all frames.
2190 If FRAME is t, search only the selected frame. 2195 If FRAME is t, search only the selected frame.
2210 } 2215 }
2211 2216
2212 DEFUN ("replace-buffer-in-windows", Freplace_buffer_in_windows, 2217 DEFUN ("replace-buffer-in-windows", Freplace_buffer_in_windows,
2213 Sreplace_buffer_in_windows, 2218 Sreplace_buffer_in_windows,
2214 1, 1, "bReplace buffer in windows: ", 2219 1, 1, "bReplace buffer in windows: ",
2215 doc: /* Replace BUFFER with some other buffer in all windows showing it. */) 2220 doc: /* Replace BUFFER with some other buffer in all windows showing it.
2221 BUFFER may be a buffer or the name of an existing buffer. */)
2216 (buffer) 2222 (buffer)
2217 Lisp_Object buffer; 2223 Lisp_Object buffer;
2218 { 2224 {
2219 if (!NILP (buffer)) 2225 if (!NILP (buffer))
2220 { 2226 {
3022 } 3028 }
3023 3029
3024 3030
3025 DEFUN ("set-window-buffer", Fset_window_buffer, Sset_window_buffer, 2, 3, 0, 3031 DEFUN ("set-window-buffer", Fset_window_buffer, Sset_window_buffer, 2, 3, 0,
3026 doc: /* Make WINDOW display BUFFER as its contents. 3032 doc: /* Make WINDOW display BUFFER as its contents.
3027 BUFFER can be a buffer or buffer name. 3033 BUFFER can be a buffer or the name of an existing buffer.
3028 Optional third arg KEEP-MARGINS non-nil means that WINDOW's current 3034 Optional third arg KEEP-MARGINS non-nil means that WINDOW's current
3029 display margins, fringe widths, and scroll bar settings are maintained; 3035 display margins, fringe widths, and scroll bar settings are maintained;
3030 the default is to reset these from BUFFER's local settings or the frame 3036 the default is to reset these from BUFFER's local settings or the frame
3031 defaults. */) 3037 defaults. */)
3032 (window, buffer, keep_margins) 3038 (window, buffer, keep_margins)
3063 when this is called from Fset_window_configuration. */ 3069 when this is called from Fset_window_configuration. */
3064 3070
3065 DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, 3071 DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0,
3066 doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. 3072 doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer.
3067 If WINDOW is not already selected, make WINDOW's buffer current 3073 If WINDOW is not already selected, make WINDOW's buffer current
3068 and make WINDOW the frame's selected window. 3074 and make WINDOW the frame's selected window. Return WINDOW.
3069 Optional second arg NORECORD non-nil means 3075 Optional second arg NORECORD non-nil means
3070 do not put this buffer at the front of the list of recently selected ones. 3076 do not put this buffer at the front of the list of recently selected ones.
3071 3077
3072 Note that the main editor command loop 3078 Note that the main editor command loop
3073 selects the buffer of the selected window before each command. */) 3079 selects the buffer of the selected window before each command. */)
3247 3253
3248 /* Use B so the default is (other-buffer). */ 3254 /* Use B so the default is (other-buffer). */
3249 DEFUN ("display-buffer", Fdisplay_buffer, Sdisplay_buffer, 1, 3, 3255 DEFUN ("display-buffer", Fdisplay_buffer, Sdisplay_buffer, 1, 3,
3250 "BDisplay buffer: \nP", 3256 "BDisplay buffer: \nP",
3251 doc: /* Make BUFFER appear in some window but don't select it. 3257 doc: /* Make BUFFER appear in some window but don't select it.
3252 BUFFER can be a buffer or a buffer name. 3258 BUFFER must be the name of an existing buffer, or, when called from Lisp,
3259 a buffer.
3253 If BUFFER is shown already in some window, just use that one, 3260 If BUFFER is shown already in some window, just use that one,
3254 unless the window is the selected window and the optional second 3261 unless the window is the selected window and the optional second
3255 argument NOT-THIS-WINDOW is non-nil (interactively, with prefix arg). 3262 argument NOT-THIS-WINDOW is non-nil (interactively, with prefix arg).
3256 If `pop-up-frames' is non-nil, make a new frame if no window shows BUFFER. 3263 If `pop-up-frames' is non-nil, make a new frame if no window shows BUFFER.
3257 Returns the window displaying BUFFER. 3264 Returns the window displaying BUFFER.
3590 doc: /* Split WINDOW, putting SIZE lines in the first of the pair. 3597 doc: /* Split WINDOW, putting SIZE lines in the first of the pair.
3591 WINDOW defaults to selected one and SIZE to half its size. 3598 WINDOW defaults to selected one and SIZE to half its size.
3592 If optional third arg HORFLAG is non-nil, split side by side 3599 If optional third arg HORFLAG is non-nil, split side by side
3593 and put SIZE columns in the first of the pair. In that case, 3600 and put SIZE columns in the first of the pair. In that case,
3594 SIZE includes that window's scroll bar, or the divider column to its right. 3601 SIZE includes that window's scroll bar, or the divider column to its right.
3595 Returns the newly-created window. */) 3602 Interactively, all arguments are nil.
3603
3604 Returns the newly created window (which is the lower or rightmost one).
3605 The upper or leftmost window is the original one and remains selected.
3606 See Info node `(elisp)Splitting Windows' for more details and examples.*/)
3596 (window, size, horflag) 3607 (window, size, horflag)
3597 Lisp_Object window, size, horflag; 3608 Lisp_Object window, size, horflag;
3598 { 3609 {
3599 register Lisp_Object new; 3610 register Lisp_Object new;
3600 register struct window *o, *p; 3611 register struct window *o, *p;
6455 Vtemp_buffer_show_function = Qnil; 6466 Vtemp_buffer_show_function = Qnil;
6456 6467
6457 DEFVAR_LISP ("display-buffer-function", &Vdisplay_buffer_function, 6468 DEFVAR_LISP ("display-buffer-function", &Vdisplay_buffer_function,
6458 doc: /* If non-nil, function to call to handle `display-buffer'. 6469 doc: /* If non-nil, function to call to handle `display-buffer'.
6459 It will receive two args, the buffer and a flag which if non-nil means 6470 It will receive two args, the buffer and a flag which if non-nil means
6460 that the currently selected window is not acceptable. 6471 that the currently selected window is not acceptable.
6472 It should choose or create a window, display the specified buffer in it,
6473 and return the window.
6461 Commands such as `switch-to-buffer-other-window' and `find-file-other-window' 6474 Commands such as `switch-to-buffer-other-window' and `find-file-other-window'
6462 work using this function. */); 6475 work using this function. */);
6463 Vdisplay_buffer_function = Qnil; 6476 Vdisplay_buffer_function = Qnil;
6464 6477
6465 DEFVAR_LISP ("even-window-heights", &Veven_window_heights, 6478 DEFVAR_LISP ("even-window-heights", &Veven_window_heights,