Fix bug in the state cache mechanism. Remove 'BOD "strategy". Refactor.
[bpt/emacs.git] / lisp / help.el
index 0df9c60..4219dd8 100644 (file)
@@ -1,6 +1,7 @@
 ;;; help.el --- help commands for Emacs
 
-;; Copyright (C) 1985-1986, 1993-1994, 1998-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1993-1994, 1998-2013 Free Software
+;; Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: help, internal
@@ -979,7 +980,7 @@ buffer, and should return a positive integer.  At the time the
 function is called, the window to be resized is selected."
   :type '(choice integer function)
   :group 'help
-  :version "24.2")
+  :version "24.3")
 
 (define-minor-mode temp-buffer-resize-mode
   "Toggle auto-resizing temporary buffer windows (Temp Buffer Resize Mode).
@@ -1012,8 +1013,8 @@ WINDOW can be any live window and defaults to the selected one.
 
 Do not make WINDOW higher than `temp-buffer-max-height' nor
 smaller than `window-min-height'.  Do nothing if WINDOW is not
-vertically combined or some of its contents are scrolled out of
-view."
+vertically combined, some of its contents are scrolled out of
+view, or WINDOW was not created by `display-buffer'."
   (setq window (window-normalize-window window t))
   (let ((buffer-name (buffer-name (window-buffer window))))
     (let ((height (if (functionp temp-buffer-max-height)
@@ -1022,11 +1023,12 @@ view."
                    temp-buffer-max-height))
          (quit-cadr (cadr (window-parameter window 'quit-restore))))
       (cond
-       ;; Don't resize WINDOW if it showed another buffer before.
+       ;; Resize WINDOW iff it was split off by `display-buffer'.
        ((and (eq quit-cadr 'window)
             (pos-visible-in-window-p (point-min) window)
             (window-combined-p window))
        (fit-window-to-buffer window height))
+       ;; Resize FRAME iff it was created by `display-buffer'.
        ((and fit-frame-to-buffer
             (eq quit-cadr 'frame)
             (eq window (frame-root-window window)))