Fix minor mode docstrings for the new meaning of a nil ARG.
[bpt/emacs.git] / lisp / emacs-lisp / easy-mmode.el
index 9a703c9..b1cb061 100644 (file)
@@ -1,7 +1,6 @@
 ;;; easy-mmode.el --- easy definition for major and minor modes
 
-;; Copyright (C) 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;;   2008, 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2000-2011  Free Software Foundation, Inc.
 
 ;; Author: Georges Brun-Cottan <Georges.Brun-Cottan@inria.fr>
 ;; Maintainer: Stefan Monnier <monnier@gnu.org>
@@ -94,8 +93,9 @@ Optional INIT-VALUE is the initial value of the mode's variable.
 Optional LIGHTER is displayed in the modeline when the mode is on.
 Optional KEYMAP is the default keymap bound to the mode keymap.
   If non-nil, it should be a variable name (whose value is a keymap),
-  a keymap, or a list of arguments for `easy-mmode-define-keymap'.
-  If KEYMAP is a keymap or list, this also defines the variable MODE-map.
+  or an expression that returns either a keymap or a list of
+  arguments for `easy-mmode-define-keymap'.  If KEYMAP is not a symbol,
+  this also defines the variable MODE-map.
 
 BODY contains code to execute each time the mode is enabled or disabled.
   It is executed after toggling the mode, and before running MODE-hook.
@@ -274,7 +274,7 @@ With zero or negative ARG turn mode off.
             (let ((m ,keymap))
               (cond ((keymapp m) m)
                     ((listp m) (easy-mmode-define-keymap m))
-                    (t (error "Invalid keymap %S" ,keymap))))
+                    (t (error "Invalid keymap %S" m))))
             ,(format "Keymap for `%s'." mode-name)))
 
        ,(if (not (symbolp mode))
@@ -350,14 +350,16 @@ call another major mode in their body."
        (define-minor-mode ,global-mode
         ;; Very short lines to avoid too long lines in the generated
         ;; doc string.
-        ,(format "Toggle %s in every possible buffer.
-With prefix ARG, turn %s on if and only if
-ARG is positive.
+        ,(format "Toggle %s in all buffers.
+With prefix ARG, enable %s if ARG is positive;
+otherwise, disable it.  If called from Lisp, enable the mode if
+ARG is omitted or nil.
+
 %s is enabled in all buffers where
 \`%s' would do it.
 See `%s' for more information on %s."
-                 pretty-name pretty-global-name pretty-name turn-on
-                 mode pretty-name)
+                 pretty-name pretty-global-name
+                 pretty-name turn-on mode pretty-name)
         :global t ,@group ,@(nreverse extra-keywords)
 
         ;; Setup hook to handle future mode changes and new buffers.