comparison lispref/modes.texi @ 51794:8a7816e7f5bd

(Minor Mode Conventions): Specify only some kinds of list values as args to minor modes.
author Richard M. Stallman <rms@gnu.org>
date Mon, 07 Jul 2003 20:49:02 +0000
parents b8860fc285cb
children 3039afbb0746
comparison
equal deleted inserted replaced
51793:ccbf5ac3316d 51794:8a7816e7f5bd
862 @item 862 @item
863 Define a command whose name is the same as the mode variable. 863 Define a command whose name is the same as the mode variable.
864 Its job is to enable and disable the mode by setting the variable. 864 Its job is to enable and disable the mode by setting the variable.
865 865
866 The command should accept one optional argument. If the argument is 866 The command should accept one optional argument. If the argument is
867 @code{nil}, it should toggle the mode (turn it on if it is off, and off 867 @code{nil}, it should toggle the mode (turn it on if it is off, and
868 if it is on). Otherwise, it should turn the mode on if the argument is 868 off if it is on). It should turn the mode on if the argument is a
869 a positive integer, a symbol other than @code{nil} or @code{-}, or a 869 positive integer, the symbol @code{t}, or a list whose @sc{car} is one
870 list whose @sc{car} is such an integer or symbol; it should turn the 870 of those. It should turn the mode off if the argument is a negative
871 mode off otherwise. 871 integer or zero, the symbol @code{-}, or a list whose @sc{car} is one
872 of those. The meaning of other arguments is not specified.
872 873
873 Here is an example taken from the definition of @code{transient-mark-mode}. 874 Here is an example taken from the definition of @code{transient-mark-mode}.
874 It shows the use of @code{transient-mark-mode} as a variable that enables or 875 It shows the use of @code{transient-mark-mode} as a variable that enables or
875 disables the mode's behavior, and also shows the proper way to toggle, 876 disables the mode's behavior, and also shows the proper way to toggle,
876 enable or disable the minor mode based on the raw prefix argument value. 877 enable or disable the minor mode based on the raw prefix argument value.