aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-11-16 00:31:20 -0800
committerGlenn Morris2012-11-16 00:31:20 -0800
commit7c82753d4cee69bc63cf19daee89b69873559221 (patch)
treecc18e7148b60e25fbf943b42dd675f57ec634dd0
parentb0634f5d0a5ec5bc97c4d0cc7c8544611cbf0adc (diff)
downloademacs-7c82753d4cee69bc63cf19daee89b69873559221.tar.gz
emacs-7c82753d4cee69bc63cf19daee89b69873559221.zip
Doc fixes related to fit-frame-to-buffer
* lisp/window.el (fit-frame-to-buffer-bottom-margin) (fit-frame-to-buffer, fit-window-to-buffer): Doc fixes. * etc/NEWS: Related edit.
-rw-r--r--etc/NEWS8
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/window.el26
3 files changed, 26 insertions, 11 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 42e773b2a03..3bd4ebae4fa 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -851,8 +851,12 @@ now accept a third argument to avoid choosing the selected window.
851*** `temp-buffer-resize-mode' no longer resizes windows that have been 851*** `temp-buffer-resize-mode' no longer resizes windows that have been
852reused. 852reused.
853 853
854*** New function `fit-frame-to-buffer' and new options 854*** New command `fit-frame-to-buffer' adjusts the frame height to
855`fit-frame-to-buffer' and `fit-frame-to-buffer-bottom-margin'. 855fit the contents.
856
857*** The command `fit-window-to-buffer' can adjust the frame height
858if the new option `fit-frame-to-buffer' is non-nil.
859
856+++ 860+++
857*** New option switch-to-buffer-preserve-window-point to restore a 861*** New option switch-to-buffer-preserve-window-point to restore a
858window's point when switching buffers. 862window's point when switching buffers.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a62288dd29a..74d66809d55 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12012-11-16 Glenn Morris <rgm@gnu.org> 12012-11-16 Glenn Morris <rgm@gnu.org>
2 2
3 * window.el (fit-frame-to-buffer-bottom-margin)
4 (fit-frame-to-buffer, fit-window-to-buffer): Doc fixes.
5
3 * faces.el (face-underline-p): Use face-attribute-specified-or. 6 * faces.el (face-underline-p): Use face-attribute-specified-or.
4 7
52012-11-15 Juanma Barranquero <lekktu@gmail.com> 82012-11-15 Juanma Barranquero <lekktu@gmail.com>
diff --git a/lisp/window.el b/lisp/window.el
index 6ea66d9d0a2..c9ea8351e8c 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -6074,22 +6074,26 @@ of `fit-frame-to-buffer-max-height' and `window-min-height'."
6074 :group 'help) 6074 :group 'help)
6075 6075
6076(defcustom fit-frame-to-buffer-bottom-margin 4 6076(defcustom fit-frame-to-buffer-bottom-margin 4
6077 "Bottom margin for `fit-frame-to-buffer'. 6077 "Bottom margin for the command `fit-frame-to-buffer'.
6078This is the number of lines `fit-frame-to-buffer' leaves free at the 6078This is the number of lines that function leaves free at the bottom of
6079bottom of the display in order to not obscure the system task bar." 6079the display, in order to not obscure any system task bar or panel.
6080If you do not have one (or if it is vertical) you might want to
6081reduce this. If it is thicker, you might want to increase this."
6082 ;; If you set this too small, fit-frame-to-buffer can shift the
6083 ;; frame up to avoid the panel.
6080 :type 'integer 6084 :type 'integer
6081 :version "24.3" 6085 :version "24.3"
6082 :group 'windows) 6086 :group 'windows)
6083 6087
6084(defun fit-frame-to-buffer (&optional frame max-height min-height) 6088(defun fit-frame-to-buffer (&optional frame max-height min-height)
6085 "Adjust height of FRAME to display its buffer's contents exactly. 6089 "Adjust height of FRAME to display its buffer contents exactly.
6086FRAME can be any live frame and defaults to the selected one. 6090FRAME can be any live frame and defaults to the selected one.
6087 6091
6088Optional argument MAX-HEIGHT specifies the maximum height of 6092Optional argument MAX-HEIGHT specifies the maximum height of FRAME.
6089FRAME and defaults to the height of the display below the current 6093It defaults to the height of the display below the current
6090top line of FRAME minus FIT-FRAME-TO-BUFFER-BOTTOM-MARGIN. 6094top line of FRAME, minus `fit-frame-to-buffer-bottom-margin'.
6091Optional argument MIN-HEIGHT specifies the minimum height of 6095Optional argument MIN-HEIGHT specifies the minimum height of FRAME.
6092FRAME." 6096The default corresponds to `window-min-height'."
6093 (interactive) 6097 (interactive)
6094 (setq frame (window-normalize-frame frame)) 6098 (setq frame (window-normalize-frame frame))
6095 (let* ((root (frame-root-window frame)) 6099 (let* ((root (frame-root-window frame))
@@ -6166,6 +6170,10 @@ defaults to `window-min-height'. Both MAX-HEIGHT and MIN-HEIGHT
6166are specified in lines and include the mode line and header line, 6170are specified in lines and include the mode line and header line,
6167if any. 6171if any.
6168 6172
6173If WINDOW is a full height window, then if the option
6174`fit-frame-to-buffer' is non-nil, this calls the function
6175`fit-frame-to-buffer' to adjust the frame height.
6176
6169Return the number of lines by which WINDOW was enlarged or 6177Return the number of lines by which WINDOW was enlarged or
6170shrunk. If an error occurs during resizing, return nil but don't 6178shrunk. If an error occurs during resizing, return nil but don't
6171signal an error. 6179signal an error.