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