1100 |
The macro @code{define-minor-mode} offers a convenient way of |
The macro @code{define-minor-mode} offers a convenient way of |
1101 |
implementing a mode in one self-contained definition. |
implementing a mode in one self-contained definition. |
1102 |
|
|
1103 |
@defmac define-minor-mode mode doc [init-value [lighter [keymap keyword-args... body...]]] |
@defmac define-minor-mode mode doc [init-value [lighter [keymap]]] keyword-args... body... |
1104 |
@tindex define-minor-mode |
@tindex define-minor-mode |
1105 |
This macro defines a new minor mode whose name is @var{mode} (a |
This macro defines a new minor mode whose name is @var{mode} (a |
1106 |
symbol). It defines a command named @var{mode} to toggle the minor |
symbol). It defines a command named @var{mode} to toggle the minor |
1121 |
(@var{key-sequence} . @var{definition}) |
(@var{key-sequence} . @var{definition}) |
1122 |
@end example |
@end example |
1123 |
|
|
1124 |
The @var{keyword-args} consist of keywords followed by corresponding |
The above three arguments @var{init-value}, @var{lighter}, and |
1125 |
values. A few keywords have special meanings: |
@var{keymap} can be (partially) omitted when @var{keyword-args} are |
1126 |
|
used. The @var{keyword-args} consist of keywords followed by |
1127 |
|
corresponding values. A few keywords have special meanings: |
1128 |
|
|
1129 |
@table @code |
@table @code |
1130 |
@item :global @var{global} |
@item :global @var{global} |