# HG changeset patch # User Gerd Moellmann # Date 956770420 0 # Node ID f8379b0114764bcb35206880fed8d69574b4236e # Parent f56c181fb8495380f8f3ab1d53c8d6fb278b033a (add-minor-mode): New function. diff -r f56c181fb849 -r f8379b011476 lisp/subr.el --- a/lisp/subr.el Wed Apr 26 17:33:02 2000 +0000 +++ b/lisp/subr.el Wed Apr 26 17:33:40 2000 +0000 @@ -1485,4 +1485,19 @@ nil) file)) + +(defun add-minor-mode (symbol name map) + "Register a new minor mode. +SYMBOL is the name of a buffer-local variable that is toggled on +or off to say whether the minor mode is active or not. NAME is the +string that will appear in the mode line when the minor mode is +active. MAP is the keymap for the minor mode." + (make-local-variable symbol) + (setq symbol t) + (unless (assq symbol minor-mode-alist) + (add-to-list 'minor-mode-alist (list symbol name))) + (unless (assq symbol minor-mode-map-alist) + (add-to-list 'minor-mode-map-alist (cons symbol map)))) + + ;;; subr.el ends here