Commit 94dfee0b authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(define-minor-mode): Simplify.

parent b6790c3e
......@@ -194,27 +194,19 @@ For example, you could write
Use the command `%s' to change this variable." pretty-name mode))
(make-variable-buffer-local ',mode))
(let ((curfile (or (and (boundp 'byte-compile-current-file)
byte-compile-current-file)
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.
(let ((base-doc-string
(concat "Non-nil if %s is enabled.
See the command `%s' for a description of this minor-mode."
(if body "
Setting this variable directly does not take effect;
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."))
use either \\[customize] or the function `%s'."))))
`(defcustom ,mode ,init-value
,(format base-doc-string pretty-name mode mode)
,@set
,@initialize
,@group
,@type
,@(cond
((not (and curfile require)) nil)
((not (eq require t)) `(:require ,require)))
,@(unless (eq require t) `(:require ,require))
,@(nreverse extra-keywords))))
;; The actual function.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment