From 6439ae19665a12bd0a88a4a0fb7f38fa8c47504d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 16 Nov 2012 20:33:26 -0500 Subject: [PATCH] Document fit-frame-to-buffer * doc/lispref/frames.texi (Size and Position): Add fit-frame-to-buffer command. * doc/lispref/windows.texi (Resizing Windows): Add fit-frame-to-buffer option. (Window Sizes): Add vindex for window-min-height, window-min-width. * etc/NEWS: Related markup. --- doc/lispref/ChangeLog | 6 ++++++ doc/lispref/frames.texi | 15 +++++++++++++++ doc/lispref/windows.texi | 6 ++++++ etc/NEWS | 3 +++ 4 files changed, 30 insertions(+) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 062692ee9f3..b7baac9c2fe 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,9 @@ +2012-11-17 Glenn Morris + + * frames.texi (Size and Position): Add fit-frame-to-buffer command. + * windows.texi (Resizing Windows): Add fit-frame-to-buffer option. + (Window Sizes): Add vindex for window-min-height, window-min-width. + 2012-11-16 Martin Rudalics * windows.texi (Choosing Window): Rewrite description of diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 27d55c4fdb9..846dfbaf17c 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -1113,6 +1113,21 @@ The argument @var{pretend} has the same meaning as in @code{set-frame-height}. @end defun +@c FIXME? Belongs more in Emacs manual than here? +@c But eg fit-window-to-buffer is in this manual. +@deffn Command fit-frame-to-buffer &optional frame max-height min-height +This command adjusts the height of @var{frame} (the default is the +selected frame) to fit its contents. The optional arguments +@var{max-height} and @var{min-height} specify the maximum and minimum +new frame heights, respectively. + +@vindex fit-frame-to-buffer-bottom-margin +The default minimum height corresponds to @code{window-min-height}. +The default maximum height is the screen height below the current top +position of the frame, minus any margin specified by the option +@code{fit-frame-to-buffer-bottom-margin}. +@end deffn + @node Geometry @subsection Geometry diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 77f1ff9a179..9a5c7f053e6 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -490,6 +490,8 @@ partially-visible line at the bottom of the text area is not counted. aliases are considered obsolete and will be removed in the future. @cindex fixed-size window +@vindex window-min-height +@vindex window-min-width Commands that change the size of windows (@pxref{Resizing Windows}), or split them (@pxref{Splitting Windows}), obey the variables @code{window-min-height} and @code{window-min-width}, which specify @@ -633,6 +635,10 @@ variable @code{window-min-height}. If the optional argument @var{override} is non-@code{nil}, this function ignores any size restrictions imposed by @code{window-min-height} and @code{window-min-width}. + +@vindex fit-frame-to-buffer +If the option @code{fit-frame-to-buffer} is non-@code{nil}, this +command may resize the frame to fit its contents. @end deffn @deffn Command shrink-window-if-larger-than-buffer &optional window diff --git a/etc/NEWS b/etc/NEWS index 3bd4ebae4fa..a951677bd1d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -848,12 +848,15 @@ now accept a third argument to avoid choosing the selected window. *** New macro `with-temp-buffer-window'. +--- *** `temp-buffer-resize-mode' no longer resizes windows that have been reused. ++++ *** New command `fit-frame-to-buffer' adjusts the frame height to fit the contents. ++++ *** The command `fit-window-to-buffer' can adjust the frame height if the new option `fit-frame-to-buffer' is non-nil. -- 2.39.2