comparison lisp/help.el @ 78418:c43bd3dbaa93

(resize-temp-buffer-window): Use window-full-width-p instead of comparing frame-width and window-width.
author Martin Rudalics <rudalics@gmx.at>
date Mon, 06 Aug 2007 06:49:49 +0000
parents 9355f9b7bbff
children d91beda3b06e 424b655804ca
comparison
equal deleted inserted replaced
78417:f992ef3a763a 78418:c43bd3dbaa93
956 ;; text size, so `resize-temp-buffer-window' must be run *after* it. 956 ;; text size, so `resize-temp-buffer-window' must be run *after* it.
957 (add-hook 'temp-buffer-show-hook 'resize-temp-buffer-window 'append) 957 (add-hook 'temp-buffer-show-hook 'resize-temp-buffer-window 'append)
958 (remove-hook 'temp-buffer-show-hook 'resize-temp-buffer-window))) 958 (remove-hook 'temp-buffer-show-hook 'resize-temp-buffer-window)))
959 959
960 (defun resize-temp-buffer-window () 960 (defun resize-temp-buffer-window ()
961 "Resize the current window to fit its contents. 961 "Resize the selected window to fit its contents.
962 Will not make it higher than `temp-buffer-max-height' nor smaller than 962 Will not make it higher than `temp-buffer-max-height' nor smaller than
963 `window-min-height'. Do nothing if it is the only window on its frame, if it 963 `window-min-height'. Do nothing if it is the only window on its frame, if it
964 is not as wide as the frame or if some of the window's contents are scrolled 964 is not as wide as the frame or if some of the window's contents are scrolled
965 out of view." 965 out of view."
966 (unless (or (one-window-p 'nomini) 966 (unless (or (one-window-p 'nomini)
967 (not (pos-visible-in-window-p (point-min))) 967 (not (pos-visible-in-window-p (point-min)))
968 (/= (frame-width) (window-width))) 968 (not (window-full-width-p)))
969 (fit-window-to-buffer 969 (fit-window-to-buffer
970 (selected-window) 970 (selected-window)
971 (if (functionp temp-buffer-max-height) 971 (if (functionp temp-buffer-max-height)
972 (funcall temp-buffer-max-height (current-buffer)) 972 (funcall temp-buffer-max-height (current-buffer))
973 temp-buffer-max-height)))) 973 temp-buffer-max-height))))