summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/easy-mmode.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2012-02-07 00:26:54 -0800
committerGlenn Morris <rgm@gnu.org>2012-02-07 00:26:54 -0800
commit60d47423d1f05071b96857860a8281b318931bee (patch)
tree1174c0c7270f250aea285d4acc6599d74f943d61 /lisp/emacs-lisp/easy-mmode.el
parentbba26374d0465e50338493a43eaa35312f8612d2 (diff)
downloademacs-60d47423d1f05071b96857860a8281b318931bee.tar.gz
Doc updates for define-minor-mode argument behavior
* doc/lispref/modes.texi (Defining Minor Modes): Expand on args of defined minor modes. * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Doc fixes for the macro and the mode it defines.
Diffstat (limited to 'lisp/emacs-lisp/easy-mmode.el')
-rw-r--r--lisp/emacs-lisp/easy-mmode.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index d871f6f1212..dbacba6cd29 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -90,6 +90,14 @@ This defines the toggle command MODE and (by default) a control variable
MODE (you can override this with the :variable keyword, see below).
DOC is the documentation for the mode toggle command.
+The defined mode command takes one optional (prefix) argument.
+Interactively with no prefix argument it toggles the mode.
+With a prefix argument, it enables the mode if the argument is
+positive and otherwise disables it. When called from Lisp, it
+enables the mode if the argument is omitted or nil, and toggles
+the mode if the argument is `toggle'. If DOC is nil this
+function adds a basic doc-string stating these facts.
+
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.
@@ -242,7 +250,7 @@ or call the function `%s'."))))
(format (concat "Toggle %s on or off.
With a prefix argument ARG, enable %s if ARG is
positive, and disable it otherwise. If called from Lisp, enable
-the mode if ARG is omitted or nil.
+the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'.
\\{%s}") pretty-name pretty-name keymap-sym))
;; Use `toggle' rather than (if ,mode 0 1) so that using
;; repeat-command still does the toggling correctly.