Commit | Line | Data |
---|---|---|
89851a09 RS |
1 | @c -*-texinfo-*- |
2 | @c This is part of the GNU Emacs Lisp Reference Manual. | |
b3d90e46 GM |
3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1998, 2001, 2002, 2003, 2004, |
4 | @c 2005, 2006, 2007 Free Software Foundation, Inc. | |
89851a09 RS |
5 | @c See the file elisp.texi for copying conditions. |
6 | @setfilename ../info/hooks | |
bfe721d1 | 7 | @node Standard Hooks, Index, Standard Keymaps, Top |
89851a09 | 8 | @appendix Standard Hooks |
25176866 EZ |
9 | @cindex standard hooks |
10 | @cindex hook variables, list of | |
89851a09 | 11 | |
5632e6b4 | 12 | The following is a list of hook variables that let you provide |
177c0ea7 | 13 | functions to be called from within Emacs on suitable occasions. |
89851a09 | 14 | |
5632e6b4 RS |
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 | |
dd73b091 RS |
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. | |
89851a09 | 21 | |
df16f475 LK |
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. | |
be051bc0 LT |
25 | @xref{Mode Hooks}. Most minor modes have mode hooks too. Mode hooks |
26 | are omitted in the list below. | |
df16f475 | 27 | |
dd73b091 RS |
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, | |
475aab0d CY |
31 | or their values are used). The variables whose names end in |
32 | @samp{-function} have single functions as their values. | |
89851a09 | 33 | |
df16f475 LK |
34 | @c We need to xref to where each hook is documented or else document |
35 | @c it here. | |
89851a09 RS |
36 | |
37 | @table @code | |
38 | @item activate-mark-hook | |
df16f475 LK |
39 | @xref{The Mark}. |
40 | ||
72654a3c | 41 | @item after-change-functions |
df16f475 LK |
42 | @xref{Change Hooks}. |
43 | ||
8a4e8a7f | 44 | @item after-change-major-mode-hook |
df16f475 LK |
45 | @xref{Mode Hooks}. |
46 | ||
89851a09 | 47 | @item after-init-hook |
df16f475 LK |
48 | @xref{Init File}. |
49 | ||
89851a09 | 50 | @item after-insert-file-functions |
df16f475 LK |
51 | @xref{Saving Properties}. |
52 | ||
fa00d3b6 | 53 | @item after-make-frame-functions |
df16f475 LK |
54 | @xref{Creating Frames}. |
55 | ||
f9f59935 | 56 | @item after-revert-hook |
df16f475 LK |
57 | @xref{Reverting}. |
58 | ||
f9f59935 | 59 | @item after-save-hook |
df16f475 LK |
60 | @xref{Saving Buffers}. |
61 | ||
89851a09 | 62 | @item auto-fill-function |
df16f475 LK |
63 | @xref{Auto Filling}. |
64 | ||
89851a09 | 65 | @item auto-save-hook |
df16f475 LK |
66 | @xref{Auto-Saving}. |
67 | ||
72654a3c | 68 | @item before-change-functions |
df16f475 LK |
69 | @xref{Change Hooks}. |
70 | ||
89851a09 | 71 | @item before-init-hook |
df16f475 LK |
72 | @xref{Init File}. |
73 | ||
89851a09 | 74 | @item before-make-frame-hook |
df16f475 LK |
75 | @xref{Creating Frames}. |
76 | ||
f9f59935 | 77 | @item before-revert-hook |
df16f475 LK |
78 | @xref{Reverting}. |
79 | ||
a0465ec3 | 80 | @item before-save-hook |
df16f475 LK |
81 | @xref{Saving Buffers}. |
82 | ||
89851a09 | 83 | @item blink-paren-function |
df16f475 LK |
84 | @xref{Blinking}. |
85 | ||
f9f59935 | 86 | @item buffer-access-fontify-functions |
df16f475 LK |
87 | @xref{Lazy Properties}. |
88 | ||
89851a09 | 89 | @item calendar-load-hook |
d6d7b06b | 90 | @iftex |
8e3c5bf0 | 91 | @inforef{Calendar Customizing,, emacs-xtra}. |
d6d7b06b EZ |
92 | @end iftex |
93 | @ifnottex | |
94 | @xref{Calendar Customizing,,, emacs}. | |
95 | @end ifnottex | |
96 | ||
df16f475 | 97 | |
f9f59935 | 98 | @item change-major-mode-hook |
df16f475 LK |
99 | @xref{Creating Buffer-Local}. |
100 | ||
f9f59935 | 101 | @item command-line-functions |
df16f475 LK |
102 | @xref{Command-Line Arguments}. |
103 | ||
89851a09 | 104 | @item comment-indent-function |
df16f475 LK |
105 | @xref{Options for Comments,, Options Controlling Comments, emacs, the |
106 | GNU Emacs Manual}. | |
107 | ||
25176866 EZ |
108 | @item compilation-finish-functions |
109 | Functions to call when a compilation process finishes. | |
110 | ||
b26d003a | 111 | @item custom-define-hook |
df16f475 LK |
112 | Hook called after defining each customize option. |
113 | ||
89851a09 | 114 | @item deactivate-mark-hook |
df16f475 LK |
115 | @xref{The Mark}. |
116 | ||
27758c56 | 117 | @item desktop-after-read-hook |
df16f475 LK |
118 | Normal hook run after a successful @code{desktop-read}. May be used |
119 | to show a buffer list. @xref{Saving Emacs Sessions,, Saving Emacs | |
120 | Sessions, emacs, the GNU Emacs Manual}. | |
121 | ||
27758c56 | 122 | @item desktop-no-desktop-file-hook |
df16f475 LK |
123 | Normal hook run when @code{desktop-read} can't find a desktop file. |
124 | May be used to show a dired buffer. @xref{Saving Emacs Sessions,, | |
125 | Saving Emacs Sessions, emacs, the GNU Emacs Manual}. | |
126 | ||
27758c56 | 127 | @item desktop-save-hook |
df16f475 LK |
128 | Normal hook run before the desktop is saved in a desktop file. This |
129 | is useful for truncating history lists, for example. @xref{Saving | |
130 | Emacs Sessions,, Saving Emacs Sessions, emacs, the GNU Emacs Manual}. | |
131 | ||
89851a09 | 132 | @item diary-display-hook |
d6d7b06b | 133 | @iftex |
8e3c5bf0 | 134 | @inforef{Fancy Diary Display,, emacs-xtra}. |
d6d7b06b EZ |
135 | @end iftex |
136 | @ifnottex | |
137 | @xref{Fancy Diary Display,,, emacs}. | |
138 | @end ifnottex | |
df16f475 | 139 | |
89851a09 | 140 | @item diary-hook |
df16f475 LK |
141 | List of functions called after the display of the diary. Can be used |
142 | for appointment notification. | |
143 | ||
27e8464d | 144 | @item disabled-command-function |
df16f475 LK |
145 | @xref{Disabling Commands}. |
146 | ||
f9f59935 | 147 | @item echo-area-clear-hook |
475aab0d | 148 | @xref{Echo Area Customization}. |
df16f475 LK |
149 | |
150 | @item emacs-startup-hook | |
151 | @xref{Init File}. | |
152 | ||
f2aa473a | 153 | @item find-file-hook |
df16f475 LK |
154 | @xref{Visiting Functions}. |
155 | ||
f2aa473a | 156 | @item find-file-not-found-functions |
df16f475 LK |
157 | @xref{Visiting Functions}. |
158 | ||
89851a09 | 159 | @item first-change-hook |
df16f475 LK |
160 | @xref{Change Hooks}. |
161 | ||
5b3a5f9f LK |
162 | @item font-lock-beginning-of-syntax-function |
163 | @xref{Syntactic Font Lock}. | |
164 | ||
165 | @item font-lock-fontify-buffer-function | |
166 | @xref{Other Font Lock Variables}. | |
167 | ||
168 | @item font-lock-fontify-region-function | |
169 | @xref{Other Font Lock Variables}. | |
170 | ||
171 | @item font-lock-mark-block-function | |
172 | @xref{Other Font Lock Variables}. | |
173 | ||
174 | @item font-lock-syntactic-face-function | |
175 | @xref{Syntactic Font Lock}. | |
176 | ||
177 | @item font-lock-unfontify-buffer-function | |
178 | @xref{Other Font Lock Variables}. | |
179 | ||
180 | @item font-lock-unfontify-region-function | |
181 | @xref{Other Font Lock Variables}. | |
182 | ||
89851a09 | 183 | @item initial-calendar-window-hook |
d6d7b06b | 184 | @iftex |
8e3c5bf0 | 185 | @inforef{Calendar Customizing,, emacs-xtra}. |
d6d7b06b EZ |
186 | @end iftex |
187 | @ifnottex | |
188 | @xref{Calendar Customizing,,, emacs}. | |
189 | @end ifnottex | |
df16f475 | 190 | |
42703598 | 191 | @item kbd-macro-termination-hook |
df16f475 LK |
192 | @xref{Keyboard Macros}. |
193 | ||
f9f59935 | 194 | @item kill-buffer-hook |
df16f475 LK |
195 | @xref{Killing Buffers}. |
196 | ||
89851a09 | 197 | @item kill-buffer-query-functions |
df16f475 LK |
198 | @xref{Killing Buffers}. |
199 | ||
f9f59935 | 200 | @item kill-emacs-hook |
df16f475 LK |
201 | @xref{Killing Emacs}. |
202 | ||
89851a09 | 203 | @item kill-emacs-query-functions |
df16f475 LK |
204 | @xref{Killing Emacs}. |
205 | ||
89851a09 | 206 | @item lisp-indent-function |
df16f475 | 207 | |
89851a09 | 208 | @item list-diary-entries-hook |
d6d7b06b | 209 | @iftex |
8e3c5bf0 | 210 | @inforef{Fancy Diary Display,, emacs-xtra}. |
d6d7b06b EZ |
211 | @end iftex |
212 | @ifnottex | |
213 | @xref{Fancy Diary Display,,, emacs}. | |
214 | @end ifnottex | |
df16f475 | 215 | |
89851a09 | 216 | @item mail-setup-hook |
df16f475 LK |
217 | @xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs |
218 | Manual}. | |
219 | ||
89851a09 | 220 | @item mark-diary-entries-hook |
d6d7b06b | 221 | @iftex |
8e3c5bf0 | 222 | @inforef{Fancy Diary Display,, emacs-xtra}. |
d6d7b06b EZ |
223 | @end iftex |
224 | @ifnottex | |
225 | @xref{Fancy Diary Display,,, emacs}. | |
226 | @end ifnottex | |
df16f475 | 227 | |
f9f59935 | 228 | @item menu-bar-update-hook |
df16f475 LK |
229 | @xref{Menu Bar}. |
230 | ||
89851a09 | 231 | @item minibuffer-setup-hook |
df16f475 LK |
232 | @xref{Minibuffer Misc}. |
233 | ||
72654a3c | 234 | @item minibuffer-exit-hook |
df16f475 LK |
235 | @xref{Minibuffer Misc}. |
236 | ||
97dad108 | 237 | @item mouse-position-function |
df16f475 LK |
238 | @xref{Mouse Position}. |
239 | ||
89851a09 | 240 | @item nongregorian-diary-listing-hook |
d6d7b06b | 241 | @iftex |
8e3c5bf0 | 242 | @inforef{Hebrew/Islamic Entries,, emacs-xtra}. |
d6d7b06b EZ |
243 | @end iftex |
244 | @ifnottex | |
245 | @xref{Hebrew/Islamic Entries,,, emacs}. | |
246 | @end ifnottex | |
df16f475 | 247 | |
89851a09 | 248 | @item nongregorian-diary-marking-hook |
d6d7b06b | 249 | @iftex |
8e3c5bf0 | 250 | @inforef{Hebrew/Islamic Entries,, emacs-xtra}. |
d6d7b06b EZ |
251 | @end iftex |
252 | @ifnottex | |
253 | @xref{Hebrew/Islamic Entries,,, emacs}. | |
254 | @end ifnottex | |
df16f475 | 255 | |
6c3b04e6 RS |
256 | @item occur-hook |
257 | ||
89851a09 | 258 | @item post-command-hook |
df16f475 LK |
259 | @xref{Command Overview}. |
260 | ||
89851a09 | 261 | @item pre-abbrev-expand-hook |
df16f475 LK |
262 | @xref{Abbrev Expansion}. |
263 | ||
89851a09 | 264 | @item pre-command-hook |
df16f475 LK |
265 | @xref{Command Overview}. |
266 | ||
89851a09 | 267 | @item print-diary-entries-hook |
d6d7b06b | 268 | @iftex |
8e3c5bf0 | 269 | @inforef{Diary Customizing,, emacs-xtra}. |
d6d7b06b EZ |
270 | @end iftex |
271 | @ifnottex | |
272 | @xref{Diary Customizing,,, emacs}. | |
273 | @end ifnottex | |
df16f475 | 274 | |
f9f59935 | 275 | @item redisplay-end-trigger-functions |
df16f475 LK |
276 | @xref{Window Hooks}. |
277 | ||
278 | @item scheme-indent-function | |
279 | ||
89851a09 | 280 | @item suspend-hook |
df16f475 LK |
281 | @xref{Suspending Emacs}. |
282 | ||
89851a09 | 283 | @item suspend-resume-hook |
df16f475 LK |
284 | @xref{Suspending Emacs}. |
285 | ||
286 | @item temp-buffer-setup-hook | |
287 | @xref{Temporary Displays}. | |
288 | ||
89851a09 | 289 | @item temp-buffer-show-function |
df16f475 LK |
290 | @xref{Temporary Displays}. |
291 | ||
292 | @item temp-buffer-show-hook | |
293 | @xref{Temporary Displays}. | |
294 | ||
89851a09 | 295 | @item term-setup-hook |
df16f475 LK |
296 | @xref{Terminal-Specific}. |
297 | ||
89851a09 | 298 | @item today-visible-calendar-hook |
d6d7b06b | 299 | @iftex |
8e3c5bf0 | 300 | @inforef{Calendar Customizing,, emacs-xtra}. |
d6d7b06b EZ |
301 | @end iftex |
302 | @ifnottex | |
303 | @xref{Calendar Customizing,,, emacs}. | |
304 | @end ifnottex | |
df16f475 | 305 | |
89851a09 | 306 | @item today-invisible-calendar-hook |
d6d7b06b | 307 | @iftex |
cf1c2307 | 308 | @inforef{Calendar Customizing,, emacs-xtra}. |
d6d7b06b EZ |
309 | @end iftex |
310 | @ifnottex | |
311 | @xref{Calendar Customizing,,, emacs}. | |
312 | @end ifnottex | |
df16f475 | 313 | |
f9f59935 | 314 | @item window-configuration-change-hook |
df16f475 LK |
315 | @xref{Window Hooks}. |
316 | ||
f9f59935 | 317 | @item window-scroll-functions |
df16f475 LK |
318 | @xref{Window Hooks}. |
319 | ||
89851a09 | 320 | @item window-setup-hook |
df16f475 LK |
321 | @xref{Window Systems}. |
322 | ||
f9f59935 | 323 | @item window-size-change-functions |
df16f475 LK |
324 | @xref{Window Hooks}. |
325 | ||
f2aa473a | 326 | @item write-contents-functions |
df16f475 LK |
327 | @xref{Saving Buffers}. |
328 | ||
f2aa473a | 329 | @item write-file-functions |
df16f475 LK |
330 | @xref{Saving Buffers}. |
331 | ||
bfe721d1 | 332 | @item write-region-annotate-functions |
df16f475 | 333 | @xref{Saving Properties}. |
89851a09 | 334 | @end table |
ab5796a9 MB |
335 | |
336 | @ignore | |
337 | arch-tag: 55fd0296-d906-4551-b300-979d3846aa88 | |
338 | @end ignore |