aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGerd Moellmann <[email protected]>2000-04-26 18:50:09 +0000
committerGerd Moellmann <[email protected]>2000-04-26 18:50:09 +0000
commitb35bd33d35439b9cca056406c2de619e58ee4802 (patch)
tree36c894c834b0023edf9a29fd0db52a4c9762ca27 /lisp
parent24d744ac9ce4bd91b6125fd108d037f7d8ec9db3 (diff)
(add-minor-mode): Make argument MAP optional.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/subr.el6
2 files changed, 5 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4a74c6b1e0..da420073e0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
2000-04-26 Gerd Moellmann <[email protected]>
+ * subr.el (add-minor-mode): Make argument MAP optional.
+
* desktop.el (desktop-save): Save list of minor modes.
(desktop-create-buffer): Restore minor modes.
(desktop-minor-mode-table): New user-option.
diff --git a/lisp/subr.el b/lisp/subr.el
index fd2f968dc2..e8ba1afe5e 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1486,17 +1486,17 @@ If DIR-FLAG is non-nil, create a new empty directory instead of a file."
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))))