aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMartin Rudalics2014-03-06 14:41:58 +0100
committerMartin Rudalics2014-03-06 14:41:58 +0100
commitcac0a1d67e6bfec0ba08e1999b91212a7a561120 (patch)
tree4c04ba03dbd31dc8e8d6f308ef9c04462e6e0f58 /doc
parentfa965cbf7420c7ee5a0dde0df472592cd3aa2a1d (diff)
downloademacs-cac0a1d67e6bfec0ba08e1999b91212a7a561120.tar.gz
emacs-cac0a1d67e6bfec0ba08e1999b91212a7a561120.zip
More window code related fixes and documentation changes.
* window.c (Fother_window_for_scrolling): Check that Vother_window_scroll_buffer is a buffer. * window.el (fit-frame-to-buffer, fit-frame-to-buffer-margins): Fix doc-strings. (fit-frame-to-buffer): New argument ONLY. Remove dependency on fit-frame-to-buffer variable. Fix doc-string. (fit-window-to-buffer): Set ONLY argument in call of fit-frame-to-buffer. Fix doc-string. * frames.texi (Size and Position): Rewrite entries for `fit-frame-to-buffer' and `fit-frame-to-buffer-margins'. Add description for `fit-frame-to-buffer-sizes'. * windows.texi (Resizing Windows): Add descriptions for pixelwise resizing. Add entries for `window-resize-pixelwise' and `fit-window-to-buffer-horizontally'. Rewrite `fit-window-to-buffer' entry.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/ChangeLog10
-rw-r--r--doc/lispref/frames.texi51
-rw-r--r--doc/lispref/windows.texi91
3 files changed, 112 insertions, 40 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 5dfc5de3ce6..cac66f6e9e1 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,13 @@
12014-03-06 Martin Rudalics <rudalics@gmx.at>
2
3 * frames.texi (Size and Position): Rewrite entries for
4 `fit-frame-to-buffer' and `fit-frame-to-buffer-margins'. Add
5 description for `fit-frame-to-buffer-sizes'.
6 * windows.texi (Resizing Windows): Add descriptions for
7 pixelwise resizing. Add entries for `window-resize-pixelwise'
8 and `fit-window-to-buffer-horizontally'. Rewrite
9 `fit-window-to-buffer' entry.
10
12014-03-06 Xue Fuqiao <xfq@gnu.org> 112014-03-06 Xue Fuqiao <xfq@gnu.org>
2 12
3 * internals.texi (Window Internals): Remove field `region_showing'. 13 * internals.texi (Window Internals): Remove field `region_showing'.
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index 9ebc6c1adc2..166ec6d8dec 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -1180,19 +1180,48 @@ The argument @var{pretend} has the same meaning as in
1180 1180
1181@c FIXME? Belongs more in Emacs manual than here? 1181@c FIXME? Belongs more in Emacs manual than here?
1182@c But, e.g., fit-window-to-buffer is in this manual. 1182@c But, e.g., fit-window-to-buffer is in this manual.
1183@deffn Command fit-frame-to-buffer &optional frame max-height min-height 1183If you have a frame that displays only one window, you can fit that
1184This command adjusts the height of @var{frame} (the default is the 1184frame to its buffer using the command @code{fit-frame-to-buffer}.
1185selected frame) to fit its contents. The optional arguments 1185
1186@var{max-height} and @var{min-height} specify the maximum and minimum 1186@deffn Command fit-frame-to-buffer &optional frame max-height min-height max-width min-width only
1187new frame heights, respectively. 1187This command adjusts the size of @var{frame} to display the contents of
1188 1188its buffer exactly. @var{frame} can be any live frame and defaults to
1189@vindex fit-frame-to-buffer-bottom-margin 1189the selected one. Fitting is done only if @var{frame}'s root window is
1190The default minimum height corresponds to @code{window-min-height}. 1190live. The arguments @var{max-height}, @var{min-height}, @var{max-width}
1191The default maximum height is the screen height below the current top 1191and @var{min-width} specify bounds on the new total size of
1192position of the frame, minus any margin specified by the option 1192@var{frame}'s root window. @var{min-height} and @var{min-width} default
1193@code{fit-frame-to-buffer-bottom-margin}. 1193to the values of @code{window-min-height} and @code{window-min-width}
1194respectively.
1195
1196If the optional argument @var{only} is @code{vertically}, this function
1197may resize the frame vertically only. If @var{only} is
1198@code{horizontally}, it may resize the frame horizontally only.
1194@end deffn 1199@end deffn
1195 1200
1201The behavior of @code{fit-frame-to-buffer} can be controlled with the
1202help of the two options listed next.
1203
1204@defopt fit-frame-to-buffer-margins
1205This option can be used to specify margins around frames to be fit by
1206@code{fit-frame-to-buffer}. Such margins can be useful to avoid, for
1207example, that such frames overlap the taskbar.
1208
1209It specifies the numbers of pixels to be left free on the left, above,
1210the right, and below a frame that shall be fit. The default specifies
1211@code{nil} for each which means to use no margins. The value specified
1212here can be overridden for a specific frame by that frame's
1213@code{fit-frame-to-buffer-margins} parameter, if present.
1214@end defopt
1215
1216@defopt fit-frame-to-buffer-sizes
1217This option specifies size boundaries for @code{fit-frame-to-buffer}.
1218It specifies the total maximum and minimum lines and maximum and minimum
1219columns of the root window of any frame that shall be fit to its buffer.
1220If any of these values is non-@code{nil}, it overrides the corresponding
1221argument of @code{fit-frame-to-buffer}.
1222@end defopt
1223
1224
1196@node Geometry 1225@node Geometry
1197@subsection Geometry 1226@subsection Geometry
1198 1227
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index a0c59afbf28..3fa4117e52c 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -691,10 +691,9 @@ lines or columns. If @var{delta} is non-zero, a return value of 0 means
691that the window cannot be resized. 691that the window cannot be resized.
692 692
693Normally, the variables @code{window-min-height} and 693Normally, the variables @code{window-min-height} and
694@code{window-min-width} specify the smallest allowable window size. 694@code{window-min-width} specify the smallest allowable window size
695@xref{Change Window,, Deleting and Rearranging Windows, emacs, The GNU 695(@pxref{Window Sizes}). However, if the optional argument @var{ignore}
696Emacs Manual}. However, if the optional argument @var{ignore} is 696is non-@code{nil}, this function ignores @code{window-min-height} and
697non-@code{nil}, this function ignores @code{window-min-height} and
698@code{window-min-width}, as well as @code{window-size-fixed}. Instead, 697@code{window-min-width}, as well as @code{window-size-fixed}. Instead,
699it considers the minimum-height window to be one consisting of a header, 698it considers the minimum-height window to be one consisting of a header,
700a mode line and a bottom divider (if any), plus a text area one line 699a mode line and a bottom divider (if any), plus a text area one line
@@ -755,43 +754,73 @@ window is fixed-size), it may resize other windows.
755 754
756@cindex pixelwise, resizing windows 755@cindex pixelwise, resizing windows
757@defopt window-resize-pixelwise 756@defopt window-resize-pixelwise
758If the value of this user option is non-@code{nil}, window resizing 757If the value of this option is non-@code{nil}, windows are resized in
759operations will be pixelwise. This currently affects the following 758units of pixels. This currently affects functions like
760functions: @code{split-window}, @code{maximize-window}, 759@code{split-window} (@pxref{Splitting Windows}), @code{maximize-window},
761@code{minimize-window}, @code{fit-window-to-buffer} and 760@code{minimize-window}, @code{fit-window-to-buffer},
762@code{fit-frame-to-buffer}, and all functions that symmetrically 761@code{shrink-window-if-larger-than-buffer} (all listed below) and
763resize a parent window. 762@code{fit-frame-to-buffer} (@pxref{Size and Position}).
764 763
765Note that when a frame's pixel size is not a multiple of the frame's 764Note that when a frame's pixel size is not a multiple of the frame's
766character size, at least one window may get resized pixelwise even if 765character size, at least one window may get resized pixelwise even if
767this option is nil. The default value of this user option is 766this option is @code{nil}. The default value of this option is
768@code{nil}. 767@code{nil}.
769@end defopt 768@end defopt
770 769
771 The following commands resize windows in more specific ways. When 770 The following commands resize windows in more specific ways. When
772called interactively, they act on the selected window. 771called interactively, they act on the selected window.
773 772
774@deffn Command fit-window-to-buffer &optional window max-height min-height override 773@deffn Command fit-window-to-buffer &optional window max-height min-height max-width min-width
775This command adjusts the height of @var{window} to fit the text in it. 774This command adjusts the height or width of @var{window} to fit the text
776It returns non-@code{nil} if it was able to resize @var{window}, and 775in it. It returns non-@code{nil} if it was able to resize @var{window},
777@code{nil} otherwise. If @var{window} is omitted or @code{nil}, it 776and @code{nil} otherwise. If @var{window} is omitted or @code{nil}, it
778defaults to the selected window. Otherwise, it should be a live 777defaults to the selected window. Otherwise, it should be a live window.
779window. 778
779If @var{window} is part of a vertical combination, this function adjusts
780@var{window}'s height. The new height is calculated from the actual
781height of the accessible portion of its buffer. The optional argument
782@var{max-height}, if non-@code{nil}, specifies the maximum total height
783that this function can give @var{window}. The optional argument
784@var{min-height}, if non-@code{nil}, specifies the minimum total height
785that it can give, which overrides the variable @code{window-min-height}.
786Both @var{max-height} and @var{min-height} are specified in lines and
787include mode and header line and a bottom divider, if any.
788
789If @var{window} is part of a horizontal combination and the value of the
790option @code{fit-window-to-buffer-horizontally} (see below) is
791non-@code{nil}, this function adjusts @var{window}'s height. The new
792width of @var{window} is calculated from the maximum length of its
793buffer's lines that follow the current start position of @var{window}.
794The optional argument @var{max-width} specifies a maximum width and
795defaults to the width of @var{window}'s frame. The optional argument
796@var{min-width} specifies a minimum width and defaults to
797@code{window-min-width}. Both @var{max-width} and @var{min-width} are
798specified in columns and include fringes, margins and scrollbars, if
799any.
780 800
781The optional argument @var{max-height}, if non-@code{nil}, specifies 801If the option @code{fit-frame-to-buffer} (see below) is non-@code{nil},
782the maximum total height that this function can give @var{window}. 802this function will try to resize the frame of @var{window} to fit its
783The optional argument @var{min-height}, if non-@code{nil}, specifies 803contents by calling @code{fit-frame-to-buffer} (@pxref{Size and
784the minimum total height that it can give, which overrides the 804Position}).
785variable @code{window-min-height}. 805@end deffn
786 806
787If the optional argument @var{override} is non-@code{nil}, this 807@defopt fit-window-to-buffer-horizontally
788function ignores any size restrictions imposed by 808If this is non-@code{nil}, @code{fit-window-to-buffer} can resize
789@code{window-min-height} and @code{window-min-width}. 809windows horizontally. If this is @code{nil} (the default)
810@code{fit-window-to-buffer} never resizes windows horizontally. If this
811is @code{only}, it can resize windows horizontally only. Any other
812value means @code{fit-window-to-buffer} can resize windows in both
813dimensions.
814@end defopt
790 815
791@vindex fit-frame-to-buffer 816@defopt fit-frame-to-buffer
792If the option @code{fit-frame-to-buffer} is non-@code{nil}, this 817If this option is non-@code{nil}, @code{fit-window-to-buffer} can fit a
793command may resize the frame to fit its contents. 818frame to its buffer. A frame is fit if and only if its root window is a
794@end deffn 819live window and this option is non-@code{nil}. If this is
820@code{horizontally}, frames are fit horizontally only. If this is
821@code{vertically}, frames are fit vertically only. Any other
822non-@code{nil} value means frames can be resized in both dimensions.
823@end defopt
795 824
796@deffn Command shrink-window-if-larger-than-buffer &optional window 825@deffn Command shrink-window-if-larger-than-buffer &optional window
797This command attempts to reduce @var{window}'s height as much as 826This command attempts to reduce @var{window}'s height as much as
@@ -804,8 +833,12 @@ it should be a live window.
804This command does nothing if the window is already too short to 833This command does nothing if the window is already too short to
805display all of its buffer, or if any of the buffer is scrolled 834display all of its buffer, or if any of the buffer is scrolled
806off-screen, or if the window is the only live window in its frame. 835off-screen, or if the window is the only live window in its frame.
836
837This command calls @code{fit-window-to-buffer} (see above) to do its
838work.
807@end deffn 839@end deffn
808 840
841
809@cindex balancing window sizes 842@cindex balancing window sizes
810@deffn Command balance-windows &optional window-or-frame 843@deffn Command balance-windows &optional window-or-frame
811This function balances windows in a way that gives more space to 844This function balances windows in a way that gives more space to