X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fframe.el;h=d9c8b98ca467102c8d818124a633a6c6c742b36b;hb=a3c8db1e07b33da64b3af89f0c8923619e8e1ee4;hp=f13e517587daf13ad330230748bd1c62fbe91aec;hpb=98a6e4055a1fa624c592ac06f79287d55196ca37;p=chise%2Fxemacs-chise.git.1 diff --git a/lisp/frame.el b/lisp/frame.el index f13e517..d9c8b98 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -451,6 +451,7 @@ tty A standard TTY connection or terminal. CONNECTION should be the Unix command `tty') or nil for XEmacs' standard input and output (usually the TTY in which XEmacs started). Only if support for TTY's was compiled into XEmacs. +gtk A GTK device. ns A connection to a machine running the NeXTstep windowing system. Not currently implemented. mswindows A connection to a machine running Microsoft Windows NT or @@ -1030,7 +1031,8 @@ This is a subroutine of `get-frame-for-buffer' (which see)." ;; The pre-display-buffer-function is called for effect, so this needs to ;; actually select the frame it wants. Fdisplay_buffer() takes notice of ;; changes to the selected frame. -(defun get-frame-for-buffer (buffer &optional not-this-window-p on-frame) +(defun get-frame-for-buffer (buffer &optional not-this-window-p on-frame + shrink-to-fit) "Select and return a frame in which to display BUFFER. Normally, the buffer will simply be displayed in the selected frame. But if the symbol naming the major-mode of the buffer has a 'frame-name @@ -1109,20 +1111,13 @@ always displays the buffer in the selected frame, regardless of the behavior that would otherwise be introduced by the `pre-display-buffer-function', which is normally set to `get-frame-for-buffer' (which see)." (let ((pre-display-buffer-function nil)) ; turn it off, whatever it is - (let ((window (display-buffer buffer))) + (let ((window (display-buffer buffer nil nil temp-buffer-shrink-to-fit))) (if (not (eq (last-nonminibuf-frame) (window-frame window))) ;; only the pre-display-buffer-function should ever do this. (error "display-buffer switched frames on its own!!")) (setq minibuffer-scroll-window window) (set-window-start window 1) ; obeys narrowing (set-window-point window 1) - (when temp-buffer-shrink-to-fit - (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)