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