(Thumbnails): Minor cleanup.
[emacs.git] / lispref / hooks.texi
blob2ba06a2b19afc591eb290eee1c6e8d41561242fb
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
12 The following is a list of hook variables that let you provide
13 functions to be called from within Emacs on suitable occasions.
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.
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.
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.
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.)
39 @c We need to xref to where each hook is documented or else document
40 @c it here.
42 @table @code
43 @item activate-mark-hook
44 @xref{The Mark}.
46 @item after-change-functions
47 @xref{Change Hooks}.
49 @item after-change-major-mode-hook
50 @xref{Mode Hooks}.
52 @item after-init-hook
53 @xref{Init File}.
55 @item after-insert-file-functions
56 @xref{Saving Properties}.
58 @item after-make-frame-functions
59 @xref{Creating Frames}.
61 @item after-revert-hook
62 @xref{Reverting}.
64 @item after-save-hook
65 @xref{Saving Buffers}.
67 @item auto-fill-function
68 @xref{Auto Filling}.
70 @item auto-save-hook
71 @xref{Auto-Saving}.
73 @item before-change-functions
74 @xref{Change Hooks}.
76 @item before-init-hook
77 @xref{Init File}.
79 @item before-make-frame-hook
80 @xref{Creating Frames}.
82 @item before-revert-hook
83 @xref{Reverting}.
85 @item before-save-hook
86 @xref{Saving Buffers}.
88 @item blink-paren-function
89 @xref{Blinking}.
91 @item buffer-access-fontify-functions
92 @xref{Lazy Properties}.
94 @item calendar-load-hook
95 @inforef{Calendar Customizing,, emacs-xtra}.
97 @item change-major-mode-hook
98 @xref{Creating Buffer-Local}.
100 @item command-line-functions
101 @xref{Command-Line Arguments}.
103 @item comment-indent-function
104 @xref{Options for Comments,, Options Controlling Comments, emacs, the
105 GNU Emacs Manual}.
107 @item compilation-finish-functions
108 Functions to call when a compilation process finishes.
110 @item custom-define-hook
111 Hook called after defining each customize option.
113 @item deactivate-mark-hook
114 @xref{The Mark}.
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}.
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}.
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}.
131 @item diary-display-hook
132 @inforef{Fancy Diary Display,, emacs-xtra}.
134 @item diary-hook
135 List of functions called after the display of the diary.  Can be used
136 for appointment notification.
138 @item disabled-command-function
139 @xref{Disabling Commands}.
141 @item echo-area-clear-hook
142 @xref{Echo Area Customization}.
144 @item emacs-startup-hook
145 @xref{Init File}.
147 @item find-file-hook
148 @xref{Visiting Functions}.
150 @item find-file-not-found-functions
151 @xref{Visiting Functions}.
153 @item first-change-hook
154 @xref{Change Hooks}.
156 @item font-lock-beginning-of-syntax-function
157 @xref{Syntactic Font Lock}.
159 @item font-lock-fontify-buffer-function
160 @xref{Other Font Lock Variables}.
162 @item font-lock-fontify-region-function
163 @xref{Other Font Lock Variables}.
165 @item font-lock-mark-block-function
166 @xref{Other Font Lock Variables}.
168 @item font-lock-syntactic-face-function
169 @xref{Syntactic Font Lock}.
171 @item font-lock-unfontify-buffer-function
172 @xref{Other Font Lock Variables}.
174 @item font-lock-unfontify-region-function
175 @xref{Other Font Lock Variables}.
177 @item initial-calendar-window-hook
178 @inforef{Calendar Customizing,, emacs-xtra}.
180 @item kbd-macro-termination-hook
181 @xref{Keyboard Macros}.
183 @item kill-buffer-hook
184 @xref{Killing Buffers}.
186 @item kill-buffer-query-functions
187 @xref{Killing Buffers}.
189 @item kill-emacs-hook
190 @xref{Killing Emacs}.
192 @item kill-emacs-query-functions
193 @xref{Killing Emacs}.
195 @item lisp-indent-function
197 @item list-diary-entries-hook
198 @inforef{Fancy Diary Display,, emacs-xtra}.
200 @item mail-setup-hook
201 @xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs
202 Manual}.
204 @item mark-diary-entries-hook
205 @inforef{Fancy Diary Display,, emacs-xtra}.
207 @item menu-bar-update-hook
208 @xref{Menu Bar}.
210 @item minibuffer-setup-hook
211 @xref{Minibuffer Misc}.
213 @item minibuffer-exit-hook
214 @xref{Minibuffer Misc}.
216 @item mouse-position-function
217 @xref{Mouse Position}.
219 @item nongregorian-diary-listing-hook
220 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
222 @item nongregorian-diary-marking-hook
223 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
225 @item occur-hook
227 @item post-command-hook
228 @xref{Command Overview}.
230 @item pre-abbrev-expand-hook
231 @xref{Abbrev Expansion}.
233 @item pre-command-hook
234 @xref{Command Overview}.
236 @item print-diary-entries-hook
237 @inforef{Diary Customizing,, emacs-xtra}.
239 @item redisplay-end-trigger-functions
240 @xref{Window Hooks}.
242 @item scheme-indent-function
244 @item suspend-hook
245 @xref{Suspending Emacs}.
247 @item suspend-resume-hook
248 @xref{Suspending Emacs}.
250 @item temp-buffer-setup-hook
251 @xref{Temporary Displays}.
253 @item temp-buffer-show-function
254 @xref{Temporary Displays}.
256 @item temp-buffer-show-hook
257 @xref{Temporary Displays}.
259 @item term-setup-hook
260 @xref{Terminal-Specific}.
262 @item today-visible-calendar-hook
263 @inforef{Calendar Customizing,, emacs-xtra}.
265 @item today-invisible-calendar-hook
266 @inforef{Calendar Customizing,, emacs-xtra}.
268 @item window-configuration-change-hook
269 @xref{Window Hooks}.
271 @item window-scroll-functions
272 @xref{Window Hooks}.
274 @item window-setup-hook
275 @xref{Window Systems}.
277 @item window-size-change-functions
278 @xref{Window Hooks}.
280 @item write-contents-functions
281 @xref{Saving Buffers}.
283 @item write-file-functions
284 @xref{Saving Buffers}.
286 @item write-region-annotate-functions
287 @xref{Saving Properties}.
288 @end table
290 @ignore
291    arch-tag: 55fd0296-d906-4551-b300-979d3846aa88
292 @end ignore