Mercurial > emacs
changeset 28728:6a62e5ca503e
(add-minor-mode): Make argument MAP optional.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 26 Apr 2000 18:49:05 +0000 |
parents | 1a87cdb8289a |
children | 466ad2113a59 |
files | lisp/subr.el |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/subr.el Wed Apr 26 18:41:05 2000 +0000 +++ b/lisp/subr.el Wed Apr 26 18:49:05 2000 +0000 @@ -1486,17 +1486,17 @@ file)) -(defun add-minor-mode (symbol name map) +(defun add-minor-mode (symbol name &optional 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." +active. Optional 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) + (when (and map (not (assq symbol minor-mode-map-alist))) (add-to-list 'minor-mode-map-alist (cons symbol map))))