diff options
author | Noah Friedman <friedman@splode.com> | 1994-07-13 17:19:23 +0000 |
---|---|---|
committer | Noah Friedman <friedman@splode.com> | 1994-07-13 17:19:23 +0000 |
commit | bab863c394701196217116c2c1214111860756c9 (patch) | |
tree | aa21de9e8c6ba5671cb6c53726b88a8386821a28 /lisp/rsz-mini.el | |
parent | 14fd63950c82cc0bad259848a558a4c9b5ededa3 (diff) | |
download | emacs-bab863c394701196217116c2c1214111860756c9.tar.gz |
(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.
Diffstat (limited to 'lisp/rsz-mini.el')
-rw-r--r-- | lisp/rsz-mini.el | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/lisp/rsz-mini.el b/lisp/rsz-mini.el index a55ab90ac4d..5ea3bc787ef 100644 --- a/lisp/rsz-mini.el +++ b/lisp/rsz-mini.el @@ -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 @@ counterparts." (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. |