Mercurial > emacs
annotate doc/lispref/hooks.texi @ 104759:42d63191b7cc
(Threads Buffer, Multithreaded Debugging):
Re-organise these two sections,
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Mon, 31 Aug 2009 03:52:29 +0000 |
parents | f2f11372ba48 |
children | a05fe4b5534d |
rev | line source |
---|---|
84074 | 1 @c -*-texinfo-*- |
2 @c This is part of the GNU Emacs Lisp Reference Manual. | |
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1998, 2001, 2002, 2003, 2004, | |
100974 | 4 @c 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. |
84074 | 5 @c See the file elisp.texi for copying conditions. |
84116
0ba80d073e27
(setfilename): Go up one more level to ../../info.
Glenn Morris <rgm@gnu.org>
parents:
84074
diff
changeset
|
6 @setfilename ../../info/hooks |
84074 | 7 @node Standard Hooks, Index, Standard Keymaps, Top |
8 @appendix Standard Hooks | |
9 @cindex standard hooks | |
10 @cindex hook variables, list of | |
11 | |
12 The following is a list of hook variables that let you provide | |
13 functions to be called from within Emacs on suitable occasions. | |
14 | |
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. | |
21 | |
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. | |
27 | |
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. | |
33 | |
87098 | 34 A special feature allows you to specify expressions to evaluate if and |
35 when a file is loaded (@pxref{Hooks for Loading}). That feature is | |
36 not exactly a hook, but does a similar job. | |
37 | |
84074 | 38 @c We need to xref to where each hook is documented or else document |
39 @c it here. | |
40 | |
41 @table @code | |
103149
a8c9fae0b19d
* hooks.texi (Standard Hooks): Add abbrev-expand-functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
101259
diff
changeset
|
42 @item abbrev-expand-functions |
a8c9fae0b19d
* hooks.texi (Standard Hooks): Add abbrev-expand-functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
101259
diff
changeset
|
43 @xref{Abbrev Expansion}. |
a8c9fae0b19d
* hooks.texi (Standard Hooks): Add abbrev-expand-functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
101259
diff
changeset
|
44 |
84074 | 45 @item activate-mark-hook |
46 @xref{The Mark}. | |
47 | |
48 @item after-change-functions | |
49 @xref{Change Hooks}. | |
50 | |
51 @item after-change-major-mode-hook | |
52 @xref{Mode Hooks}. | |
53 | |
54 @item after-init-hook | |
55 @xref{Init File}. | |
56 | |
57 @item after-insert-file-functions | |
58 @xref{Format Conversion}. | |
59 | |
60 @item after-make-frame-functions | |
61 @xref{Creating Frames}. | |
62 | |
63 @item after-revert-hook | |
64 @xref{Reverting}. | |
65 | |
66 @item after-save-hook | |
67 @xref{Saving Buffers}. | |
68 | |
69 @item auto-fill-function | |
70 @xref{Auto Filling}. | |
71 | |
72 @item auto-save-hook | |
73 @xref{Auto-Saving}. | |
74 | |
75 @item before-change-functions | |
76 @xref{Change Hooks}. | |
77 | |
98880
6212560661dc
Mention `before-hack-local-variables-hook' and `hack-local-variables-hook'.
Eli Zaretskii <eliz@gnu.org>
parents:
87649
diff
changeset
|
78 @item before-hack-local-variables-hook |
6212560661dc
Mention `before-hack-local-variables-hook' and `hack-local-variables-hook'.
Eli Zaretskii <eliz@gnu.org>
parents:
87649
diff
changeset
|
79 @xref{File Local Variables}. |
6212560661dc
Mention `before-hack-local-variables-hook' and `hack-local-variables-hook'.
Eli Zaretskii <eliz@gnu.org>
parents:
87649
diff
changeset
|
80 |
84074 | 81 @item before-init-hook |
82 @xref{Init File}. | |
83 | |
84 @item before-make-frame-hook | |
85 @xref{Creating Frames}. | |
86 | |
87 @item before-revert-hook | |
88 @xref{Reverting}. | |
89 | |
90 @item before-save-hook | |
91 @xref{Saving Buffers}. | |
92 | |
93 @item blink-paren-function | |
94 @xref{Blinking}. | |
95 | |
96 @item buffer-access-fontify-functions | |
97 @xref{Lazy Properties}. | |
98 | |
99 @item calendar-load-hook | |
100 @iftex | |
101 @inforef{Calendar Customizing,, emacs-xtra}. | |
102 @end iftex | |
103 @ifnottex | |
104 @xref{Calendar Customizing,,, emacs}. | |
105 @end ifnottex | |
106 | |
107 | |
108 @item change-major-mode-hook | |
109 @xref{Creating Buffer-Local}. | |
110 | |
111 @item command-line-functions | |
112 @xref{Command-Line Arguments}. | |
113 | |
114 @item comment-indent-function | |
115 @xref{Options for Comments,, Options Controlling Comments, emacs, the | |
116 GNU Emacs Manual}. | |
117 | |
118 @item compilation-finish-functions | |
119 Functions to call when a compilation process finishes. | |
120 | |
121 @item custom-define-hook | |
122 Hook called after defining each customize option. | |
123 | |
124 @item deactivate-mark-hook | |
125 @xref{The Mark}. | |
126 | |
101252
49c0bb71637c
(Standard Hooks): Document `delete-frame-functions' and
Eli Zaretskii <eliz@gnu.org>
parents:
100974
diff
changeset
|
127 @item delete-frame-functions |
49c0bb71637c
(Standard Hooks): Document `delete-frame-functions' and
Eli Zaretskii <eliz@gnu.org>
parents:
100974
diff
changeset
|
128 Functions to call when Emacs deletes a frame. @xref{Deleting Frames}. |
49c0bb71637c
(Standard Hooks): Document `delete-frame-functions' and
Eli Zaretskii <eliz@gnu.org>
parents:
100974
diff
changeset
|
129 |
49c0bb71637c
(Standard Hooks): Document `delete-frame-functions' and
Eli Zaretskii <eliz@gnu.org>
parents:
100974
diff
changeset
|
130 @item delete-terminal-functions |
49c0bb71637c
(Standard Hooks): Document `delete-frame-functions' and
Eli Zaretskii <eliz@gnu.org>
parents:
100974
diff
changeset
|
131 Functions to call when Emacs deletes a terminal. @xref{Multiple |
49c0bb71637c
(Standard Hooks): Document `delete-frame-functions' and
Eli Zaretskii <eliz@gnu.org>
parents:
100974
diff
changeset
|
132 Terminals}. |
49c0bb71637c
(Standard Hooks): Document `delete-frame-functions' and
Eli Zaretskii <eliz@gnu.org>
parents:
100974
diff
changeset
|
133 |
84074 | 134 @item desktop-after-read-hook |
135 Normal hook run after a successful @code{desktop-read}. May be used | |
136 to show a buffer list. @xref{Saving Emacs Sessions,, Saving Emacs | |
137 Sessions, emacs, the GNU Emacs Manual}. | |
138 | |
139 @item desktop-no-desktop-file-hook | |
140 Normal hook run when @code{desktop-read} can't find a desktop file. | |
141 May be used to show a dired buffer. @xref{Saving Emacs Sessions,, | |
142 Saving Emacs Sessions, emacs, the GNU Emacs Manual}. | |
143 | |
144 @item desktop-save-hook | |
145 Normal hook run before the desktop is saved in a desktop file. This | |
146 is useful for truncating history lists, for example. @xref{Saving | |
147 Emacs Sessions,, Saving Emacs Sessions, emacs, the GNU Emacs Manual}. | |
148 | |
149 @item diary-display-hook | |
150 @iftex | |
151 @inforef{Fancy Diary Display,, emacs-xtra}. | |
152 @end iftex | |
153 @ifnottex | |
154 @xref{Fancy Diary Display,,, emacs}. | |
155 @end ifnottex | |
156 | |
157 @item diary-hook | |
158 List of functions called after the display of the diary. Can be used | |
159 for appointment notification. | |
160 | |
161 @item disabled-command-function | |
162 @xref{Disabling Commands}. | |
163 | |
164 @item echo-area-clear-hook | |
165 @xref{Echo Area Customization}. | |
166 | |
167 @item emacs-startup-hook | |
168 @xref{Init File}. | |
169 | |
170 @item find-file-hook | |
171 @xref{Visiting Functions}. | |
172 | |
173 @item find-file-not-found-functions | |
174 @xref{Visiting Functions}. | |
175 | |
176 @item first-change-hook | |
177 @xref{Change Hooks}. | |
178 | |
179 @item font-lock-beginning-of-syntax-function | |
180 @xref{Syntactic Font Lock}. | |
181 | |
182 @item font-lock-fontify-buffer-function | |
183 @xref{Other Font Lock Variables}. | |
184 | |
185 @item font-lock-fontify-region-function | |
186 @xref{Other Font Lock Variables}. | |
187 | |
188 @item font-lock-mark-block-function | |
189 @xref{Other Font Lock Variables}. | |
190 | |
191 @item font-lock-syntactic-face-function | |
192 @xref{Syntactic Font Lock}. | |
193 | |
194 @item font-lock-unfontify-buffer-function | |
195 @xref{Other Font Lock Variables}. | |
196 | |
98880
6212560661dc
Mention `before-hack-local-variables-hook' and `hack-local-variables-hook'.
Eli Zaretskii <eliz@gnu.org>
parents:
87649
diff
changeset
|
197 @item hack-local-variables-hook |
6212560661dc
Mention `before-hack-local-variables-hook' and `hack-local-variables-hook'.
Eli Zaretskii <eliz@gnu.org>
parents:
87649
diff
changeset
|
198 @xref{File Local Variables}. |
6212560661dc
Mention `before-hack-local-variables-hook' and `hack-local-variables-hook'.
Eli Zaretskii <eliz@gnu.org>
parents:
87649
diff
changeset
|
199 |
84074 | 200 @item font-lock-unfontify-region-function |
201 @xref{Other Font Lock Variables}. | |
202 | |
203 @item initial-calendar-window-hook | |
204 @iftex | |
205 @inforef{Calendar Customizing,, emacs-xtra}. | |
206 @end iftex | |
207 @ifnottex | |
208 @xref{Calendar Customizing,,, emacs}. | |
209 @end ifnottex | |
210 | |
211 @item kbd-macro-termination-hook | |
212 @xref{Keyboard Macros}. | |
213 | |
214 @item kill-buffer-hook | |
215 @xref{Killing Buffers}. | |
216 | |
217 @item kill-buffer-query-functions | |
218 @xref{Killing Buffers}. | |
219 | |
220 @item kill-emacs-hook | |
221 @xref{Killing Emacs}. | |
222 | |
223 @item kill-emacs-query-functions | |
224 @xref{Killing Emacs}. | |
225 | |
226 @item lisp-indent-function | |
227 | |
228 @item list-diary-entries-hook | |
229 @iftex | |
230 @inforef{Fancy Diary Display,, emacs-xtra}. | |
231 @end iftex | |
232 @ifnottex | |
233 @xref{Fancy Diary Display,,, emacs}. | |
234 @end ifnottex | |
235 | |
236 @item mail-setup-hook | |
237 @xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs | |
238 Manual}. | |
239 | |
240 @item mark-diary-entries-hook | |
241 @iftex | |
242 @inforef{Fancy Diary Display,, emacs-xtra}. | |
243 @end iftex | |
244 @ifnottex | |
245 @xref{Fancy Diary Display,,, emacs}. | |
246 @end ifnottex | |
247 | |
248 @item menu-bar-update-hook | |
249 @xref{Menu Bar}. | |
250 | |
251 @item minibuffer-setup-hook | |
252 @xref{Minibuffer Misc}. | |
253 | |
254 @item minibuffer-exit-hook | |
255 @xref{Minibuffer Misc}. | |
256 | |
257 @item mouse-position-function | |
258 @xref{Mouse Position}. | |
259 | |
260 @item nongregorian-diary-listing-hook | |
261 @iftex | |
103853
f2f11372ba48
Kevin Ryde <user42 at zip.com.au>
Glenn Morris <rgm@gnu.org>
parents:
103299
diff
changeset
|
262 @inforef{Non-Gregorian Diary,, emacs-xtra}. |
84074 | 263 @end iftex |
264 @ifnottex | |
103853
f2f11372ba48
Kevin Ryde <user42 at zip.com.au>
Glenn Morris <rgm@gnu.org>
parents:
103299
diff
changeset
|
265 @xref{Non-Gregorian Diary,,, emacs}. |
84074 | 266 @end ifnottex |
267 | |
268 @item nongregorian-diary-marking-hook | |
269 @iftex | |
103853
f2f11372ba48
Kevin Ryde <user42 at zip.com.au>
Glenn Morris <rgm@gnu.org>
parents:
103299
diff
changeset
|
270 @inforef{Non-Gregorian Diary,, emacs-xtra}. |
84074 | 271 @end iftex |
272 @ifnottex | |
103853
f2f11372ba48
Kevin Ryde <user42 at zip.com.au>
Glenn Morris <rgm@gnu.org>
parents:
103299
diff
changeset
|
273 @xref{Non-Gregorian Diary,,, emacs}. |
84074 | 274 @end ifnottex |
275 | |
276 @item occur-hook | |
277 | |
278 @item post-command-hook | |
279 @xref{Command Overview}. | |
280 | |
281 @item pre-command-hook | |
282 @xref{Command Overview}. | |
283 | |
284 @item print-diary-entries-hook | |
285 @iftex | |
286 @inforef{Diary Customizing,, emacs-xtra}. | |
287 @end iftex | |
288 @ifnottex | |
289 @xref{Diary Customizing,,, emacs}. | |
290 @end ifnottex | |
291 | |
101259
7b78c1f3ecae
(Standard Hooks): Document `suspend-tty-functions' and `resume-tty-functions'.
Eli Zaretskii <eliz@gnu.org>
parents:
101252
diff
changeset
|
292 @item resume-tty-functions |
7b78c1f3ecae
(Standard Hooks): Document `suspend-tty-functions' and `resume-tty-functions'.
Eli Zaretskii <eliz@gnu.org>
parents:
101252
diff
changeset
|
293 @xref{Suspending Emacs}. |
7b78c1f3ecae
(Standard Hooks): Document `suspend-tty-functions' and `resume-tty-functions'.
Eli Zaretskii <eliz@gnu.org>
parents:
101252
diff
changeset
|
294 |
84074 | 295 @item scheme-indent-function |
296 | |
297 @item suspend-hook | |
298 @xref{Suspending Emacs}. | |
299 | |
300 @item suspend-resume-hook | |
301 @xref{Suspending Emacs}. | |
302 | |
101259
7b78c1f3ecae
(Standard Hooks): Document `suspend-tty-functions' and `resume-tty-functions'.
Eli Zaretskii <eliz@gnu.org>
parents:
101252
diff
changeset
|
303 @item suspend-tty-functions |
7b78c1f3ecae
(Standard Hooks): Document `suspend-tty-functions' and `resume-tty-functions'.
Eli Zaretskii <eliz@gnu.org>
parents:
101252
diff
changeset
|
304 @xref{Suspending Emacs}. |
7b78c1f3ecae
(Standard Hooks): Document `suspend-tty-functions' and `resume-tty-functions'.
Eli Zaretskii <eliz@gnu.org>
parents:
101252
diff
changeset
|
305 |
84074 | 306 @item temp-buffer-setup-hook |
307 @xref{Temporary Displays}. | |
308 | |
309 @item temp-buffer-show-function | |
310 @xref{Temporary Displays}. | |
311 | |
312 @item temp-buffer-show-hook | |
313 @xref{Temporary Displays}. | |
314 | |
315 @item term-setup-hook | |
316 @xref{Terminal-Specific}. | |
317 | |
318 @item today-visible-calendar-hook | |
319 @iftex | |
320 @inforef{Calendar Customizing,, emacs-xtra}. | |
321 @end iftex | |
322 @ifnottex | |
323 @xref{Calendar Customizing,,, emacs}. | |
324 @end ifnottex | |
325 | |
326 @item today-invisible-calendar-hook | |
327 @iftex | |
328 @inforef{Calendar Customizing,, emacs-xtra}. | |
329 @end iftex | |
330 @ifnottex | |
331 @xref{Calendar Customizing,,, emacs}. | |
332 @end ifnottex | |
333 | |
334 @item window-configuration-change-hook | |
335 @xref{Window Hooks}. | |
336 | |
337 @item window-scroll-functions | |
338 @xref{Window Hooks}. | |
339 | |
340 @item window-setup-hook | |
341 @xref{Window Systems}. | |
342 | |
343 @item window-size-change-functions | |
344 @xref{Window Hooks}. | |
345 | |
346 @item write-contents-functions | |
347 @xref{Saving Buffers}. | |
348 | |
349 @item write-file-functions | |
350 @xref{Saving Buffers}. | |
351 | |
352 @item write-region-annotate-functions | |
353 @xref{Format Conversion}. | |
354 @end table | |
355 | |
356 @ignore | |
357 arch-tag: 55fd0296-d906-4551-b300-979d3846aa88 | |
358 @end ignore |