158 |
window @var{window} remains the selected window, but occupies only |
window @var{window} remains the selected window, but occupies only |
159 |
part of its former screen area. The rest is occupied by a newly created |
part of its former screen area. The rest is occupied by a newly created |
160 |
window which is returned as the value of this function. |
window which is returned as the value of this function. |
|
This function returns the newly created window. |
|
161 |
|
|
162 |
If @var{horizontal} is non-@code{nil}, then @var{window} splits into |
If @var{horizontal} is non-@code{nil}, then @var{window} splits into |
163 |
two side by side windows. The original window @var{window} keeps the |
two side by side windows. The original window @var{window} keeps the |
271 |
other, leaving the upper of the two windows selected, with @var{size} |
other, leaving the upper of the two windows selected, with @var{size} |
272 |
lines. (If @var{size} is negative, then the lower of the two windows |
lines. (If @var{size} is negative, then the lower of the two windows |
273 |
gets @minus{} @var{size} lines and the upper window gets the rest, but |
gets @minus{} @var{size} lines and the upper window gets the rest, but |
274 |
the upper window is still the one selected.) |
the upper window is still the one selected.) However, if |
275 |
@end deffn |
@code{split-window-keep-point} (see below) is @code{nil}, then either |
276 |
|
window can be selected. |
277 |
|
|
278 |
|
In other respects, this function is similar to @code{split-window}. |
279 |
|
In particular, the upper window is the original one and the return |
280 |
|
value is the new, lower window. |
281 |
|
@end deffn |
282 |
|
|
283 |
|
@defopt split-window-keep-point |
284 |
|
If this variable is non-@code{nil} (the default), then |
285 |
|
@code{split-window-vertically} behaves as described above. |
286 |
|
|
287 |
|
If it is @code{nil}, then @code{split-window-vertically} adjusts point |
288 |
|
in each of the two windows to avoid scrolling. (This is useful on |
289 |
|
slow terminals.) It selects whichever window contains the screen line |
290 |
|
that point was previously on. |
291 |
|
|
292 |
|
This variable only affects the behavior of @code{split-window-vertically}. |
293 |
|
It has no effect on the other functions described here. |
294 |
|
@end defopt |
295 |
|
|
296 |
@deffn Command split-window-horizontally &optional size |
@deffn Command split-window-horizontally &optional size |
297 |
This function splits the selected window into two windows |
This function splits the selected window into two windows |
298 |
side-by-side, leaving the selected window with @var{size} columns. |
side-by-side, leaving the selected window on the left with @var{size} |
299 |
|
columns. If @var{size} is negative, the rightmost window gets |
300 |
|
@minus{} @var{size} columns, but the leftmost window still remains |
301 |
|
selected. |
302 |
|
|
303 |
This function is basically an interface to @code{split-window}. |
This function is basically an interface to @code{split-window}. |
304 |
You could define a simplified version of the function like this: |
You could define a simplified version of the function like this: |
385 |
The return value is @code{nil}. |
The return value is @code{nil}. |
386 |
@end deffn |
@end deffn |
387 |
|
|
388 |
@deffn Command delete-windows-on buffer &optional frame |
@deffn Command delete-windows-on buffer-or-name &optional frame |
389 |
This function deletes all windows showing @var{buffer}. If there are |
This function deletes all windows showing @var{buffer-or-name}. If |
390 |
no windows showing @var{buffer}, it does nothing. |
there are no windows showing @var{buffer-or-name}, it does nothing. |
391 |
|
@var{buffer-or-name} must be a buffer or the name of an existing |
392 |
|
buffer. |
393 |
|
|
394 |
@code{delete-windows-on} operates frame by frame. If a frame has |
@code{delete-windows-on} operates frame by frame. If a frame has |
395 |
several windows showing different buffers, then those showing |
several windows showing different buffers, then those showing |
396 |
@var{buffer} are removed, and the others expand to fill the space. If |
@var{buffer-or-name} are removed, and the others expand to fill the |
397 |
all windows in some frame are showing @var{buffer} (including the case |
space. If all windows in some frame are showing @var{buffer-or-name} |
398 |
where there is only one window), then the frame reverts to having a |
(including the case where there is only one window), then the frame |
399 |
single window showing another buffer chosen with @code{other-buffer}. |
winds up with a single window showing another buffer chosen with |
400 |
@xref{The Buffer List}. |
@code{other-buffer}. @xref{The Buffer List}. |
401 |
|
|
402 |
The argument @var{frame} controls which frames to operate on. This |
The argument @var{frame} controls which frames to operate on. This |
403 |
function does not use it in quite the same way as the other functions |
function does not use it in quite the same way as the other functions |
435 |
|
|
436 |
@defun select-window window &optional norecord |
@defun select-window window &optional norecord |
437 |
This function makes @var{window} the selected window. The cursor then |
This function makes @var{window} the selected window. The cursor then |
438 |
appears in @var{window} (on redisplay). The buffer being displayed in |
appears in @var{window} (on redisplay). Unless @var{window} was |
439 |
@var{window} is immediately designated the current buffer. |
already selected, @code{select-window} makes @var{window}'s buffer the |
440 |
|
current buffer. |
441 |
|
|
442 |
Normally @var{window}'s selected buffer is moved to the front of the |
Normally @var{window}'s selected buffer is moved to the front of the |
443 |
buffer list, but if @var{norecord} is non-@code{nil}, the buffer list |
buffer list, but if @var{norecord} is non-@code{nil}, the buffer list |
455 |
@end defun |
@end defun |
456 |
|
|
457 |
@defmac save-selected-window forms@dots{} |
@defmac save-selected-window forms@dots{} |
458 |
This macro records the selected window of each frame, executes |
This macro records the selected window, as well as the selected window |
459 |
@var{forms} in sequence, then restores the earlier selected windows. |
of each frame, executes @var{forms} in sequence, then restores the |
460 |
|
earlier selected windows. It returns the value of the last form in |
461 |
|
@var{forms}. |
462 |
|
|
463 |
This macro does not save or restore anything about the sizes, |
This macro does not save or restore anything about the sizes, |
464 |
arrangement or contents of windows; therefore, if the @var{forms} |
arrangement or contents of windows; therefore, if the @var{forms} |
465 |
change them, the change persists. If the previously selected window |
change them, the change persists. If the previously selected window |
466 |
of some frame is no longer live at the time of exit from this form, |
of some frame is no longer live at the time of exit from @var{forms}, |
467 |
that frame's selected window is left alone. |
that frame's selected window is left alone. If the previously |
468 |
|
selected window is no longer live, then whatever window is selected at |
469 |
|
the end of @var{forms} remains selected. |
470 |
@end defmac |
@end defmac |
471 |
|
|
472 |
@defmac with-selected-window window forms@dots{} |
@defmac with-selected-window window forms@dots{} |
474 |
executes @var{forms} in sequence, then restores the previously |
executes @var{forms} in sequence, then restores the previously |
475 |
selected window (unless that window is no longer alive). It is similar |
selected window (unless that window is no longer alive). It is similar |
476 |
to @code{save-selected-window} except that it explicitly selects |
to @code{save-selected-window} except that it explicitly selects |
477 |
@var{window} and that it does not alter the buffer list sequence. |
@var{window}, without altering the buffer list sequence. |
478 |
@end defmac |
@end defmac |
479 |
|
|
480 |
@cindex finding windows |
@cindex finding windows |
584 |
@table @asis |
@table @asis |
585 |
@item @code{nil} |
@item @code{nil} |
586 |
Consider all the windows in @var{window}'s frame, plus the minibuffer |
Consider all the windows in @var{window}'s frame, plus the minibuffer |
587 |
used by that frame even if it lies in some other frame. |
used by that frame even if it lies in some other frame. If the |
588 |
|
minibuffer counts (as determined by @var{minibuf}), then all windows on |
589 |
|
all frames that share that minibuffer count too. |
590 |
|
|
591 |
@item @code{t} |
@item @code{t} |
592 |
Consider all windows in all existing frames. |
Consider all windows in all existing frames. |
688 |
|
|
689 |
@defun set-window-buffer window buffer-or-name &optional keep-margins |
@defun set-window-buffer window buffer-or-name &optional keep-margins |
690 |
This function makes @var{window} display @var{buffer-or-name} as its |
This function makes @var{window} display @var{buffer-or-name} as its |
691 |
contents. It returns @code{nil}. This is the fundamental primitive |
contents. It returns @code{nil}. @var{buffer-or-name} must be a |
692 |
for changing which buffer is displayed in a window, and all ways |
buffer, or the name of an existing buffer. This is the fundamental |
693 |
of doing that call this function. |
primitive for changing which buffer is displayed in a window, and all |
694 |
|
ways of doing that call this function. |
695 |
|
|
696 |
@example |
@example |
697 |
@group |
@group |
801 |
If @var{buffer-or-name} does not identify an existing buffer, then a new |
If @var{buffer-or-name} does not identify an existing buffer, then a new |
802 |
buffer by that name is created. The major mode for the new buffer is |
buffer by that name is created. The major mode for the new buffer is |
803 |
set according to the variable @code{default-major-mode}. @xref{Auto |
set according to the variable @code{default-major-mode}. @xref{Auto |
804 |
Major Mode}. |
Major Mode}. If @var{buffer-or-name} is @code{nil}, |
805 |
|
@code{switch-to-buffer} chooses a buffer using @code{other-buffer}. |
806 |
|
|
807 |
Normally the specified buffer is put at the front of the buffer list |
Normally the specified buffer is put at the front of the buffer list |
808 |
(both the selected frame's buffer list and the frame-independent buffer |
(both the selected frame's buffer list and the frame-independent buffer |
815 |
returns the buffer that it switched to. |
returns the buffer that it switched to. |
816 |
@end deffn |
@end deffn |
817 |
|
|
818 |
|
The next two functions are similar to @code{switch-to-buffer}, except |
819 |
|
for the described features. |
820 |
|
|
821 |
@deffn Command switch-to-buffer-other-window buffer-or-name &optional norecord |
@deffn Command switch-to-buffer-other-window buffer-or-name &optional norecord |
822 |
This function makes @var{buffer-or-name} the current buffer and |
This function makes @var{buffer-or-name} the current buffer and |
823 |
displays it in a window not currently selected. It then selects that |
displays it in a window not currently selected. It then selects that |
877 |
unless @var{norecord} is non-@code{nil}. |
unless @var{norecord} is non-@code{nil}. |
878 |
@end defun |
@end defun |
879 |
|
|
880 |
@deffn Command replace-buffer-in-windows buffer |
@deffn Command replace-buffer-in-windows buffer-or-name |
881 |
This function replaces @var{buffer} with some other buffer in all |
This function replaces @var{buffer-or-name} with some other buffer in all |
882 |
windows displaying it. The other buffer used is chosen with |
windows displaying it. It chooses the other buffer with |
883 |
@code{other-buffer}. In the usual applications of this function, you |
@code{other-buffer}. In the usual applications of this function, you |
884 |
don't care which other buffer is used; you just want to make sure that |
don't care which other buffer is used; you just want to make sure that |
885 |
@var{buffer} is no longer displayed. |
@var{buffer-or-name} is no longer displayed. |
886 |
|
|
887 |
This function returns @code{nil}. |
This function returns @code{nil}. |
888 |
@end deffn |
@end deffn |
899 |
This command makes @var{buffer-or-name} appear in some window, like |
This command makes @var{buffer-or-name} appear in some window, like |
900 |
@code{pop-to-buffer}, but it does not select that window and does not |
@code{pop-to-buffer}, but it does not select that window and does not |
901 |
make the buffer current. The identity of the selected window is |
make the buffer current. The identity of the selected window is |
902 |
unaltered by this function. |
unaltered by this function. @var{buffer-or-name} must be a buffer, or |
903 |
|
the name of an existing buffer. |
904 |
|
|
905 |
If @var{not-this-window} is non-@code{nil}, it means to display the |
If @var{not-this-window} is non-@code{nil}, it means to display the |
906 |
specified buffer in a window other than the selected one, even if it is |
specified buffer in a window other than the selected one, even if it is |
921 |
@itemize @bullet |
@itemize @bullet |
922 |
@item |
@item |
923 |
If it is @code{nil}, consider windows on the selected frame. |
If it is @code{nil}, consider windows on the selected frame. |
924 |
|
(Actually, the last non-minibuffer frame.) |
925 |
@item |
@item |
926 |
If it is @code{t}, consider windows on all frames. |
If it is @code{t}, consider windows on all frames. |
927 |
@item |
@item |
1054 |
This function returns non-@code{nil} if displaying a buffer |
This function returns non-@code{nil} if displaying a buffer |
1055 |
named @var{buffer-name} with @code{display-buffer} would |
named @var{buffer-name} with @code{display-buffer} would |
1056 |
create a special frame. The value is @code{t} if it would |
create a special frame. The value is @code{t} if it would |
1057 |
use the default frame paramaters, or else the specified list |
use the default frame parameters, or else the specified list |
1058 |
of frame parameters. |
of frame parameters. |
1059 |
@end defun |
@end defun |
1060 |
|
|
1067 |
@code{special-display-popup-frame}. |
@code{special-display-popup-frame}. |
1068 |
@end defvar |
@end defvar |
1069 |
|
|
1070 |
@defun special-display-popup-frame buffer &rest args |
@defun special-display-popup-frame buffer &optional args |
1071 |
This function makes @var{buffer} visible in a frame of its own. If |
This function makes @var{buffer} visible in a frame of its own. If |
1072 |
@var{buffer} is already displayed in a window in some frame, it makes |
@var{buffer} is already displayed in a window in some frame, it makes |
1073 |
the frame visible and raises it, to use that window. Otherwise, it |
the frame visible and raises it, to use that window. Otherwise, it |
1074 |
creates a frame that will be dedicated to @var{buffer}. |
creates a frame that will be dedicated to @var{buffer}. This |
1075 |
|
function returns the window it used. |
1076 |
|
|
1077 |
If @var{args} is an alist, it specifies frame parameters for the new |
If @var{args} is an alist, it specifies frame parameters for the new |
1078 |
frame. |
frame. |
1118 |
This variable is the most flexible way to customize the behavior of |
This variable is the most flexible way to customize the behavior of |
1119 |
@code{display-buffer}. If it is non-@code{nil}, it should be a function |
@code{display-buffer}. If it is non-@code{nil}, it should be a function |
1120 |
that @code{display-buffer} calls to do the work. The function should |
that @code{display-buffer} calls to do the work. The function should |
1121 |
accept two arguments, the same two arguments that @code{display-buffer} |
accept two arguments, the first two arguments that @code{display-buffer} |
1122 |
received. It should choose or create a window, display the specified |
received. It should choose or create a window, display the specified |
1123 |
buffer, and then return the window. |
buffer in it, and then return the window. |
1124 |
|
|
1125 |
This hook takes precedence over all the other options and hooks |
This hook takes precedence over all the other options and hooks |
1126 |
described above. |
described above. |