comparison lispref/modes.texi @ 71957:61cb5aae3bc3

Put period and comma inside quotes.
author Richard M. Stallman <rms@gnu.org>
date Tue, 18 Jul 2006 00:08:15 +0000
parents 6bc43bba870c
children 372038a731dd 8a8e69664178
comparison
equal deleted inserted replaced
71956:1caee6e0cbe1 71957:61cb5aae3bc3
143 If @var{function} is already present in @var{hook} (comparing using 143 If @var{function} is already present in @var{hook} (comparing using
144 @code{equal}), then @code{add-hook} does not add it a second time. 144 @code{equal}), then @code{add-hook} does not add it a second time.
145 145
146 It is best to design your hook functions so that the order in which they 146 It is best to design your hook functions so that the order in which they
147 are executed does not matter. Any dependence on the order is ``asking 147 are executed does not matter. Any dependence on the order is ``asking
148 for trouble''. However, the order is predictable: normally, 148 for trouble.'' However, the order is predictable: normally,
149 @var{function} goes at the front of the hook list, so it will be 149 @var{function} goes at the front of the hook list, so it will be
150 executed first (barring another @code{add-hook} call). If the optional 150 executed first (barring another @code{add-hook} call). If the optional
151 argument @var{append} is non-@code{nil}, the new hook function goes at 151 argument @var{append} is non-@code{nil}, the new hook function goes at
152 the end of the hook list and will be executed last. 152 the end of the hook list and will be executed last.
153 153
1137 However, if a certain feature needs to be completely reliable, 1137 However, if a certain feature needs to be completely reliable,
1138 it should not use @code{after-change-major-mode-hook} as of yet. 1138 it should not use @code{after-change-major-mode-hook} as of yet.
1139 1139
1140 When you defined a major mode using @code{define-derived-mode}, it 1140 When you defined a major mode using @code{define-derived-mode}, it
1141 automatically makes sure these conventions are followed. If you 1141 automatically makes sure these conventions are followed. If you
1142 define a major mode ``from scratch'', not using 1142 define a major mode ``from scratch,'' not using
1143 @code{define-derived-mode}, make sure the major mode command follows 1143 @code{define-derived-mode}, make sure the major mode command follows
1144 these and other conventions. @xref{Major Mode Conventions}. You use 1144 these and other conventions. @xref{Major Mode Conventions}. You use
1145 these functions to do it properly. 1145 these functions to do it properly.
1146 1146
1147 @defun run-mode-hooks &rest hookvars 1147 @defun run-mode-hooks &rest hookvars
1454 '(("\C-\^?" . hungry-electric-delete)) 1454 '(("\C-\^?" . hungry-electric-delete))
1455 :group 'hunger) 1455 :group 'hunger)
1456 @end smallexample 1456 @end smallexample
1457 1457
1458 @noindent 1458 @noindent
1459 This defines a minor mode named ``Hungry mode'', a command named 1459 This defines a minor mode named ``Hungry mode,'' a command named
1460 @code{hungry-mode} to toggle it, a variable named @code{hungry-mode} 1460 @code{hungry-mode} to toggle it, a variable named @code{hungry-mode}
1461 which indicates whether the mode is enabled, and a variable named 1461 which indicates whether the mode is enabled, and a variable named
1462 @code{hungry-mode-map} which holds the keymap that is active when the 1462 @code{hungry-mode-map} which holds the keymap that is active when the
1463 mode is enabled. It initializes the keymap with a key binding for 1463 mode is enabled. It initializes the keymap with a key binding for
1464 @kbd{C-@key{DEL}}. It puts the variable @code{hungry-mode} into 1464 @kbd{C-@key{DEL}}. It puts the variable @code{hungry-mode} into