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