diff options
| author | Martin Rudalics | 2014-03-06 14:41:58 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2014-03-06 14:41:58 +0100 |
| commit | cac0a1d67e6bfec0ba08e1999b91212a7a561120 (patch) | |
| tree | 4c04ba03dbd31dc8e8d6f308ef9c04462e6e0f58 /doc | |
| parent | fa965cbf7420c7ee5a0dde0df472592cd3aa2a1d (diff) | |
| download | emacs-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/ChangeLog | 10 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 51 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 91 |
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 @@ | |||
| 1 | 2014-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 | |||
| 1 | 2014-03-06 Xue Fuqiao <xfq@gnu.org> | 11 | 2014-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 | 1183 | If you have a frame that displays only one window, you can fit that |
| 1184 | This command adjusts the height of @var{frame} (the default is the | 1184 | frame to its buffer using the command @code{fit-frame-to-buffer}. |
| 1185 | selected 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 |
| 1187 | new frame heights, respectively. | 1187 | This command adjusts the size of @var{frame} to display the contents of |
| 1188 | 1188 | its buffer exactly. @var{frame} can be any live frame and defaults to | |
| 1189 | @vindex fit-frame-to-buffer-bottom-margin | 1189 | the selected one. Fitting is done only if @var{frame}'s root window is |
| 1190 | The default minimum height corresponds to @code{window-min-height}. | 1190 | live. The arguments @var{max-height}, @var{min-height}, @var{max-width} |
| 1191 | The default maximum height is the screen height below the current top | 1191 | and @var{min-width} specify bounds on the new total size of |
| 1192 | position 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}. | 1193 | to the values of @code{window-min-height} and @code{window-min-width} |
| 1194 | respectively. | ||
| 1195 | |||
| 1196 | If the optional argument @var{only} is @code{vertically}, this function | ||
| 1197 | may 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 | ||
| 1201 | The behavior of @code{fit-frame-to-buffer} can be controlled with the | ||
| 1202 | help of the two options listed next. | ||
| 1203 | |||
| 1204 | @defopt fit-frame-to-buffer-margins | ||
| 1205 | This 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 | ||
| 1207 | example, that such frames overlap the taskbar. | ||
| 1208 | |||
| 1209 | It specifies the numbers of pixels to be left free on the left, above, | ||
| 1210 | the 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 | ||
| 1212 | here 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 | ||
| 1217 | This option specifies size boundaries for @code{fit-frame-to-buffer}. | ||
| 1218 | It specifies the total maximum and minimum lines and maximum and minimum | ||
| 1219 | columns of the root window of any frame that shall be fit to its buffer. | ||
| 1220 | If any of these values is non-@code{nil}, it overrides the corresponding | ||
| 1221 | argument 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 | |||
| 691 | that the window cannot be resized. | 691 | that the window cannot be resized. |
| 692 | 692 | ||
| 693 | Normally, the variables @code{window-min-height} and | 693 | Normally, 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} |
| 696 | Emacs Manual}. However, if the optional argument @var{ignore} is | 696 | is non-@code{nil}, this function ignores @code{window-min-height} and |
| 697 | non-@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, |
| 699 | it considers the minimum-height window to be one consisting of a header, | 698 | it considers the minimum-height window to be one consisting of a header, |
| 700 | a mode line and a bottom divider (if any), plus a text area one line | 699 | a 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 |
| 758 | If the value of this user option is non-@code{nil}, window resizing | 757 | If the value of this option is non-@code{nil}, windows are resized in |
| 759 | operations will be pixelwise. This currently affects the following | 758 | units of pixels. This currently affects functions like |
| 760 | functions: @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 |
| 763 | resize a parent window. | 762 | @code{fit-frame-to-buffer} (@pxref{Size and Position}). |
| 764 | 763 | ||
| 765 | Note that when a frame's pixel size is not a multiple of the frame's | 764 | Note that when a frame's pixel size is not a multiple of the frame's |
| 766 | character size, at least one window may get resized pixelwise even if | 765 | character size, at least one window may get resized pixelwise even if |
| 767 | this option is nil. The default value of this user option is | 766 | this 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 |
| 772 | called interactively, they act on the selected window. | 771 | called 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 |
| 775 | This command adjusts the height of @var{window} to fit the text in it. | 774 | This command adjusts the height or width of @var{window} to fit the text |
| 776 | It returns non-@code{nil} if it was able to resize @var{window}, and | 775 | in 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 | 776 | and @code{nil} otherwise. If @var{window} is omitted or @code{nil}, it |
| 778 | defaults to the selected window. Otherwise, it should be a live | 777 | defaults to the selected window. Otherwise, it should be a live window. |
| 779 | window. | 778 | |
| 779 | If @var{window} is part of a vertical combination, this function adjusts | ||
| 780 | @var{window}'s height. The new height is calculated from the actual | ||
| 781 | height of the accessible portion of its buffer. The optional argument | ||
| 782 | @var{max-height}, if non-@code{nil}, specifies the maximum total height | ||
| 783 | that this function can give @var{window}. The optional argument | ||
| 784 | @var{min-height}, if non-@code{nil}, specifies the minimum total height | ||
| 785 | that it can give, which overrides the variable @code{window-min-height}. | ||
| 786 | Both @var{max-height} and @var{min-height} are specified in lines and | ||
| 787 | include mode and header line and a bottom divider, if any. | ||
| 788 | |||
| 789 | If @var{window} is part of a horizontal combination and the value of the | ||
| 790 | option @code{fit-window-to-buffer-horizontally} (see below) is | ||
| 791 | non-@code{nil}, this function adjusts @var{window}'s height. The new | ||
| 792 | width of @var{window} is calculated from the maximum length of its | ||
| 793 | buffer's lines that follow the current start position of @var{window}. | ||
| 794 | The optional argument @var{max-width} specifies a maximum width and | ||
| 795 | defaults 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 | ||
| 798 | specified in columns and include fringes, margins and scrollbars, if | ||
| 799 | any. | ||
| 780 | 800 | ||
| 781 | The optional argument @var{max-height}, if non-@code{nil}, specifies | 801 | If the option @code{fit-frame-to-buffer} (see below) is non-@code{nil}, |
| 782 | the maximum total height that this function can give @var{window}. | 802 | this function will try to resize the frame of @var{window} to fit its |
| 783 | The optional argument @var{min-height}, if non-@code{nil}, specifies | 803 | contents by calling @code{fit-frame-to-buffer} (@pxref{Size and |
| 784 | the minimum total height that it can give, which overrides the | 804 | Position}). |
| 785 | variable @code{window-min-height}. | 805 | @end deffn |
| 786 | 806 | ||
| 787 | If the optional argument @var{override} is non-@code{nil}, this | 807 | @defopt fit-window-to-buffer-horizontally |
| 788 | function ignores any size restrictions imposed by | 808 | If this is non-@code{nil}, @code{fit-window-to-buffer} can resize |
| 789 | @code{window-min-height} and @code{window-min-width}. | 809 | windows horizontally. If this is @code{nil} (the default) |
| 810 | @code{fit-window-to-buffer} never resizes windows horizontally. If this | ||
| 811 | is @code{only}, it can resize windows horizontally only. Any other | ||
| 812 | value means @code{fit-window-to-buffer} can resize windows in both | ||
| 813 | dimensions. | ||
| 814 | @end defopt | ||
| 790 | 815 | ||
| 791 | @vindex fit-frame-to-buffer | 816 | @defopt fit-frame-to-buffer |
| 792 | If the option @code{fit-frame-to-buffer} is non-@code{nil}, this | 817 | If this option is non-@code{nil}, @code{fit-window-to-buffer} can fit a |
| 793 | command may resize the frame to fit its contents. | 818 | frame to its buffer. A frame is fit if and only if its root window is a |
| 794 | @end deffn | 819 | live 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 | ||
| 822 | non-@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 |
| 797 | This command attempts to reduce @var{window}'s height as much as | 826 | This command attempts to reduce @var{window}'s height as much as |
| @@ -804,8 +833,12 @@ it should be a live window. | |||
| 804 | This command does nothing if the window is already too short to | 833 | This command does nothing if the window is already too short to |
| 805 | display all of its buffer, or if any of the buffer is scrolled | 834 | display all of its buffer, or if any of the buffer is scrolled |
| 806 | off-screen, or if the window is the only live window in its frame. | 835 | off-screen, or if the window is the only live window in its frame. |
| 836 | |||
| 837 | This command calls @code{fit-window-to-buffer} (see above) to do its | ||
| 838 | work. | ||
| 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 |
| 811 | This function balances windows in a way that gives more space to | 844 | This function balances windows in a way that gives more space to |