]> code.delx.au - gnu-emacs/blob - lispref/hooks.texi
(Standard Hooks): Most minor modes have mode hooks too.
[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, 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
9 The following is a list of hook variables that let you provide
10 functions to be called from within Emacs on suitable occasions.
11
12 Most 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
14 a hook is a list of functions; the functions are called with no
15 arguments and their values are completely ignored. The recommended way
16 to put a new function on such a hook is to call @code{add-hook}.
17 @xref{Hooks}, for more information about using hooks.
18
19 Every major mode defines a mode hook named
20 @samp{@var{modename}-mode-hook}. The major mode command runs this
21 normal hook with @code{run-mode-hooks} as the very last thing it does.
22 @xref{Mode Hooks}. Most minor modes have mode hooks too. Mode hooks
23 are omitted in the list below.
24
25 The variables whose names end in @samp{-hooks} or @samp{-functions} are
26 usually @dfn{abnormal hooks}; their values are lists of functions, but
27 these functions are called in a special way (they are passed arguments,
28 or their values are used). A few of these variables are actually normal
29 hooks which were named before we established the convention that normal
30 hooks' names should end in @samp{-hook}.
31
32 The variables whose names end in @samp{-function} have single functions
33 as their values. (In older Emacs versions, some of these variables had
34 names ending in @samp{-hook} even though they were not normal hooks;
35 however, we have renamed all of those.)
36
37 @c We need to xref to where each hook is documented or else document
38 @c it here.
39
40 @table @code
41 @item activate-mark-hook
42 @xref{The Mark}.
43
44 @item after-change-functions
45 @xref{Change Hooks}.
46
47 @item after-change-major-mode-hook
48 @xref{Mode Hooks}.
49
50 @item after-init-hook
51 @xref{Init File}.
52
53 @item after-insert-file-functions
54 @xref{Saving Properties}.
55
56 @item after-make-frame-functions
57 @xref{Creating Frames}.
58
59 @item after-revert-hook
60 @xref{Reverting}.
61
62 @item after-save-hook
63 @xref{Saving Buffers}.
64
65 @item auto-fill-function
66 @xref{Auto Filling}.
67
68 @item auto-save-hook
69 @xref{Auto-Saving}.
70
71 @item before-change-functions
72 @xref{Change Hooks}.
73
74 @item before-init-hook
75 @xref{Init File}.
76
77 @item before-make-frame-hook
78 @xref{Creating Frames}.
79
80 @item before-revert-hook
81 @xref{Reverting}.
82
83 @item before-save-hook
84 @xref{Saving Buffers}.
85
86 @item blink-paren-function
87 @xref{Blinking}.
88
89 @item buffer-access-fontify-functions
90 @xref{Lazy Properties}.
91
92 @item calendar-load-hook
93 @inforef{Calendar Customizing,, emacs-xtra}.
94
95 @item change-major-mode-hook
96 @xref{Creating Buffer-Local}.
97
98 @item command-line-functions
99 @xref{Command-Line Arguments}.
100
101 @item comment-indent-function
102 @xref{Options for Comments,, Options Controlling Comments, emacs, the
103 GNU Emacs Manual}.
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{The Echo Area}.
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 initial-calendar-window-hook
152 @inforef{Calendar Customizing,, emacs-xtra}.
153
154 @item kbd-macro-termination-hook
155 @xref{Keyboard Macros}.
156
157 @item kill-buffer-hook
158 @xref{Killing Buffers}.
159
160 @item kill-buffer-query-functions
161 @xref{Killing Buffers}.
162
163 @item kill-emacs-hook
164 @xref{Killing Emacs}.
165
166 @item kill-emacs-query-functions
167 @xref{Killing Emacs}.
168
169 @item lisp-indent-function
170
171 @item list-diary-entries-hook
172 @inforef{Fancy Diary Display,, emacs-xtra}.
173
174 @item mail-setup-hook
175 @xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs
176 Manual}.
177
178 @item mark-diary-entries-hook
179 @inforef{Fancy Diary Display,, emacs-xtra}.
180
181 @item menu-bar-update-hook
182 @xref{Menu Bar}.
183
184 @item minibuffer-setup-hook
185 @xref{Minibuffer Misc}.
186
187 @item minibuffer-exit-hook
188 @xref{Minibuffer Misc}.
189
190 @item mouse-position-function
191 @xref{Mouse Position}.
192
193 @item nongregorian-diary-listing-hook
194 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
195
196 @item nongregorian-diary-marking-hook
197 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
198
199 @item post-command-hook
200 @xref{Command Overview}.
201
202 @item pre-abbrev-expand-hook
203 @xref{Abbrev Expansion}.
204
205 @item pre-command-hook
206 @xref{Command Overview}.
207
208 @item print-diary-entries-hook
209 @inforef{Diary Customizing,, emacs-xtra}.
210
211 @item redisplay-end-trigger-functions
212 @xref{Window Hooks}.
213
214 @item scheme-indent-function
215
216 @item suspend-hook
217 @xref{Suspending Emacs}.
218
219 @item suspend-resume-hook
220 @xref{Suspending Emacs}.
221
222 @item temp-buffer-setup-hook
223 @xref{Temporary Displays}.
224
225 @item temp-buffer-show-function
226 @xref{Temporary Displays}.
227
228 @item temp-buffer-show-hook
229 @xref{Temporary Displays}.
230
231 @item term-setup-hook
232 @xref{Terminal-Specific}.
233
234 @item today-visible-calendar-hook
235 @inforef{Calendar Customizing,, emacs-xtra}.
236
237 @item today-invisible-calendar-hook
238 @inforef{Calendar Customizing,, emacs-xtra}.
239
240 @item window-configuration-change-hook
241 @xref{Window Hooks}.
242
243 @item window-scroll-functions
244 @xref{Window Hooks}.
245
246 @item window-setup-hook
247 @xref{Window Systems}.
248
249 @item window-size-change-functions
250 @xref{Window Hooks}.
251
252 @item write-contents-functions
253 @xref{Saving Buffers}.
254
255 @item write-file-functions
256 @xref{Saving Buffers}.
257
258 @item write-region-annotate-functions
259 @xref{Saving Properties}.
260 @end table
261
262 @ignore
263 arch-tag: 55fd0296-d906-4551-b300-979d3846aa88
264 @end ignore