(define-minor-mode): If BODY is empty, give the variable a doc string
that doesn't say don't set it directly.
This commit is contained in:
parent
96a017e43c
commit
a566ce8e09
1 changed files with 10 additions and 5 deletions
|
@ -183,13 +183,18 @@ Use the command `%s' to change this variable." pretty-name mode))
|
||||||
|
|
||||||
(let ((curfile (or (and (boundp 'byte-compile-current-file)
|
(let ((curfile (or (and (boundp 'byte-compile-current-file)
|
||||||
byte-compile-current-file)
|
byte-compile-current-file)
|
||||||
load-file-name)))
|
load-file-name))
|
||||||
`(defcustom ,mode ,init-value
|
base-doc-string)
|
||||||
,(format "Non-nil if %s is enabled.
|
(setq base-doc-string "Non-nil if %s is enabled.
|
||||||
See the command `%s' for a description of this minor-mode.
|
See the command `%s' for a description of this minor-mode.
|
||||||
Setting this variable directly does not take effect;
|
Setting this variable directly does not take effect;
|
||||||
use either \\[customize] or the function `%s'."
|
use either \\[customize] or the function `%s'.")
|
||||||
pretty-name mode mode)
|
(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
|
:set 'custom-set-minor-mode
|
||||||
:initialize 'custom-initialize-default
|
:initialize 'custom-initialize-default
|
||||||
,@group
|
,@group
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue