Mercurial > emacs
changeset 65094:e1fcf3783add
(define-minor-mode): Simplify.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 24 Aug 2005 11:54:25 +0000 |
parents | 1aae62fd4a80 |
children | 23c9aeba8f59 |
files | lisp/emacs-lisp/easy-mmode.el |
diffstat | 1 files changed, 7 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/emacs-lisp/easy-mmode.el Wed Aug 24 11:49:07 2005 +0000 +++ b/lisp/emacs-lisp/easy-mmode.el Wed Aug 24 11:54:25 2005 +0000 @@ -194,28 +194,20 @@ 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)