diff options
| author | Richard M. Stallman | 2005-06-08 15:54:43 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-06-08 15:54:43 +0000 |
| commit | a566ce8e096a523858948d3f4a565a2a57ff644c (patch) | |
| tree | 3890cc068a240dbb90ef29414317b56234d2c605 | |
| parent | 96a017e43c9def35c67385759d769a064b6bf5c8 (diff) | |
| download | emacs-a566ce8e096a523858948d3f4a565a2a57ff644c.tar.gz emacs-a566ce8e096a523858948d3f4a565a2a57ff644c.zip | |
(define-minor-mode): If BODY is empty, give the variable a doc string
that doesn't say don't set it directly.
| -rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index bb0fa666217..a342f8a5530 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el | |||
| @@ -183,13 +183,18 @@ Use the command `%s' to change this variable." pretty-name mode)) | |||
| 183 | 183 | ||
| 184 | (let ((curfile (or (and (boundp 'byte-compile-current-file) | 184 | (let ((curfile (or (and (boundp 'byte-compile-current-file) |
| 185 | byte-compile-current-file) | 185 | byte-compile-current-file) |
| 186 | load-file-name))) | 186 | load-file-name)) |
| 187 | `(defcustom ,mode ,init-value | 187 | base-doc-string) |
| 188 | ,(format "Non-nil if %s is enabled. | 188 | (setq base-doc-string "Non-nil if %s is enabled. |
| 189 | See the command `%s' for a description of this minor-mode. | 189 | See the command `%s' for a description of this minor-mode. |
| 190 | Setting this variable directly does not take effect; | 190 | Setting this variable directly does not take effect; |
| 191 | use either \\[customize] or the function `%s'." | 191 | use either \\[customize] or the function `%s'.") |
| 192 | pretty-name mode mode) | 192 | (if (null body) |
| 193 | (setq base-doc-string "Non-nil if %s is enabled. | ||
| 194 | See the command `%s' for a description of this minor-mode.")) | ||
| 195 | |||
| 196 | `(defcustom ,mode ,init-value | ||
| 197 | ,(format base-doc-string pretty-name mode mode) | ||
| 193 | :set 'custom-set-minor-mode | 198 | :set 'custom-set-minor-mode |
| 194 | :initialize 'custom-initialize-default | 199 | :initialize 'custom-initialize-default |
| 195 | ,@group | 200 | ,@group |