aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2014-03-06 14:41:58 +0100
committerMartin Rudalics2014-03-06 14:41:58 +0100
commitcac0a1d67e6bfec0ba08e1999b91212a7a561120 (patch)
tree4c04ba03dbd31dc8e8d6f308ef9c04462e6e0f58
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.
-rw-r--r--doc/lispref/ChangeLog10
-rw-r--r--doc/lispref/frames.texi51
-rw-r--r--doc/lispref/windows.texi91
-rw-r--r--etc/NEWS16
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/window.el70
-rw-r--r--src/ChangeLog5
-rw-r--r--src/window.c1
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 @@
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
diff --git a/etc/NEWS b/etc/NEWS
index 69e65cc55a1..b54f512410d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -226,6 +226,11 @@ resize windows pixelwise. Most functions for changing or accessing
226window sizes now have an additional argument that allows changes to apply, 226window sizes now have an additional argument that allows changes to apply,
227or values to be returned, in pixels instead of lines/columns. 227or 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
231count partially visible lines or columns if called with a nil PIXELWISE
232argument.
233
229*** Emacs can now draw dividers between adjacent windows. To put 234*** Emacs can now draw dividers between adjacent windows. To put
230dividers between side-by-side/vertically stacked windows customize the 235dividers between side-by-side/vertically stacked windows customize the
231frame parameters `right-divider-width' and `bottom-divider-width' to 236frame 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
247window to its buffer as it will be displayed. 252window 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.
250This behavior is controlled by the new option 255This 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
254This behavior is controlled by the option `fit-frame-to-buffer' which 260options `fit-frame-to-buffer-margins' and `fit-frame-to-buffer-sizes'
255tells 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
257control the size of the frame and its position on screen. 261control 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 @@
12014-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
12014-03-06 Michael Albinus <michael.albinus@gmx.de> 102014-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.
6817A frame is fit if and only if its root window is a live window 6817A frame is fit if and only if its root window is a live window
6818and this option is non-nil. If this is `horizontally', frames 6818and this option is non-nil. If this is `horizontally', frames
6819are resized horizontally only. If this is `vertically', frames 6819are resized horizontally only. If this is `vertically', frames
6820are resized vertically only. Any other non-nil value means 6820are resized vertically only. Any other non-nil value means
6821frames can be resized in both dimensions. See also 6821frames can be resized in both dimensions."
6822`fit-frame-to-buffer-margins' and `fit-frame-to-buffer-sizes'.
6823
6824If 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
6826the 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'.
6833This list specifies the numbers of pixels to be left free on the 6828This option allows to specify the numbers of pixels to be left
6834left, above, the right, and below a frame that shall be fit to 6829free on the left, above, the right, and below a frame that shall
6835its buffer. The value specified here can be overridden for a 6830be fit to its buffer. Set these to avoid that such a frame
6836specific frame by that frame's `fit-frame-to-buffer-margins' 6831obscurs other desktop objects like the taskbar. The default is
6837parameter, if present. 6832nil for each side which means to not add any margins.
6838 6833
6839This variable controls how fitting a frame to the size of its 6834The value specified here can be overridden for a specific frame
6840buffer coordinates with the size of your display. If you don't 6835by that frame's `fit-frame-to-buffer-margins' parameter, if
6841specify a value here, the size of the display's workarea is used. 6836present. See also `fit-frame-to-buffer-sizes'."
6842
6843See 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.
6922FRAME can be any live frame and defaults to the selected one. 6915FRAME can be any live frame and defaults to the selected one.
6923Fit only if FRAME's root window is live. MAX-HEIGHT, MIN-HEIGHT, 6916Fit 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
6925FRAME's root window. MIN-HEIGHT and MIN-WIDTH default to the values of 6918FRAME'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
6928The option `fit-frame-to-buffer' controls whether this function 6921If the optional argument ONLY is `vertically', resize the frame
6929has any effect. New position and size of FRAME are additionally 6922vertically only. If ONLY is `horizontally', resize the frame
6930determined by the options `fit-frame-to-buffer-sizes' and 6923horizontally only.
6924
6925The new position and size of FRAME can be additionally determined
6926by 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
6932FRAME." 6928FRAME."
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."
7141WINDOW must be a live window and defaults to the selected one. 7131WINDOW must be a live window and defaults to the selected one.
7142 7132
7143If WINDOW is part of a vertical combination, adjust WINDOW's 7133If WINDOW is part of a vertical combination, adjust WINDOW's
7144height. The new height is calculated from the number of lines of 7134height. The new height is calculated from the actual height of
7145the accessible portion of its buffer. The optional argument 7135the accessible portion of its buffer. The optional argument
7146MAX-HEIGHT specifies a maximum height and defaults to the height 7136MAX-HEIGHT specifies a maximum height and defaults to the height
7147of WINDOW's frame. The optional argument MIN-HEIGHT specifies a 7137of WINDOW's frame. The optional argument MIN-HEIGHT specifies a
7148minimum height and defaults to `window-min-height'. Both 7138minimum height and defaults to `window-min-height'. Both
7149MAX-HEIGHT and MIN-HEIGHT are specified in lines and include the 7139MAX-HEIGHT and MIN-HEIGHT are specified in lines and include mode
7150mode line and header line, if any. 7140and header line and a bottom divider, if any.
7151 7141
7152If WINDOW is part of a horizontal combination and the value of 7142If WINDOW is part of a horizontal combination and the value of
7153the option `fit-window-to-buffer-horizontally' is non-nil, adjust 7143the option `fit-window-to-buffer-horizontally' is non-nil, adjust
@@ -7157,11 +7147,11 @@ start position of WINDOW. The optional argument MAX-WIDTH
7157specifies a maximum width and defaults to the width of WINDOW's 7147specifies a maximum width and defaults to the width of WINDOW's
7158frame. The optional argument MIN-WIDTH specifies a minimum width 7148frame. The optional argument MIN-WIDTH specifies a minimum width
7159and defaults to `window-min-width'. Both MAX-WIDTH and MIN-WIDTH 7149and defaults to `window-min-width'. Both MAX-WIDTH and MIN-WIDTH
7160are specified in columns and include fringes, margins and 7150are specified in columns and include fringes, margins, a
7161scrollbars, if any. 7151scrollbar and a vertical divider, if any.
7162 7152
7163Fit pixelwise if the option `window-resize-pixelwise' is non-nil. 7153Fit pixelwise if the option `window-resize-pixelwise' is non-nil.
7164If WINDOW is its frame's root window, then if the option 7154If 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
7166adjust the frame's size. 7156adjust 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 @@
12014-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
12014-03-06 Dmitry Antipov <dmantipov@yandex.ru> 62014-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);