Mercurial > hg > xemacs-beta
comparison 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 |
comparison
equal
deleted
inserted
replaced
115:f109f7dabbe2 | 116:9f59509498e1 |
---|---|
1032 frames))) | 1032 frames))) |
1033 | 1033 |
1034 (defvar temp-buffer-shrink-to-fit t | 1034 (defvar temp-buffer-shrink-to-fit t |
1035 "*When non-nil resize temporary output buffers to minimize blank lines.") | 1035 "*When non-nil resize temporary output buffers to minimize blank lines.") |
1036 | 1036 |
1037 (defvar temp-buffer-max-height .5 | |
1038 "*Proportion of frame to use for temp windows.") | |
1039 | |
1037 (defun show-temp-buffer-in-current-frame (buffer) | 1040 (defun show-temp-buffer-in-current-frame (buffer) |
1038 "For use as the value of temp-buffer-show-function: | 1041 "For use as the value of temp-buffer-show-function: |
1039 always displays the buffer in the current frame, regardless of the behavior | 1042 always displays the buffer in the current frame, regardless of the behavior |
1040 that would otherwise be introduced by the `pre-display-buffer-function', which | 1043 that would otherwise be introduced by the `pre-display-buffer-function', which |
1041 is normally set to `get-frame-for-buffer' (which see)." | 1044 is normally set to `get-frame-for-buffer' (which see)." |
1046 (error "display-buffer switched frames on its own!!")) | 1049 (error "display-buffer switched frames on its own!!")) |
1047 (setq minibuffer-scroll-window window) | 1050 (setq minibuffer-scroll-window window) |
1048 (set-window-start window 1) ; obeys narrowing | 1051 (set-window-start window 1) ; obeys narrowing |
1049 (set-window-point window 1) | 1052 (set-window-point window 1) |
1050 (when temp-buffer-shrink-to-fit | 1053 (when temp-buffer-shrink-to-fit |
1051 (shrink-window-if-larger-than-buffer window)) | 1054 (let* ((temp-window-size (round (* temp-buffer-max-height |
1055 (frame-height (window-frame window))))) | |
1056 (size (window-displayed-height window))) | |
1057 (when (< size temp-window-size) | |
1058 (enlarge-window (- temp-window-size size) nil window))) | |
1059 (shrink-window-if-larger-than-buffer window)) | |
1052 nil))) | 1060 nil))) |
1053 | 1061 |
1054 (setq pre-display-buffer-function 'get-frame-for-buffer) | 1062 (setq pre-display-buffer-function 'get-frame-for-buffer) |
1055 (setq temp-buffer-show-function 'show-temp-buffer-in-current-frame) | 1063 (setq temp-buffer-show-function 'show-temp-buffer-in-current-frame) |
1056 | 1064 |