changeset 21269:b25d5f1dd2de

(resize-minibuffer-mode): Make it a proper minor mode: toggle resize-minibuffer mode when called without argument.
author Andreas Schwab <schwab@suse.de>
date Mon, 23 Mar 1998 13:18:54 +0000
parents 74fc1642fe30
children 3f500b8d6964
files lisp/rsz-mini.el
diffstat 1 files changed, 9 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/rsz-mini.el	Mon Mar 23 13:02:15 1998 +0000
+++ b/lisp/rsz-mini.el	Mon Mar 23 13:18:54 1998 +0000
@@ -7,7 +7,7 @@
 ;; Maintainer: friedman@prep.ai.mit.edu
 ;; Keywords: minibuffer, window, frame, display
 
-;; $Id: rsz-mini.el,v 1.17 1997/06/23 08:21:26 friedman Exp rms $
+;; $Id: rsz-mini.el,v 1.18 1998/01/03 07:17:25 rms Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -118,9 +118,9 @@
 
 ;;;###autoload
 (defun resize-minibuffer-mode (&optional prefix)
-  "Enable or disable resize-minibuffer mode.
-A negative prefix argument disables this mode.  A positive argument or
-argument of 0 enables it.
+  "Toggle resize-minibuffer mode.
+With argument, enable resize-minibuffer mode if and only if argument
+is positive.
 
 When this minor mode is enabled, the minibuffer is dynamically resized to
 contain the entire region of text put in it as you type.
@@ -142,13 +142,11 @@
 done.  The variables `resize-minibuffer-frame-max-height' and
 `resize-minibuffer-frame-exactly' are analogous to their window
 counterparts."
-  (interactive "p")
-  (or prefix (setq prefix 0))
-  (cond
-   ((>= prefix 0)
-    (setq resize-minibuffer-mode t))
-   (t
-    (setq resize-minibuffer-mode nil)))
+  (interactive "P")
+  (setq resize-minibuffer-mode
+	(if prefix
+	    (> (prefix-numeric-value prefix) 0)
+	  (not resize-minibuffer-mode)))
   (add-hook 'minibuffer-setup-hook 'resize-minibuffer-setup))
 
 (defun resize-minibuffer-setup ()