Mercurial > hg > xemacs-beta
diff lisp/prim/frame.el @ 116:9f59509498e1 r20-1b10
Import from CVS: tag r20-1b10
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:23:06 +0200 |
parents | 360340f9fd5f |
children | cca96a509cfe |
line wrap: on
line diff
--- a/lisp/prim/frame.el Mon Aug 13 09:21:56 2007 +0200 +++ b/lisp/prim/frame.el Mon Aug 13 09:23:06 2007 +0200 @@ -1034,6 +1034,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 @@ -1048,7 +1051,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)