comparison lisp/prim/frame.el @ 98:0d2f883870bc r20-1b1

Import from CVS: tag r20-1b1
author cvs
date Mon, 13 Aug 2007 09:13:56 +0200
parents 1ce6082ce73f
children 360340f9fd5f
comparison
equal deleted inserted replaced
97:498bf5da1c90 98:0d2f883870bc
1020 1020
1021 (if save-frame 1021 (if save-frame
1022 (append (list save-frame) frames) 1022 (append (list save-frame) frames)
1023 frames))) 1023 frames)))
1024 1024
1025 (defvar temp-buffer-shrink-to-fit t
1026 "*When non-nil resize temporary output buffers to minimize blank lines.")
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)."
1033 ;; only the pre-display-buffer-function should ever do this. 1036 ;; only the pre-display-buffer-function should ever do this.
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 (shrink-window-if-larger-than-buffer window) 1041 (when temp-buffer-shrink-to-fit
1042 (shrink-window-if-larger-than-buffer window))
1039 nil))) 1043 nil)))
1040 1044
1041 (setq pre-display-buffer-function 'get-frame-for-buffer) 1045 (setq pre-display-buffer-function 'get-frame-for-buffer)
1042 (setq temp-buffer-show-function 'show-temp-buffer-in-current-frame) 1046 (setq temp-buffer-show-function 'show-temp-buffer-in-current-frame)
1043 1047