]> git.eshelyaron.com Git - emacs.git/commitdiff
(define-minor-mode): If BODY is empty, give the variable a doc string
authorRichard M. Stallman <rms@gnu.org>
Wed, 8 Jun 2005 15:54:43 +0000 (15:54 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 8 Jun 2005 15:54:43 +0000 (15:54 +0000)
that doesn't say don't set it directly.

lisp/emacs-lisp/easy-mmode.el

index bb0fa66621709809fececf7c0f5d3984147a152a..a342f8a5530e0af059db54e20035f71d5cdae9b5 100644 (file)
@@ -183,13 +183,18 @@ Use the command `%s' to change this variable." pretty-name mode))
 
          (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