aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-11-08 23:34:21 +0800
committerChong Yidong2011-11-08 23:34:21 +0800
commite7313f338961e383f1f27bfa3d6083814d0d09ab (patch)
treecbfeea8f75a206846d8fcd599670510afa04e1be
parentfcbcac2e86dbc2069c97d5309937d17cb40d4573 (diff)
downloademacs-e7313f338961e383f1f27bfa3d6083814d0d09ab.tar.gz
emacs-e7313f338961e383f1f27bfa3d6083814d0d09ab.zip
* doc/lispref/windows.texi (Resizing Windows): Simplify introduction.
Don't document enlarge-window, shrink-window, enlarge-window-horizontally, and shrink-window-horizontally; they are no longer preferred for calling from Lisp, and are already documented in the Emacs manual.
-rw-r--r--doc/lispref/ChangeLog4
-rw-r--r--doc/lispref/windows.texi204
2 files changed, 74 insertions, 134 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 47214596c1a..7a1e34de159 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -4,6 +4,10 @@
4 window-text-height. Remove window-min-height and window-min-width 4 window-text-height. Remove window-min-height and window-min-width
5 discussion, referring instead to Emacs manual. 5 discussion, referring instead to Emacs manual.
6 (Splitting Windows, Resizing Windows): Add xref to Emacs manual. 6 (Splitting Windows, Resizing Windows): Add xref to Emacs manual.
7 (Resizing Windows): Simplify introduction. Don't document
8 enlarge-window, shrink-window, enlarge-window-horizontally, and
9 shrink-window-horizontally; they are no longer preferred for
10 calling from Lisp, and are already documented in the Emacs manual.
7 11
82011-11-07 Glenn Morris <rgm@gnu.org> 122011-11-07 Glenn Morris <rgm@gnu.org>
9 13
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 2bb30dd4cbc..46ed4476036 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -274,7 +274,7 @@ the leftmost child window for a horizontal combination. If
274@defun window-combined-p &optional window horizontal 274@defun window-combined-p &optional window horizontal
275This function returns a non-@code{nil} value if and only if 275This function returns a non-@code{nil} value if and only if
276@var{window} is part of a vertical combination. If @var{window} is 276@var{window} is part of a vertical combination. If @var{window} is
277omitted or nil, it defaults to the selected one. 277omitted or @code{nil}, it defaults to the selected one.
278 278
279If the optional argument @var{horizontal} is non-@code{nil}, this 279If the optional argument @var{horizontal} is non-@code{nil}, this
280means to return non-@code{nil} if and only if @var{window} is part of 280means to return non-@code{nil} if and only if @var{window} is part of
@@ -542,138 +542,74 @@ function @code{window-resizable}. @xref{Resizing Windows}.
542@cindex changing window size 542@cindex changing window size
543@cindex window size, changing 543@cindex window size, changing
544 544
545Emacs does not permit overlapping windows or gaps between windows, so 545 This section describes functions for resizing a window without
546changing the size of a window always affects at least one other window. 546changing the size of its frame. Because live windows do not overlap,
547When a frame contains just one window, that window can be resized only 547these functions are meaningful only on frames that contain two or more
548by resizing the window's frame. The functions described below are 548windows: resizing a window also changes the size of a neighboring
549therefore meaningful only in the context of a frame containing at least 549window. If there is just one window on a frame, its size cannot be
550two windows. The size of the corresponding frame never changes when 550changed except by resizing the frame (@pxref{Size and Position}).
551invoking a function described in this section. 551
552 552 Except where noted, these functions also accept internal windows as
553 The routines changing window sizes always operate in one dimension at 553arguments. Resizing an internal window causes its child windows to be
554a time. This means that windows can be resized only either vertically 554resized to fit the same space.
555or horizontally. If a window shall be resized in both dimensions, it
556must be resized in one dimension first and in the other dimension
557afterwards. If the second resize operation fails, the frame might end
558up in an unsatisfactory state. To avoid such states, it might be useful
559to save the current window configuration (@pxref{Window Configurations})
560before attempting the first resize operation and restore the saved
561configuration in case the second resize operation fails.
562
563 Functions that resize windows are supposed to obey restrictions
564imposed by window minimum sizes and fixed-size windows, see @ref{Window
565Sizes}. In order to determine whether resizing a specific window is
566possible in the first place, the following function can be used:
567 555
568@defun window-resizable window delta &optional horizontal ignore side noup nodown 556@defun window-resizable window delta &optional horizontal ignore side noup nodown
569This function returns @var{delta} if the size of @var{window} can be 557This function returns @var{delta} if the size of @var{window} can be
570changed vertically by @var{delta} lines. Optional argument 558changed vertically by @var{delta} lines. If the optional argument
571@var{horizontal} non-@code{nil} means to return @var{delta} if 559@var{horizontal} is non-@code{nil}, it instead returns @var{delta} if
572@var{window} can be resized horizontally by @var{delta} columns. A 560@var{window} can be resized horizontally by @var{delta} columns. It
573return value of zero means that @var{window} is not resizable. 561does not actually change the window size.
574 562
575If @var{delta} is a positive number, this means that @var{window} shall 563If @var{window} is @code{nil}, it defaults to the selected window.
576be enlarged by @var{delta} lines or columns. If @var{window} cannot be 564
577enlarged by @var{delta} lines or columns, this function returns the 565A positive value of @var{delta} enlarges the window by that number of
578maximum value in the range from 0 to @var{delta} by which @var{window} 566lines or columns; a negative value of @var{delta} shrinks it. If
579can be enlarged. 567@var{delta} is non-zero, a return value of 0 means that the window
580 568cannot be resized.
581If @var{delta} is a negative number, this means that @var{window} shall 569
582be shrunk by -@var{delta} lines or columns. If @var{window} cannot be 570Normally, the variables @code{window-min-height} and
583shrunk by -@var{delta} lines or columns, this function returns the 571@code{window-min-width} specify the smallest allowable window size.
584minimum value in the range from @var{delta} to 0 that can be used for 572@xref{Change Window,, Deleting and Rearranging Windows, emacs, The GNU
585shrinking @var{window}. 573Emacs Manual}. However, if the optional argument @var{ignore} is
586 574non-@code{nil}, this function ignores @code{window-min-height} and
587Normally, the customizable variables @code{window-min-height} and 575@code{window-min-width}, as well as @code{window-size-fixed}.
588@code{window-min-width} specify the smallest allowable size of a 576Instead, it considers the minimum-height window to be one consisting
589window. @xref{Change Window,,Deleting and Rearranging Windows, 577of a header (if any), a mode line, plus a text area one line tall; and
590emacs, The GNU Emacs Manual}. If resizing would result in making any 578a minimum-width window as one consisting of fringes, margins, and
591window smaller than this, this function usually signals an error. 579scroll bar (if any), plus a text area two columns wide.
592However, if the optional argument @var{ignore} is non-@code{nil}, this 580
593function ignores @code{window-min-height} and @code{window-min-width}, 581If the optional argument @var{noup} is non-@code{nil}, this function
594as well as @code{window-size-fixed}. In that case, the minimum-height 582considers a resize operation that does not alter the window parent of
595window consists of a header (if any), a mode line, plus a text area 583@var{window}, only its siblings. If the optional argument
596one line tall; the minimum-width window consists of any fringes, 584@var{nodown} is non-@code{nil}, it does not attempt to check whether
597margins and scroll bar, plus a text area two columns wide. 585@var{window} itself and its child windows can be resized.
598 586@end defun
599If @var{ignore} denotes a window, this means to ignore restrictions for
600that window only. If @var{ignore} equals the constant @code{safe}, this
601means a live window may get as small as one line or two columns.
602
603Optional argument @var{noup} non-@code{nil} means don't go up in the
604window tree but try to steal or distribute the space needed for the
605resize operation among the other windows within @var{window}'s
606combination. Optional argument @var{nodown} non-@code{nil} means don't
607check whether @var{window} itself and its child windows can be resized.
608@end defun
609
610The function @code{window-resizable} does not change any window sizes.
611The following function does:
612 587
613@defun window-resize window delta &optional horizontal ignore 588@defun window-resize window delta &optional horizontal ignore
614This function resizes @var{window} vertically by @var{delta} lines. The 589This function resizes @var{window} by @var{delta} increments. If
615argument @var{window} can denote an arbitrary window and defaults to the 590@var{horizontal} is @code{nil}, it changes the height by @var{delta}
616selected one. An attempt to resize the root window of a frame will 591lines; otherwise, it changes the width by @var{delta} columns. A
617raise an error. 592positive @var{delta} means to enlarge the window, and a negative
618 593@var{delta} means to shrink it.
619Second argument @var{delta} a positive number means @var{window} shall
620be enlarged by @var{delta} lines. If @var{delta} is negative, that
621means @var{window} shall be shrunk by -@var{delta} lines.
622
623Optional argument @var{horizontal} non-@code{nil} means to resize
624@var{window} horizontally by @var{delta} columns. In this case a
625positive @var{delta} means enlarge @var{window} by @var{delta} columns.
626A negative @var{delta} means @var{window} shall be shrunk by
627-@var{delta} columns.
628
629Optional argument @var{ignore} has the same meaning as for the function
630@code{window-resizable} above.
631
632This function can simultaneously move two edges of WINDOW. Exactly
633which edges of @var{window} are moved and which other windows are
634resized along with @var{window} is determined by the splits and nest
635status of the involved windows (@pxref{Splitting Windows}). If only the
636low (right) edge of @var{window} shall be moved, the function
637@code{adjust-window-trailing-edge} described below should be used.
638@end defun
639
640The next four commands are simple interfaces to @code{window-resize}.
641They always operate on the selected window, never delete any window, and
642always raise an error when resizing would violate a restriction imposed
643by @code{window-min-height}, @code{window-min-width}, or
644@code{window-size-fixed}.
645
646@deffn Command enlarge-window delta &optional horizontal
647This function makes the selected window @var{delta} lines taller.
648Interactively, if no argument is given, it makes the selected window one
649line taller. If optional argument @var{horizontal} is non-@code{nil},
650it makes the selected window wider by @var{delta} columns. If
651@var{delta} is negative, it shrinks the selected window by -@var{delta}
652lines or columns. The return value is @code{nil}.
653@end deffn
654 594
655@deffn Command enlarge-window-horizontally delta 595If @var{window} is @code{nil}, it defaults to the selected window. If
656This function makes the selected window @var{delta} columns wider. 596the window cannot be resized as demanded, an error is signaled.
657Interactively, if no argument is given, it makes the selected window one
658column wider.
659@end deffn
660 597
661@deffn Command shrink-window delta &optional horizontal 598The optional argument @var{ignore} has the same meaning as for the
662This function makes the selected window @var{delta} lines smaller. 599function @code{window-resizable} above.
663Interactively, if no argument is given, it makes the selected window one
664line smaller. If optional argument @var{horizontal} is non-@code{nil},
665it makes the selected window narrower by @var{delta} columns. If
666@var{delta} is negative, it enlarges the selected window by -@var{delta}
667lines or columns. The return value is @code{nil}.
668@end deffn
669 600
670@deffn Command shrink-window-horizontally delta 601The choice of which window edge this function alters depends on the
671This function makes the selected window @var{delta} columns narrower. 602splitting and nesting status of the involved windows; in some cases,
672Interactively, if no argument is given, it makes the selected window one 603it may alter both edges. @xref{Splitting Windows}. To resize by
673column narrower. 604moving only the bottom or right edge of a window, use the function
674@end deffn 605@code{adjust-window-trailing-edge}, below.
606@end defun
607
608@c The commands enlarge-window, enlarge-window-horizontally,
609@c shrink-window, and shrink-window-horizontally are documented in the
610@c Emacs manual. They are not preferred for calling from Lisp.
675 611
676The following function is useful for moving the line dividing two 612 The following function is useful for moving the line dividing two
677windows. 613windows.
678 614
679@defun adjust-window-trailing-edge window delta &optional horizontal 615@defun adjust-window-trailing-edge window delta &optional horizontal
@@ -1101,9 +1037,9 @@ configuration.
1101@code{split-window}. 1037@code{split-window}.
1102 1038
1103@defopt window-splits 1039@defopt window-splits
1104If this variable is nil, the function @code{split-window} can split a 1040If this variable is @code{nil}, the function @code{split-window} can
1105window if and only if that window's screen estate is sufficiently large 1041split a window if and only if that window's screen estate is
1106to accommodate both--itself and the new window. 1042sufficiently large to accommodate both--itself and the new window.
1107 1043
1108If this variable is non-@code{nil}, @code{split-window} tries to resize 1044If this variable is non-@code{nil}, @code{split-window} tries to resize
1109all windows that are part of the same combination as the old window to 1045all windows that are part of the same combination as the old window to
@@ -1488,11 +1424,11 @@ function, it calls that function with @var{window} as its sole argument.
1488@end deffn 1424@end deffn
1489 1425
1490@deffn Command delete-windows-on &optional buffer-or-name frame 1426@deffn Command delete-windows-on &optional buffer-or-name frame
1491This function deletes all windows showing @var{buffer-or-name} and 1427This function deletes all windows showing @var{buffer-or-name}. If
1492returns nil. If there are no windows showing @var{buffer-or-name}, it 1428there are no windows showing @var{buffer-or-name}, it does nothing.
1493does nothing. The optional argument @var{buffer-or-name} may be a 1429The optional argument @var{buffer-or-name} may be a buffer or the name
1494buffer or the name of an existing buffer and defaults to the current 1430of an existing buffer and defaults to the current buffer. Invoking
1495buffer. Invoking this command on a minibuffer signals an error. 1431this command on a minibuffer signals an error.
1496 1432
1497The function @code{delete-windows-on} operates by calling 1433The function @code{delete-windows-on} operates by calling
1498@code{delete-window} for each window showing @var{buffer-or-name}. If a 1434@code{delete-window} for each window showing @var{buffer-or-name}. If a
@@ -2108,7 +2044,7 @@ The constant @code{display-buffer-fallback-action}.
2108@noindent 2044@noindent
2109Each action function is called in turn, passing the buffer as the 2045Each action function is called in turn, passing the buffer as the
2110first argument and the combined action alist as the second argument, 2046first argument and the combined action alist as the second argument,
2111until one of the functions returns non-nil. 2047until one of the functions returns non-@code{nil}.
2112 2048
2113The argument @var{action} can also have a non-@code{nil}, non-list 2049The argument @var{action} can also have a non-@code{nil}, non-list
2114value. This has the special meaning that the buffer should be 2050value. This has the special meaning that the buffer should be
@@ -2159,7 +2095,7 @@ returns the window if it succeeds, and @code{nil} if it fails.
2159This function tries to display @var{buffer} in the selected window. 2095This function tries to display @var{buffer} in the selected window.
2160It fails if the selected window is a minibuffer window or is dedicated 2096It fails if the selected window is a minibuffer window or is dedicated
2161to another buffer (@pxref{Dedicated Windows}). It also fails if 2097to another buffer (@pxref{Dedicated Windows}). It also fails if
2162@var{alist} has a non-nil @code{inhibit-same-window} entry. 2098@var{alist} has a non-@code{nil} @code{inhibit-same-window} entry.
2163@end defun 2099@end defun
2164 2100
2165@defun display-buffer-reuse-window buffer alist 2101@defun display-buffer-reuse-window buffer alist