diff options
| author | Stefan Monnier | 2005-08-24 11:54:25 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2005-08-24 11:54:25 +0000 |
| commit | 94dfee0bfe7edcd889defb5f5b3b8be93ad3a352 (patch) | |
| tree | f1ad924319d9c74ab902bd295c2662178702c5c2 | |
| parent | b6790c3eec383718d9918c95e058581f75b1368d (diff) | |
| download | emacs-94dfee0bfe7edcd889defb5f5b3b8be93ad3a352.tar.gz emacs-94dfee0bfe7edcd889defb5f5b3b8be93ad3a352.zip | |
(define-minor-mode): Simplify.
| -rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 22 |
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 | |||
| 194 | Use the command `%s' to change this variable." pretty-name mode)) | 194 | Use 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)) | 199 | See 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. | ||
| 202 | See the command `%s' for a description of this minor-mode. | ||
| 203 | Setting this variable directly does not take effect; | 201 | Setting this variable directly does not take effect; |
| 204 | use either \\[customize] or the function `%s'.") | 202 | use either \\[customize] or the function `%s'.")))) |
| 205 | (if (null body) | ||
| 206 | (setq base-doc-string "Non-nil if %s is enabled. | ||
| 207 | See 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) |