Mercurial > emacs
changeset 8240:363f719d47a5
(resize-minibuffer-setup): Copy post-command-hook when handling minibuffer
windows in other frames, not just minibuffer-exclusive frames.
Resize the minibuffer window/frame now, in case it has already been
initialized with text.
author | Noah Friedman <friedman@splode.com> |
---|---|
date | Wed, 13 Jul 1994 17:19:23 +0000 |
parents | dffc08bd2ab6 |
children | a16dfe068972 |
files | lisp/rsz-mini.el |
diffstat | 1 files changed, 20 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/rsz-mini.el Wed Jul 13 15:14:02 1994 +0000 +++ b/lisp/rsz-mini.el Wed Jul 13 17:19:23 1994 +0000 @@ -7,7 +7,7 @@ ;;; Maintainer: friedman@prep.ai.mit.edu ;;; Keywords: minibuffer, window, frame, display ;;; Status: Known to work in FSF GNU Emacs 19.26 and later. -;;; $Id: rsz-mini.el,v 1.5 1994/06/30 06:46:44 friedman Exp rms $ +;;; $Id: rsz-mini.el,v 1.6 1994/07/12 19:51:30 rms Exp friedman $ ;; This file is part of GNU Emacs. @@ -142,25 +142,36 @@ (cond ((and window-system (eq 'only (cdr (assq 'minibuffer (frame-parameters))))) + ;; Checking for resize-minibuffer-frame is done outside the cond + ;; predicate because that should always be t if this is a minibuffer + ;; frame; it just shouldn't do anything if this flag is nil. (and resize-minibuffer-frame (progn - ;; Squirrel away the current height of the frame so we can - ;; restore it later. We do this rather than trusting the - ;; value in minibuffer-frame-alist since the frame can be - ;; resized by the window manager and that variable isn't updated. + ;; Can't trust the height stored in minibuffer-frame-alist + ;; since the frame can be resized by the window manager and + ;; that variable isn't updated. (make-local-variable 'resize-minibuffer-frame-original-height) (setq resize-minibuffer-frame-original-height (frame-height)) - (make-local-variable 'minibuffer-exit-hook) - (add-hook 'minibuffer-exit-hook 'resize-minibuffer-frame-restore) + (make-local-variable 'post-command-hook) ;; Copy this because add-hook modifies the list structure. (setq post-command-hook (copy-sequence post-command-hook)) - (add-hook 'post-command-hook 'resize-minibuffer-frame 'append)))) + (add-hook 'post-command-hook 'resize-minibuffer-frame 'append) + + (make-local-variable 'minibuffer-exit-hook) + (add-hook 'minibuffer-exit-hook 'resize-minibuffer-frame-restore) + + (resize-minibuffer-frame)))) (t (make-local-variable 'post-command-hook) + ;; Copy this because add-hook modifies the list structure. + (setq post-command-hook (copy-sequence post-command-hook)) (add-hook 'post-command-hook 'resize-minibuffer-window 'append) + (make-local-variable 'minibuffer-exit-hook) - (add-hook 'minibuffer-exit-hook 'resize-minibuffer-window-restore)))))) + (add-hook 'minibuffer-exit-hook 'resize-minibuffer-window-restore) + + (resize-minibuffer-window)))))) (defun resize-minibuffer-count-window-lines (&optional start end) "Return number of window lines occupied by text in region.