summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2005-06-08 15:54:43 +0000
committerRichard M. Stallman <rms@gnu.org>2005-06-08 15:54:43 +0000
commita566ce8e096a523858948d3f4a565a2a57ff644c (patch)
tree3890cc068a240dbb90ef29414317b56234d2c605 /lisp/emacs-lisp
parent96a017e43c9def35c67385759d769a064b6bf5c8 (diff)
downloademacs-a566ce8e096a523858948d3f4a565a2a57ff644c.tar.gz
(define-minor-mode): If BODY is empty, give the variable a doc string
that doesn't say don't set it directly.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/easy-mmode.el15
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))
(let ((curfile (or (and (boundp 'byte-compile-current-file)
byte-compile-current-file)
- load-file-name)))
- `(defcustom ,mode ,init-value
- ,(format "Non-nil if %s is enabled.
+ load-file-name))
+ base-doc-string)
+ (setq base-doc-string "Non-nil if %s is enabled.
See the command `%s' for a description of this minor-mode.
Setting this variable directly does not take effect;
-use either \\[customize] or the function `%s'."
- pretty-name mode mode)
+use either \\[customize] or the function `%s'.")
+ (if (null body)
+ (setq base-doc-string "Non-nil if %s is enabled.
+See the command `%s' for a description of this minor-mode."))
+
+ `(defcustom ,mode ,init-value
+ ,(format base-doc-string pretty-name mode mode)
:set 'custom-set-minor-mode
:initialize 'custom-initialize-default
,@group