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 | |
| 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.
| -rw-r--r-- | doc/lispref/ChangeLog | 10 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 51 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 91 | ||||
| -rw-r--r-- | etc/NEWS | 16 | ||||
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/window.el | 70 | ||||
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/window.c | 1 |
8 files changed, 168 insertions, 85 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 |
| @@ -226,6 +226,11 @@ resize windows pixelwise. Most functions for changing or accessing | |||
| 226 | window sizes now have an additional argument that allows changes to apply, | 226 | window sizes now have an additional argument that allows changes to apply, |
| 227 | or values to be returned, in pixels instead of lines/columns. | 227 | or values to be returned, in pixels instead of lines/columns. |
| 228 | 228 | ||
| 229 | +++ | ||
| 230 | *** The functions `window-body-height' and `window-body-width' now never | ||
| 231 | count partially visible lines or columns if called with a nil PIXELWISE | ||
| 232 | argument. | ||
| 233 | |||
| 229 | *** Emacs can now draw dividers between adjacent windows. To put | 234 | *** Emacs can now draw dividers between adjacent windows. To put |
| 230 | dividers between side-by-side/vertically stacked windows customize the | 235 | dividers between side-by-side/vertically stacked windows customize the |
| 231 | frame parameters `right-divider-width' and `bottom-divider-width' to | 236 | frame parameters `right-divider-width' and `bottom-divider-width' to |
| @@ -246,14 +251,13 @@ text of a window's buffer in pixels. This allows functions like | |||
| 246 | `fit-frame-to-buffer' and `fit-window-to-buffer' to accurately fit a | 251 | `fit-frame-to-buffer' and `fit-window-to-buffer' to accurately fit a |
| 247 | window to its buffer as it will be displayed. | 252 | window to its buffer as it will be displayed. |
| 248 | 253 | ||
| 249 | *** `fit-window-to-buffer' can now resize windows horizontally. | 254 | *** `fit-window-to-buffer' can now resize windows in both dimensions. |
| 250 | This behavior is controlled by the new option | 255 | This behavior is controlled by the new option |
| 251 | `fit-window-to-buffer-horizontally'. | 256 | `fit-window-to-buffer-horizontally'. The new option |
| 257 | `fit-frame-to-buffer' allows to fit the window's frame to its buffer. | ||
| 252 | 258 | ||
| 253 | *** `fit-frame-to-buffer' can now fit frames in both directions. | 259 | *** `fit-frame-to-buffer' now fits frames in both dimensions. The new |
| 254 | This behavior is controlled by the option `fit-frame-to-buffer' which | 260 | options `fit-frame-to-buffer-margins' and `fit-frame-to-buffer-sizes' |
| 255 | tells in which direction(s) the frame shall be fit. The new options | ||
| 256 | `fit-frame-to-buffer-margins' and `fit-frame-to-buffer-sizes' allow to | ||
| 257 | control the size of the frame and its position on screen. | 261 | control the size of the frame and its position on screen. |
| 258 | 262 | ||
| 259 | *** Temp Buffer Resize Mode can now adjust height and width of windows | 263 | *** Temp Buffer Resize Mode can now adjust height and width of windows |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 57057e8a24e..1ec970f9b48 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2014-03-06 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.el (fit-frame-to-buffer, fit-frame-to-buffer-margins): | ||
| 4 | Fix doc-strings. | ||
| 5 | (fit-frame-to-buffer): New argument ONLY. Remove dependency on | ||
| 6 | fit-frame-to-buffer variable. Fix doc-string. | ||
| 7 | (fit-window-to-buffer): Set ONLY argument in call of | ||
| 8 | fit-frame-to-buffer. Fix doc-string. | ||
| 9 | |||
| 1 | 2014-03-06 Michael Albinus <michael.albinus@gmx.de> | 10 | 2014-03-06 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 11 | ||
| 3 | * net/tramp.el (tramp-error): VEC-OR-PROC can be nil. | 12 | * net/tramp.el (tramp-error): VEC-OR-PROC can be nil. |
diff --git a/lisp/window.el b/lisp/window.el index 6df3776da56..10aa3a70464 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -6813,34 +6813,27 @@ can resize windows in both dimensions." | |||
| 6813 | ;; `fit-frame-to-buffer' eventually wants to know the real frame sizes | 6813 | ;; `fit-frame-to-buffer' eventually wants to know the real frame sizes |
| 6814 | ;; counting title bar and outer borders. | 6814 | ;; counting title bar and outer borders. |
| 6815 | (defcustom fit-frame-to-buffer nil | 6815 | (defcustom fit-frame-to-buffer nil |
| 6816 | "Non-nil means `fit-frame-to-buffer' can fit a frame to its buffer. | 6816 | "Non-nil means `fit-window-to-buffer' can fit a frame to its buffer. |
| 6817 | A frame is fit if and only if its root window is a live window | 6817 | A frame is fit if and only if its root window is a live window |
| 6818 | and this option is non-nil. If this is `horizontally', frames | 6818 | and this option is non-nil. If this is `horizontally', frames |
| 6819 | are resized horizontally only. If this is `vertically', frames | 6819 | are resized horizontally only. If this is `vertically', frames |
| 6820 | are resized vertically only. Any other non-nil value means | 6820 | are resized vertically only. Any other non-nil value means |
| 6821 | frames can be resized in both dimensions. See also | 6821 | frames can be resized in both dimensions." |
| 6822 | `fit-frame-to-buffer-margins' and `fit-frame-to-buffer-sizes'. | ||
| 6823 | |||
| 6824 | If this is non-nil and a window is the only window of its frame, | ||
| 6825 | `fit-window-to-buffer' will invoke `fit-frame-to-buffer' to fit | ||
| 6826 | the frame to its buffer." | ||
| 6827 | :type 'boolean | 6822 | :type 'boolean |
| 6828 | :version "24.4" | 6823 | :version "24.4" |
| 6829 | :group 'help) | 6824 | :group 'help) |
| 6830 | 6825 | ||
| 6831 | (defcustom fit-frame-to-buffer-margins '(nil nil nil nil) | 6826 | (defcustom fit-frame-to-buffer-margins '(nil nil nil nil) |
| 6832 | "Margins around frame for `fit-frame-to-buffer'. | 6827 | "Margins around frame for `fit-frame-to-buffer'. |
| 6833 | This list specifies the numbers of pixels to be left free on the | 6828 | This option allows to specify the numbers of pixels to be left |
| 6834 | left, above, the right, and below a frame that shall be fit to | 6829 | free on the left, above, the right, and below a frame that shall |
| 6835 | its buffer. The value specified here can be overridden for a | 6830 | be fit to its buffer. Set these to avoid that such a frame |
| 6836 | specific frame by that frame's `fit-frame-to-buffer-margins' | 6831 | obscurs other desktop objects like the taskbar. The default is |
| 6837 | parameter, if present. | 6832 | nil for each side which means to not add any margins. |
| 6838 | 6833 | ||
| 6839 | This variable controls how fitting a frame to the size of its | 6834 | The value specified here can be overridden for a specific frame |
| 6840 | buffer coordinates with the size of your display. If you don't | 6835 | by that frame's `fit-frame-to-buffer-margins' parameter, if |
| 6841 | specify a value here, the size of the display's workarea is used. | 6836 | present. See also `fit-frame-to-buffer-sizes'." |
| 6842 | |||
| 6843 | See also `fit-frame-to-buffer-sizes'." | ||
| 6844 | :version "24.4" | 6837 | :version "24.4" |
| 6845 | :type '(list | 6838 | :type '(list |
| 6846 | (choice | 6839 | (choice |
| @@ -6917,7 +6910,7 @@ See also `fit-frame-to-buffer-margins'." | |||
| 6917 | (<= left (- right margin)) (<= margin right)) | 6910 | (<= left (- right margin)) (<= margin right)) |
| 6918 | margin)) | 6911 | margin)) |
| 6919 | 6912 | ||
| 6920 | (defun fit-frame-to-buffer (&optional frame max-height min-height max-width min-width) | 6913 | (defun fit-frame-to-buffer (&optional frame max-height min-height max-width min-width only) |
| 6921 | "Adjust size of FRAME to display the contents of its buffer exactly. | 6914 | "Adjust size of FRAME to display the contents of its buffer exactly. |
| 6922 | FRAME can be any live frame and defaults to the selected one. | 6915 | FRAME can be any live frame and defaults to the selected one. |
| 6923 | Fit only if FRAME's root window is live. MAX-HEIGHT, MIN-HEIGHT, | 6916 | Fit only if FRAME's root window is live. MAX-HEIGHT, MIN-HEIGHT, |
| @@ -6925,9 +6918,12 @@ MAX-WIDTH and MIN-WIDTH specify bounds on the new total size of | |||
| 6925 | FRAME's root window. MIN-HEIGHT and MIN-WIDTH default to the values of | 6918 | FRAME's root window. MIN-HEIGHT and MIN-WIDTH default to the values of |
| 6926 | `window-min-height' and `window-min-width' respectively. | 6919 | `window-min-height' and `window-min-width' respectively. |
| 6927 | 6920 | ||
| 6928 | The option `fit-frame-to-buffer' controls whether this function | 6921 | If the optional argument ONLY is `vertically', resize the frame |
| 6929 | has any effect. New position and size of FRAME are additionally | 6922 | vertically only. If ONLY is `horizontally', resize the frame |
| 6930 | determined by the options `fit-frame-to-buffer-sizes' and | 6923 | horizontally only. |
| 6924 | |||
| 6925 | The new position and size of FRAME can be additionally determined | ||
| 6926 | by customizing the options `fit-frame-to-buffer-sizes' and | ||
| 6931 | `fit-frame-to-buffer-margins' or the corresponding parameters of | 6927 | `fit-frame-to-buffer-margins' or the corresponding parameters of |
| 6932 | FRAME." | 6928 | FRAME." |
| 6933 | (interactive) | 6929 | (interactive) |
| @@ -6936,13 +6932,7 @@ FRAME." | |||
| 6936 | (fboundp 'display-monitor-attributes-list)) | 6932 | (fboundp 'display-monitor-attributes-list)) |
| 6937 | (user-error "Cannot resize frame in non-graphic Emacs")) | 6933 | (user-error "Cannot resize frame in non-graphic Emacs")) |
| 6938 | (setq frame (window-normalize-frame frame)) | 6934 | (setq frame (window-normalize-frame frame)) |
| 6939 | (when (and (window-live-p (frame-root-window frame)) | 6935 | (when (window-live-p (frame-root-window frame)) |
| 6940 | fit-frame-to-buffer | ||
| 6941 | (or (not window-size-fixed) | ||
| 6942 | (and (eq window-size-fixed 'height) | ||
| 6943 | (not (eq fit-frame-to-buffer 'vertically))) | ||
| 6944 | (and (eq window-size-fixed 'width) | ||
| 6945 | (not (eq fit-frame-to-buffer 'horizontally))))) | ||
| 6946 | (with-selected-window (frame-root-window frame) | 6936 | (with-selected-window (frame-root-window frame) |
| 6947 | (let* ((window (frame-root-window frame)) | 6937 | (let* ((window (frame-root-window frame)) |
| 6948 | (char-width (frame-char-width)) | 6938 | (char-width (frame-char-width)) |
| @@ -7069,11 +7059,11 @@ FRAME." | |||
| 7069 | (width (+ (car value) (window-right-divider-width))) | 7059 | (width (+ (car value) (window-right-divider-width))) |
| 7070 | (height (+ (cdr value) (window-bottom-divider-width)))) | 7060 | (height (+ (cdr value) (window-bottom-divider-width)))) |
| 7071 | ;; Don't change height or width when the window's size is fixed | 7061 | ;; Don't change height or width when the window's size is fixed |
| 7072 | ;; in either direction. | 7062 | ;; in either direction or ONLY forbids it. |
| 7073 | (cond | 7063 | (cond |
| 7074 | ((eq window-size-fixed 'width) | 7064 | ((or (eq window-size-fixed 'width) (eq only 'vertically)) |
| 7075 | (setq width nil)) | 7065 | (setq width nil)) |
| 7076 | ((eq window-size-fixed 'height) | 7066 | ((or (eq window-size-fixed 'height) (eq only 'horizontally)) |
| 7077 | (setq height nil))) | 7067 | (setq height nil))) |
| 7078 | ;; Fit width to constraints. | 7068 | ;; Fit width to constraints. |
| 7079 | (when width | 7069 | (when width |
| @@ -7141,13 +7131,13 @@ FRAME." | |||
| 7141 | WINDOW must be a live window and defaults to the selected one. | 7131 | WINDOW must be a live window and defaults to the selected one. |
| 7142 | 7132 | ||
| 7143 | If WINDOW is part of a vertical combination, adjust WINDOW's | 7133 | If WINDOW is part of a vertical combination, adjust WINDOW's |
| 7144 | height. The new height is calculated from the number of lines of | 7134 | height. The new height is calculated from the actual height of |
| 7145 | the accessible portion of its buffer. The optional argument | 7135 | the accessible portion of its buffer. The optional argument |
| 7146 | MAX-HEIGHT specifies a maximum height and defaults to the height | 7136 | MAX-HEIGHT specifies a maximum height and defaults to the height |
| 7147 | of WINDOW's frame. The optional argument MIN-HEIGHT specifies a | 7137 | of WINDOW's frame. The optional argument MIN-HEIGHT specifies a |
| 7148 | minimum height and defaults to `window-min-height'. Both | 7138 | minimum height and defaults to `window-min-height'. Both |
| 7149 | MAX-HEIGHT and MIN-HEIGHT are specified in lines and include the | 7139 | MAX-HEIGHT and MIN-HEIGHT are specified in lines and include mode |
| 7150 | mode line and header line, if any. | 7140 | and header line and a bottom divider, if any. |
| 7151 | 7141 | ||
| 7152 | If WINDOW is part of a horizontal combination and the value of | 7142 | If WINDOW is part of a horizontal combination and the value of |
| 7153 | the option `fit-window-to-buffer-horizontally' is non-nil, adjust | 7143 | the option `fit-window-to-buffer-horizontally' is non-nil, adjust |
| @@ -7157,11 +7147,11 @@ start position of WINDOW. The optional argument MAX-WIDTH | |||
| 7157 | specifies a maximum width and defaults to the width of WINDOW's | 7147 | specifies a maximum width and defaults to the width of WINDOW's |
| 7158 | frame. The optional argument MIN-WIDTH specifies a minimum width | 7148 | frame. The optional argument MIN-WIDTH specifies a minimum width |
| 7159 | and defaults to `window-min-width'. Both MAX-WIDTH and MIN-WIDTH | 7149 | and defaults to `window-min-width'. Both MAX-WIDTH and MIN-WIDTH |
| 7160 | are specified in columns and include fringes, margins and | 7150 | are specified in columns and include fringes, margins, a |
| 7161 | scrollbars, if any. | 7151 | scrollbar and a vertical divider, if any. |
| 7162 | 7152 | ||
| 7163 | Fit pixelwise if the option `window-resize-pixelwise' is non-nil. | 7153 | Fit pixelwise if the option `window-resize-pixelwise' is non-nil. |
| 7164 | If WINDOW is its frame's root window, then if the option | 7154 | If WINDOW is its frame's root window and the option |
| 7165 | `fit-frame-to-buffer' is non-nil, call `fit-frame-to-buffer' to | 7155 | `fit-frame-to-buffer' is non-nil, call `fit-frame-to-buffer' to |
| 7166 | adjust the frame's size. | 7156 | adjust the frame's size. |
| 7167 | 7157 | ||
| @@ -7177,7 +7167,9 @@ accessible position." | |||
| 7177 | ;; Fit WINDOW's frame to buffer. | 7167 | ;; Fit WINDOW's frame to buffer. |
| 7178 | (fit-frame-to-buffer | 7168 | (fit-frame-to-buffer |
| 7179 | (window-frame window) | 7169 | (window-frame window) |
| 7180 | max-height min-height max-width min-width)) | 7170 | max-height min-height max-width min-width |
| 7171 | (and (memq fit-frame-to-buffer '(vertically horizontally)) | ||
| 7172 | fit-frame-to-buffer))) | ||
| 7181 | (with-selected-window window | 7173 | (with-selected-window window |
| 7182 | (let* ((pixelwise window-resize-pixelwise) | 7174 | (let* ((pixelwise window-resize-pixelwise) |
| 7183 | (char-height (frame-char-height)) | 7175 | (char-height (frame-char-height)) |
diff --git a/src/ChangeLog b/src/ChangeLog index 8f9d7f555a3..9fef63c9a58 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-03-06 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.c (Fother_window_for_scrolling): Check that | ||
| 4 | Vother_window_scroll_buffer is a buffer. | ||
| 5 | |||
| 1 | 2014-03-06 Dmitry Antipov <dmantipov@yandex.ru> | 6 | 2014-03-06 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 7 | ||
| 3 | * xterm.c (xim_initialize): Always pass a copy of resource name | 8 | * xterm.c (xim_initialize): Always pass a copy of resource name |
diff --git a/src/window.c b/src/window.c index b6cfacd9aad..4d8520d7436 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -5431,6 +5431,7 @@ specifies the window. This takes precedence over | |||
| 5431 | window = Vminibuf_scroll_window; | 5431 | window = Vminibuf_scroll_window; |
| 5432 | /* If buffer is specified and live, scroll that buffer. */ | 5432 | /* If buffer is specified and live, scroll that buffer. */ |
| 5433 | else if (!NILP (Vother_window_scroll_buffer) | 5433 | else if (!NILP (Vother_window_scroll_buffer) |
| 5434 | && BUFFERP (Vother_window_scroll_buffer) | ||
| 5434 | && BUFFER_LIVE_P (XBUFFER (Vother_window_scroll_buffer))) | 5435 | && BUFFER_LIVE_P (XBUFFER (Vother_window_scroll_buffer))) |
| 5435 | { | 5436 | { |
| 5436 | window = Fget_buffer_window (Vother_window_scroll_buffer, Qnil); | 5437 | window = Fget_buffer_window (Vother_window_scroll_buffer, Qnil); |