(free_float): Make free list chaining aliasing-safe.
[emacs.git] / lispref / hooks.texi
blob795048fdb2540fd1d18ff4c89d45c7c220251ac1
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
10 The following is a list of hook variables that let you provide
11 functions to be called from within Emacs on suitable occasions.
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.
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.
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). The variables whose names end in
30 @samp{-function} have single functions as their values.
32 (In older Emacs versions, some normal hooks had names ending in
33 @samp{-hooks} or @samp{-functions}, and some abnormal hooks had names
34 ending in @samp{-hook}.  We have renamed all of these to conform to
35 the above conventions.)
37 @c We need to xref to where each hook is documented or else document
38 @c it here.
40 @table @code
41 @item activate-mark-hook
42 @xref{The Mark}.
44 @item after-change-functions
45 @xref{Change Hooks}.
47 @item after-change-major-mode-hook
48 @xref{Mode Hooks}.
50 @item after-init-hook
51 @xref{Init File}.
53 @item after-insert-file-functions
54 @xref{Saving Properties}.
56 @item after-make-frame-functions
57 @xref{Creating Frames}.
59 @item after-revert-hook
60 @xref{Reverting}.
62 @item after-save-hook
63 @xref{Saving Buffers}.
65 @item auto-fill-function
66 @xref{Auto Filling}.
68 @item auto-save-hook
69 @xref{Auto-Saving}.
71 @item before-change-functions
72 @xref{Change Hooks}.
74 @item before-init-hook
75 @xref{Init File}.
77 @item before-make-frame-hook
78 @xref{Creating Frames}.
80 @item before-revert-hook
81 @xref{Reverting}.
83 @item before-save-hook
84 @xref{Saving Buffers}.
86 @item blink-paren-function
87 @xref{Blinking}.
89 @item buffer-access-fontify-functions
90 @xref{Lazy Properties}.
92 @item calendar-load-hook
93 @inforef{Calendar Customizing,, emacs-xtra}.
95 @item change-major-mode-hook
96 @xref{Creating Buffer-Local}.
98 @item command-line-functions
99 @xref{Command-Line Arguments}.
101 @item comment-indent-function
102 @xref{Options for Comments,, Options Controlling Comments, emacs, the
103 GNU Emacs Manual}.
105 @item custom-define-hook
106 Hook called after defining each customize option.
108 @item deactivate-mark-hook
109 @xref{The Mark}.
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}.
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}.
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}.
126 @item diary-display-hook
127 @inforef{Fancy Diary Display,, emacs-xtra}.
129 @item diary-hook
130 List of functions called after the display of the diary.  Can be used
131 for appointment notification.
133 @item disabled-command-function
134 @xref{Disabling Commands}.
136 @item echo-area-clear-hook
137 @xref{Echo Area Customization}.
139 @item emacs-startup-hook
140 @xref{Init File}.
142 @item find-file-hook
143 @xref{Visiting Functions}.
145 @item find-file-not-found-functions
146 @xref{Visiting Functions}.
148 @item first-change-hook
149 @xref{Change Hooks}.
151 @item font-lock-beginning-of-syntax-function
152 @xref{Syntactic Font Lock}.
154 @item font-lock-fontify-buffer-function
155 @xref{Other Font Lock Variables}.
157 @item font-lock-fontify-region-function
158 @xref{Other Font Lock Variables}.
160 @item font-lock-mark-block-function
161 @xref{Other Font Lock Variables}.
163 @item font-lock-syntactic-face-function
164 @xref{Syntactic Font Lock}.
166 @item font-lock-unfontify-buffer-function
167 @xref{Other Font Lock Variables}.
169 @item font-lock-unfontify-region-function
170 @xref{Other Font Lock Variables}.
172 @item initial-calendar-window-hook
173 @inforef{Calendar Customizing,, emacs-xtra}.
175 @item kbd-macro-termination-hook
176 @xref{Keyboard Macros}.
178 @item kill-buffer-hook
179 @xref{Killing Buffers}.
181 @item kill-buffer-query-functions
182 @xref{Killing Buffers}.
184 @item kill-emacs-hook
185 @xref{Killing Emacs}.
187 @item kill-emacs-query-functions
188 @xref{Killing Emacs}.
190 @item lisp-indent-function
192 @item list-diary-entries-hook
193 @inforef{Fancy Diary Display,, emacs-xtra}.
195 @item mail-setup-hook
196 @xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs
197 Manual}.
199 @item mark-diary-entries-hook
200 @inforef{Fancy Diary Display,, emacs-xtra}.
202 @item menu-bar-update-hook
203 @xref{Menu Bar}.
205 @item minibuffer-setup-hook
206 @xref{Minibuffer Misc}.
208 @item minibuffer-exit-hook
209 @xref{Minibuffer Misc}.
211 @item mouse-position-function
212 @xref{Mouse Position}.
214 @item nongregorian-diary-listing-hook
215 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
217 @item nongregorian-diary-marking-hook
218 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
220 @item occur-hook
222 @item post-command-hook
223 @xref{Command Overview}.
225 @item pre-abbrev-expand-hook
226 @xref{Abbrev Expansion}.
228 @item pre-command-hook
229 @xref{Command Overview}.
231 @item print-diary-entries-hook
232 @inforef{Diary Customizing,, emacs-xtra}.
234 @item redisplay-end-trigger-functions
235 @xref{Window Hooks}.
237 @item scheme-indent-function
239 @item suspend-hook
240 @xref{Suspending Emacs}.
242 @item suspend-resume-hook
243 @xref{Suspending Emacs}.
245 @item temp-buffer-setup-hook
246 @xref{Temporary Displays}.
248 @item temp-buffer-show-function
249 @xref{Temporary Displays}.
251 @item temp-buffer-show-hook
252 @xref{Temporary Displays}.
254 @item term-setup-hook
255 @xref{Terminal-Specific}.
257 @item today-visible-calendar-hook
258 @inforef{Calendar Customizing,, emacs-xtra}.
260 @item today-invisible-calendar-hook
261 @inforef{Calendar Customizing,, emacs-xtra}.
263 @item window-configuration-change-hook
264 @xref{Window Hooks}.
266 @item window-scroll-functions
267 @xref{Window Hooks}.
269 @item window-setup-hook
270 @xref{Window Systems}.
272 @item window-size-change-functions
273 @xref{Window Hooks}.
275 @item write-contents-functions
276 @xref{Saving Buffers}.
278 @item write-file-functions
279 @xref{Saving Buffers}.
281 @item write-region-annotate-functions
282 @xref{Saving Properties}.
283 @end table
285 @ignore
286    arch-tag: 55fd0296-d906-4551-b300-979d3846aa88
287 @end ignore