Mercurial > hg > xemacs-beta
diff lisp/prim/frame.el @ 44:8d2a9b52c682 r19-15prefinal
Import from CVS: tag r19-15prefinal
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:55:10 +0200 |
parents | ec9a17fef872 |
children | 56c54cf7c5b6 |
line wrap: on
line diff
--- a/lisp/prim/frame.el Mon Aug 13 08:54:52 2007 +0200 +++ b/lisp/prim/frame.el Mon Aug 13 08:55:10 2007 +0200 @@ -1022,6 +1022,9 @@ (defvar temp-buffer-shrink-to-fit t "*When non-nil resize temporary output buffers to minimize blank lines.") +(defvar temp-buffer-max-height .5 + "*Proportion of frame to use for temp windows.") + (defun show-temp-buffer-in-current-frame (buffer) "For use as the value of temp-buffer-show-function: always displays the buffer in the current frame, regardless of the behavior @@ -1036,7 +1039,12 @@ (set-window-start window 1) ; obeys narrowing (set-window-point window 1) (when temp-buffer-shrink-to-fit - (shrink-window-if-larger-than-buffer window)) + (let* ((temp-window-size (round (* temp-buffer-max-height + (frame-height (window-frame window))))) + (size (window-displayed-height window))) + (when (< size temp-window-size) + (enlarge-window (- temp-window-size size) nil window))) + (shrink-window-if-larger-than-buffer window)) nil))) (setq pre-display-buffer-function 'get-frame-for-buffer)