summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2005-08-24 11:54:25 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2005-08-24 11:54:25 +0000
commit94dfee0bfe7edcd889defb5f5b3b8be93ad3a352 (patch)
treef1ad924319d9c74ab902bd295c2662178702c5c2 /lisp
parentb6790c3eec383718d9918c95e058581f75b1368d (diff)
downloademacs-94dfee0bfe7edcd889defb5f5b3b8be93ad3a352.tar.gz
emacs-94dfee0bfe7edcd889defb5f5b3b8be93ad3a352.tar.bz2
emacs-94dfee0bfe7edcd889defb5f5b3b8be93ad3a352.zip
(define-minor-mode): Simplify.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/easy-mmode.el22
1 files changed, 7 insertions, 15 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 09abd272e53..da0ca735efd 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -194,28 +194,20 @@ 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)))
- ,@(nreverse extra-keywords))))
+ ,@(unless (eq require t) `(:require ,require))
+ ,@(nreverse extra-keywords))))
;; The actual function.
(defun ,mode (&optional arg ,@extra-args)