From: Gerd Moellmann Date: Wed, 26 Apr 2000 17:33:40 +0000 (+0000) Subject: (add-minor-mode): New function. X-Git-Tag: emacs-pretest-21.0.90~4132 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d7d47268cc8f5df63e1d68fedce83f91127d8074;p=emacs.git (add-minor-mode): New function. --- diff --git a/lisp/subr.el b/lisp/subr.el index 88526bd98cc..fd2f968dc20 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1485,4 +1485,19 @@ If DIR-FLAG is non-nil, create a new empty directory instead of a file." 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