aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2005-08-24 11:54:25 +0000
committerStefan Monnier2005-08-24 11:54:25 +0000
commit94dfee0bfe7edcd889defb5f5b3b8be93ad3a352 (patch)
treef1ad924319d9c74ab902bd295c2662178702c5c2
parentb6790c3eec383718d9918c95e058581f75b1368d (diff)
downloademacs-94dfee0bfe7edcd889defb5f5b3b8be93ad3a352.tar.gz
emacs-94dfee0bfe7edcd889defb5f5b3b8be93ad3a352.zip
(define-minor-mode): Simplify.
-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
194Use the command `%s' to change this variable." pretty-name mode)) 194Use the command `%s' to change this variable." pretty-name mode))
195 (make-variable-buffer-local ',mode)) 195 (make-variable-buffer-local ',mode))
196 196
197 (let ((curfile (or (and (boundp 'byte-compile-current-file) 197 (let ((base-doc-string
198 byte-compile-current-file) 198 (concat "Non-nil if %s is enabled.
199 load-file-name)) 199See the command `%s' for a description of this minor-mode."
200 base-doc-string) 200 (if body "
201 (setq base-doc-string "Non-nil if %s is enabled.
202See the command `%s' for a description of this minor-mode.
203Setting this variable directly does not take effect; 201Setting this variable directly does not take effect;
204use either \\[customize] or the function `%s'.") 202use either \\[customize] or the function `%s'."))))
205 (if (null body)
206 (setq base-doc-string "Non-nil if %s is enabled.
207See the command `%s' for a description of this minor-mode."))
208
209 `(defcustom ,mode ,init-value 203 `(defcustom ,mode ,init-value
210 ,(format base-doc-string pretty-name mode mode) 204 ,(format base-doc-string pretty-name mode mode)
211 ,@set 205 ,@set
212 ,@initialize 206 ,@initialize
213 ,@group 207 ,@group
214 ,@type 208 ,@type
215 ,@(cond 209 ,@(unless (eq require t) `(:require ,require))
216 ((not (and curfile require)) nil) 210 ,@(nreverse extra-keywords))))
217 ((not (eq require t)) `(:require ,require)))
218 ,@(nreverse extra-keywords))))
219 211
220 ;; The actual function. 212 ;; The actual function.
221 (defun ,mode (&optional arg ,@extra-args) 213 (defun ,mode (&optional arg ,@extra-args)