]> code.delx.au - gnu-emacs/blob - lispref/hooks.texi
(fortran-indent-to-column): "?\ " -> "?\s".
[gnu-emacs] / lispref / hooks.texi
1 @c -*-texinfo-*-
2 @c This is part of the GNU Emacs Lisp Reference Manual.
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1998, 2002, 2003, 2004,
4 @c 2005 Free Software Foundation, Inc.
5 @c See the file elisp.texi for copying conditions.
6 @setfilename ../info/hooks
7 @node Standard Hooks, Index, Standard Keymaps, Top
8 @appendix Standard Hooks
9
10 The following is a list of hook variables that let you provide
11 functions to be called from within Emacs on suitable occasions.
12
13 Most of these variables have names ending with @samp{-hook}. They are
14 @dfn{normal hooks}, run by means of @code{run-hooks}. The value of such
15 a hook is a list of functions; the functions are called with no
16 arguments and their values are completely ignored. The recommended way
17 to put a new function on such a hook is to call @code{add-hook}.
18 @xref{Hooks}, for more information about using hooks.
19
20 Every major mode defines a mode hook named
21 @samp{@var{modename}-mode-hook}. The major mode command runs this
22 normal hook with @code{run-mode-hooks} as the very last thing it does.
23 @xref{Mode Hooks}. Most minor modes have mode hooks too. Mode hooks
24 are omitted in the list below.
25
26 The variables whose names end in @samp{-hooks} or @samp{-functions} are
27 usually @dfn{abnormal hooks}; their values are lists of functions, but
28 these functions are called in a special way (they are passed arguments,
29 or their values are used). A few of these variables are actually normal
30 hooks which were named before we established the convention that normal
31 hooks' names should end in @samp{-hook}.
32
33 The variables whose names end in @samp{-function} have single functions
34 as their values. (In older Emacs versions, some of these variables had
35 names ending in @samp{-hook} even though they were not normal hooks;
36 however, we have renamed all of those.)
37
38 @c We need to xref to where each hook is documented or else document
39 @c it here.
40
41 @table @code
42 @item activate-mark-hook
43 @xref{The Mark}.
44
45 @item after-change-functions
46 @xref{Change Hooks}.
47
48 @item after-change-major-mode-hook
49 @xref{Mode Hooks}.
50
51 @item after-init-hook
52 @xref{Init File}.
53
54 @item after-insert-file-functions
55 @xref{Saving Properties}.
56
57 @item after-make-frame-functions
58 @xref{Creating Frames}.
59
60 @item after-revert-hook
61 @xref{Reverting}.
62
63 @item after-save-hook
64 @xref{Saving Buffers}.
65
66 @item auto-fill-function
67 @xref{Auto Filling}.
68
69 @item auto-save-hook
70 @xref{Auto-Saving}.
71
72 @item before-change-functions
73 @xref{Change Hooks}.
74
75 @item before-init-hook
76 @xref{Init File}.
77
78 @item before-make-frame-hook
79 @xref{Creating Frames}.
80
81 @item before-revert-hook
82 @xref{Reverting}.
83
84 @item before-save-hook
85 @xref{Saving Buffers}.
86
87 @item blink-paren-function
88 @xref{Blinking}.
89
90 @item buffer-access-fontify-functions
91 @xref{Lazy Properties}.
92
93 @item calendar-load-hook
94 @inforef{Calendar Customizing,, emacs-xtra}.
95
96 @item change-major-mode-hook
97 @xref{Creating Buffer-Local}.
98
99 @item command-line-functions
100 @xref{Command-Line Arguments}.
101
102 @item comment-indent-function
103 @xref{Options for Comments,, Options Controlling Comments, emacs, the
104 GNU Emacs Manual}.
105
106 @item custom-define-hook
107 Hook called after defining each customize option.
108
109 @item deactivate-mark-hook
110 @xref{The Mark}.
111
112 @item desktop-after-read-hook
113 Normal hook run after a successful @code{desktop-read}. May be used
114 to show a buffer list. @xref{Saving Emacs Sessions,, Saving Emacs
115 Sessions, emacs, the GNU Emacs Manual}.
116
117 @item desktop-no-desktop-file-hook
118 Normal hook run when @code{desktop-read} can't find a desktop file.
119 May be used to show a dired buffer. @xref{Saving Emacs Sessions,,
120 Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
121
122 @item desktop-save-hook
123 Normal hook run before the desktop is saved in a desktop file. This
124 is useful for truncating history lists, for example. @xref{Saving
125 Emacs Sessions,, Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
126
127 @item diary-display-hook
128 @inforef{Fancy Diary Display,, emacs-xtra}.
129
130 @item diary-hook
131 List of functions called after the display of the diary. Can be used
132 for appointment notification.
133
134 @item disabled-command-function
135 @xref{Disabling Commands}.
136
137 @item echo-area-clear-hook
138 @xref{The Echo Area}.
139
140 @item emacs-startup-hook
141 @xref{Init File}.
142
143 @item find-file-hook
144 @xref{Visiting Functions}.
145
146 @item find-file-not-found-functions
147 @xref{Visiting Functions}.
148
149 @item first-change-hook
150 @xref{Change Hooks}.
151
152 @item font-lock-beginning-of-syntax-function
153 @xref{Syntactic Font Lock}.
154
155 @item font-lock-fontify-buffer-function
156 @xref{Other Font Lock Variables}.
157
158 @item font-lock-fontify-region-function
159 @xref{Other Font Lock Variables}.
160
161 @item font-lock-mark-block-function
162 @xref{Other Font Lock Variables}.
163
164 @item font-lock-syntactic-face-function
165 @xref{Syntactic Font Lock}.
166
167 @item font-lock-unfontify-buffer-function
168 @xref{Other Font Lock Variables}.
169
170 @item font-lock-unfontify-region-function
171 @xref{Other Font Lock Variables}.
172
173 @item initial-calendar-window-hook
174 @inforef{Calendar Customizing,, emacs-xtra}.
175
176 @item kbd-macro-termination-hook
177 @xref{Keyboard Macros}.
178
179 @item kill-buffer-hook
180 @xref{Killing Buffers}.
181
182 @item kill-buffer-query-functions
183 @xref{Killing Buffers}.
184
185 @item kill-emacs-hook
186 @xref{Killing Emacs}.
187
188 @item kill-emacs-query-functions
189 @xref{Killing Emacs}.
190
191 @item lisp-indent-function
192
193 @item list-diary-entries-hook
194 @inforef{Fancy Diary Display,, emacs-xtra}.
195
196 @item mail-setup-hook
197 @xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs
198 Manual}.
199
200 @item mark-diary-entries-hook
201 @inforef{Fancy Diary Display,, emacs-xtra}.
202
203 @item menu-bar-update-hook
204 @xref{Menu Bar}.
205
206 @item minibuffer-setup-hook
207 @xref{Minibuffer Misc}.
208
209 @item minibuffer-exit-hook
210 @xref{Minibuffer Misc}.
211
212 @item mouse-position-function
213 @xref{Mouse Position}.
214
215 @item nongregorian-diary-listing-hook
216 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
217
218 @item nongregorian-diary-marking-hook
219 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
220
221 @item occur-hook
222
223 @item post-command-hook
224 @xref{Command Overview}.
225
226 @item pre-abbrev-expand-hook
227 @xref{Abbrev Expansion}.
228
229 @item pre-command-hook
230 @xref{Command Overview}.
231
232 @item print-diary-entries-hook
233 @inforef{Diary Customizing,, emacs-xtra}.
234
235 @item redisplay-end-trigger-functions
236 @xref{Window Hooks}.
237
238 @item scheme-indent-function
239
240 @item suspend-hook
241 @xref{Suspending Emacs}.
242
243 @item suspend-resume-hook
244 @xref{Suspending Emacs}.
245
246 @item temp-buffer-setup-hook
247 @xref{Temporary Displays}.
248
249 @item temp-buffer-show-function
250 @xref{Temporary Displays}.
251
252 @item temp-buffer-show-hook
253 @xref{Temporary Displays}.
254
255 @item term-setup-hook
256 @xref{Terminal-Specific}.
257
258 @item today-visible-calendar-hook
259 @inforef{Calendar Customizing,, emacs-xtra}.
260
261 @item today-invisible-calendar-hook
262 @inforef{Calendar Customizing,, emacs-xtra}.
263
264 @item window-configuration-change-hook
265 @xref{Window Hooks}.
266
267 @item window-scroll-functions
268 @xref{Window Hooks}.
269
270 @item window-setup-hook
271 @xref{Window Systems}.
272
273 @item window-size-change-functions
274 @xref{Window Hooks}.
275
276 @item write-contents-functions
277 @xref{Saving Buffers}.
278
279 @item write-file-functions
280 @xref{Saving Buffers}.
281
282 @item write-region-annotate-functions
283 @xref{Saving Properties}.
284 @end table
285
286 @ignore
287 arch-tag: 55fd0296-d906-4551-b300-979d3846aa88
288 @end ignore