From xemacs-m  Wed Jan 22 14:26:58 1997
Received: from alphatech.com (erebus.alphatech.com [198.112.236.2])
          by xemacs.org (8.8.4/8.8.4) with SMTP
	  id OAA10333 for <xemacs-beta@xemacs.org>; Wed, 22 Jan 1997 14:26:56 -0600 (CST)
Received: from venus.alphatech.com by alphatech.com (4.1/SMI-4.1)
	id AA06082; Wed, 22 Jan 97 15:22:47 EST
Received: from pochacco.alphatech.com by venus.alphatech.com (4.1/SMI-4.1)
	id AA06603; Wed, 22 Jan 97 15:30:02 EST
Received: by pochacco.alphatech.com (SMI-8.6/SMI-SVR4)
	id PAA00782; Wed, 22 Jan 1997 15:21:52 -0500
Date: Wed, 22 Jan 1997 15:21:52 -0500
Message-Id: <199701222021.PAA00782@pochacco.alphatech.com>
From: greg@alphatech.com (Greg Klanderman)
To: xemacs-beta@xemacs.org (XEmacs beta list)
Subject: rsz-minibuf patch
Reply-To: greg@alphatech.com



About a month ago I complained about minibuffer prompts running off
the edge of the screen and not being visible.  Steve suggested
resize-minibuffer-mode which I have been using since.  

In general, I like this package, though it has one shortcoming: The
minibuffer is not resized until the first event is read in the
minibuffer, because rsz-minibuf works by adding a hook to
post-command-hook.  A two line patch is given below.  The solution is
to call the appropriate resize function from resize-minibuffer-setup()
which is already placed on the minibuffer-setup-hook.

Another problem with similar effects is that things like y-or-n-p and
map-y-or-n-p use (display-message) and (next-command-event) directly
and can't benefit from rsz-minibuf.  For example, if you do C-x s and
have a buffer with a long filename unsaved, you see only the beginning
of the prompt, not the question and possible options.  Any solutions
to this one would be much appreciated.  I guess you could use
read-from-minibuffer if you bound the keys 'y' and 'n' to self insert and
then (throw 'exit nil) but that would require more extensive changes
than 2 lines.

Greg


------- patch ------

--- rsz-minibuf.el.orig	Sun Jan 21 17:58:25 1996
+++ rsz-minibuf.el	Wed Jan 22 15:13:59 1997
@@ -159,10 +159,12 @@
 	     (add-hook 'minibuffer-exit-hook 'resize-minibuffer-frame-restore
 		       nil t)
 	     (make-local-hook 'post-command-hook)
-	     (add-hook 'post-command-hook 'resize-minibuffer-frame nil t))))
+	     (add-hook 'post-command-hook 'resize-minibuffer-frame nil t)
+             (resize-minibuffer-frame))))
      (t
       (make-local-hook 'post-command-hook)
-      (add-hook 'post-command-hook 'resize-minibuffer-window nil t))))))
+      (add-hook 'post-command-hook 'resize-minibuffer-window nil t)
+      (resize-minibuffer-window))))))
 
 (defun resize-minibuffer-count-window-lines (&optional start end)
   "Return number of window lines occupied by text in region.

