comparison 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
comparison
equal deleted inserted replaced
43:23cafc5d2038 44:8d2a9b52c682
1020 frames))) 1020 frames)))
1021 1021
1022 (defvar temp-buffer-shrink-to-fit t 1022 (defvar temp-buffer-shrink-to-fit t
1023 "*When non-nil resize temporary output buffers to minimize blank lines.") 1023 "*When non-nil resize temporary output buffers to minimize blank lines.")
1024 1024
1025 (defvar temp-buffer-max-height .5
1026 "*Proportion of frame to use for temp windows.")
1027
1025 (defun show-temp-buffer-in-current-frame (buffer) 1028 (defun show-temp-buffer-in-current-frame (buffer)
1026 "For use as the value of temp-buffer-show-function: 1029 "For use as the value of temp-buffer-show-function:
1027 always displays the buffer in the current frame, regardless of the behavior 1030 always displays the buffer in the current frame, regardless of the behavior
1028 that would otherwise be introduced by the `pre-display-buffer-function', which 1031 that would otherwise be introduced by the `pre-display-buffer-function', which
1029 is normally set to `get-frame-for-buffer' (which see)." 1032 is normally set to `get-frame-for-buffer' (which see)."
1034 (error "display-buffer switched frames on its own!!")) 1037 (error "display-buffer switched frames on its own!!"))
1035 (setq minibuffer-scroll-window window) 1038 (setq minibuffer-scroll-window window)
1036 (set-window-start window 1) ; obeys narrowing 1039 (set-window-start window 1) ; obeys narrowing
1037 (set-window-point window 1) 1040 (set-window-point window 1)
1038 (when temp-buffer-shrink-to-fit 1041 (when temp-buffer-shrink-to-fit
1039 (shrink-window-if-larger-than-buffer window)) 1042 (let* ((temp-window-size (round (* temp-buffer-max-height
1043 (frame-height (window-frame window)))))
1044 (size (window-displayed-height window)))
1045 (when (< size temp-window-size)
1046 (enlarge-window (- temp-window-size size) nil window)))
1047 (shrink-window-if-larger-than-buffer window))
1040 nil))) 1048 nil)))
1041 1049
1042 (setq pre-display-buffer-function 'get-frame-for-buffer) 1050 (setq pre-display-buffer-function 'get-frame-for-buffer)
1043 (setq temp-buffer-show-function 'show-temp-buffer-in-current-frame) 1051 (setq temp-buffer-show-function 'show-temp-buffer-in-current-frame)
1044 1052