diff options
| author | Gerd Moellmann | 2000-04-26 18:50:09 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-04-26 18:50:09 +0000 |
| commit | b35bd33d35439b9cca056406c2de619e58ee4802 (patch) | |
| tree | 36c894c834b0023edf9a29fd0db52a4c9762ca27 | |
| parent | 24d744ac9ce4bd91b6125fd108d037f7d8ec9db3 (diff) | |
| download | emacs-b35bd33d35439b9cca056406c2de619e58ee4802.tar.gz emacs-b35bd33d35439b9cca056406c2de619e58ee4802.zip | |
(add-minor-mode): Make argument MAP optional.
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/subr.el | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4a74c6b1e02..da420073e04 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2000-04-26 Gerd Moellmann <gerd@gnu.org> | 1 | 2000-04-26 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * subr.el (add-minor-mode): Make argument MAP optional. | ||
| 4 | |||
| 3 | * desktop.el (desktop-save): Save list of minor modes. | 5 | * desktop.el (desktop-save): Save list of minor modes. |
| 4 | (desktop-create-buffer): Restore minor modes. | 6 | (desktop-create-buffer): Restore minor modes. |
| 5 | (desktop-minor-mode-table): New user-option. | 7 | (desktop-minor-mode-table): New user-option. |
diff --git a/lisp/subr.el b/lisp/subr.el index fd2f968dc20..e8ba1afe5e5 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." | |||
| 1486 | file)) | 1486 | file)) |
| 1487 | 1487 | ||
| 1488 | 1488 | ||
| 1489 | (defun add-minor-mode (symbol name map) | 1489 | (defun add-minor-mode (symbol name &optional map) |
| 1490 | "Register a new minor mode. | 1490 | "Register a new minor mode. |
| 1491 | SYMBOL is the name of a buffer-local variable that is toggled on | 1491 | SYMBOL is the name of a buffer-local variable that is toggled on |
| 1492 | or off to say whether the minor mode is active or not. NAME is the | 1492 | or off to say whether the minor mode is active or not. NAME is the |
| 1493 | string that will appear in the mode line when the minor mode is | 1493 | string that will appear in the mode line when the minor mode is |
| 1494 | active. MAP is the keymap for the minor mode." | 1494 | active. Optional MAP is the keymap for the minor mode." |
| 1495 | (make-local-variable symbol) | 1495 | (make-local-variable symbol) |
| 1496 | (setq symbol t) | 1496 | (setq symbol t) |
| 1497 | (unless (assq symbol minor-mode-alist) | 1497 | (unless (assq symbol minor-mode-alist) |
| 1498 | (add-to-list 'minor-mode-alist (list symbol name))) | 1498 | (add-to-list 'minor-mode-alist (list symbol name))) |
| 1499 | (unless (assq symbol minor-mode-map-alist) | 1499 | (when (and map (not (assq symbol minor-mode-map-alist))) |
| 1500 | (add-to-list 'minor-mode-map-alist (cons symbol map)))) | 1500 | (add-to-list 'minor-mode-map-alist (cons symbol map)))) |
| 1501 | 1501 | ||
| 1502 | 1502 | ||