Mercurial > emacs
comparison lisp/emacs-lisp/easy-mmode.el @ 20852:51fc8872fa32
(easy-mmode-define-minor-mode): Fix
the doc strings used for the mode flag variable and the keymap.
Delete duplicate &optional's.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 06 Feb 1998 06:12:29 +0000 |
parents | 7e14277c51f3 |
children | 80bfa3fcb7fb |
comparison
equal
deleted
inserted
replaced
20851:26c5d61bc3fd | 20852:51fc8872fa32 |
---|---|
117 (and ,hook-off | 117 (and ,hook-off |
118 (not ,mode) | 118 (not ,mode) |
119 (run-hooks ',hook-off))))))) | 119 (run-hooks ',hook-off))))))) |
120 | 120 |
121 ;;;###autoload | 121 ;;;###autoload |
122 (defmacro easy-mmode-define-minor-mode | 122 (defmacro easy-mmode-define-minor-mode (mode doc &optional init-value lighter keymap) |
123 (mode doc &optional init-value &optional lighter &optional keymap) | |
124 "Define a new minor mode MODE. | 123 "Define a new minor mode MODE. |
125 This function defines the associated control variable, keymap, | 124 This function defines the associated control variable, keymap, |
126 toggle command, and hooks (see `easy-mmode-define-toggle'). | 125 toggle command, and hooks (see `easy-mmode-define-toggle'). |
127 | 126 |
128 DOC is the documentation for the mode toggle command. | 127 DOC is the documentation for the mode toggle command. |
130 Optional KEYMAP is the default (defvar) keymap bound to the mode keymap. | 129 Optional KEYMAP is the default (defvar) keymap bound to the mode keymap. |
131 If it is a list, it is passed to `easy-mmode-define-keymap' | 130 If it is a list, it is passed to `easy-mmode-define-keymap' |
132 in order to build a valid keymap. | 131 in order to build a valid keymap. |
133 | 132 |
134 \(defmacro easy-mmode-define-minor-mode | 133 \(defmacro easy-mmode-define-minor-mode |
135 (MODE DOC &optional INIT-VALUE &optional LIGHTER &optional KEYMAP)...\)" | 134 (MODE DOC &optional INIT-VALUE LIGHTER KEYMAP)...\)" |
136 (let* ((mode-name (symbol-name mode)) | 135 (let* ((mode-name (symbol-name mode)) |
137 (mode-doc (format "%s mode control switch." mode-name)) | 136 (mode-doc (format "Non-nil if %s mode is enabled.")) |
138 (keymap-name (concat mode-name "-map")) | 137 (keymap-name (concat mode-name "-map")) |
139 (keymap-doc (format "Keymap activated when %s mode is on." mode-name))) | 138 (keymap-doc (format "Keymap for %s mode." mode-name))) |
140 `(progn | 139 `(progn |
141 ;; define the switch | 140 ;; define the switch |
142 (defvar ,mode ,init-value ,mode-doc) | 141 (defvar ,mode ,init-value ,mode-doc) |
143 (make-variable-buffer-local ',mode) | 142 (make-variable-buffer-local ',mode) |
144 | 143 |