changeset 30864:904dafa7e039

(msb-mode): Define it in terms of define-minor-mode.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 16 Aug 2000 19:40:41 +0000
parents 38cda0d67a7c
children fb3d8e6e0497
files lisp/msb.el
diffstat 1 files changed, 2 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/msb.el	Wed Aug 16 19:37:26 2000 +0000
+++ b/lisp/msb.el	Wed Aug 16 19:40:41 2000 +0000
@@ -201,19 +201,6 @@
   :prefix "msb-"
   :group 'mouse)
 
-;;;###autoload
-(defcustom msb-mode nil
-  "Toggle msb-mode.
-Setting this variable directly does not take effect;
-use either \\[customize] or the function `msb-mode'."
-  :set (lambda (symbol value)
-	 (msb-mode (or value 0)))
-  :initialize 'custom-initialize-default
-  :version "20.4"
-  :type    'boolean
-  :group   'msb
-  :require 'msb)
-
 (defun msb-custom-set (symbol value)
   "Set the value of custom variables for msb."
   (set symbol value)
@@ -1151,15 +1138,12 @@
     map))
 
 ;;;###autoload
-(defun msb-mode (&optional arg)
+(define-minor-mode msb-mode
   "Toggle Msb mode.
 With arg, turn Msb mode on if and only if arg is positive.
 This mode overrides the binding(s) of `mouse-buffer-menu' to provide a
 different buffer menu using the function `msb'."
-  (interactive "P")
-  (setq msb-mode (if arg
-		     (> (prefix-numeric-value arg) 0)
-		   (not msb-mode)))
+  nil nil nil :global t
   (if msb-mode
       (progn
 	(add-hook 'menu-bar-update-hook 'msb-menu-bar-update-buffers)
@@ -1171,8 +1155,6 @@
 (defun msb-unload-hook ()
   (msb-mode 0))
 
-(add-to-list 'minor-mode-map-alist (cons 'msb-mode msb-mode-map))
-
 (provide 'msb)
 (eval-after-load 'msb (run-hooks 'msb-after-load-hooks))