From 3bdb5fb8e0f805f131117505a33889543d79add5 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 16 Aug 2000 19:40:41 +0000 Subject: [PATCH] (msb-mode): Define it in terms of define-minor-mode. --- lisp/msb.el | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/lisp/msb.el b/lisp/msb.el index 463d6edbc8f..119ec7f17f6 100644 --- a/lisp/msb.el +++ b/lisp/msb.el @@ -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 @@ variable `msb-menu-cond'." 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 @@ different buffer menu using the function `msb'." (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)) -- 2.39.2