changeset 63141:c531a8daedc6

(define-minor-mode): If BODY is empty, give the variable a doc string that doesn't say don't set it directly.
author Richard M. Stallman <rms@gnu.org>
date Wed, 08 Jun 2005 15:54:43 +0000
parents bd94b75dbfe8
children fdbda2a9a6bf
files lisp/emacs-lisp/easy-mmode.el
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/easy-mmode.el	Wed Jun 08 15:53:51 2005 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el	Wed Jun 08 15:54:43 2005 +0000
@@ -183,13 +183,18 @@
 
 	  (let ((curfile (or (and (boundp 'byte-compile-current-file)
 				  byte-compile-current-file)
-			     load-file-name)))
-	    `(defcustom ,mode ,init-value
-	       ,(format "Non-nil if %s is enabled.
+			     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.
 Setting this variable directly does not take effect;
-use either \\[customize] or the function `%s'."
-			pretty-name mode mode)
+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."))
+
+	    `(defcustom ,mode ,init-value
+	       ,(format base-doc-string pretty-name mode mode)
 	       :set 'custom-set-minor-mode
 	       :initialize 'custom-initialize-default
 	       ,@group