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). A few of these variables are actually normal
30 hooks which were named before we established the convention that normal
31 hooks' names should end in @samp{-hook}.
33 The variables whose names end in @samp{-function} have single functions
34 as their values. (In older Emacs versions, some of these variables had
35 names ending in @samp{-hook} even though they were not normal hooks;
36 however, we have renamed all of those.)
38 @c We need to xref to where each hook is documented or else document
42 @item activate-mark-hook
45 @item after-change-functions
48 @item after-change-major-mode-hook
54 @item after-insert-file-functions
55 @xref{Saving Properties}.
57 @item after-make-frame-functions
58 @xref{Creating Frames}.
60 @item after-revert-hook
64 @xref{Saving Buffers}.
66 @item auto-fill-function
72 @item before-change-functions
75 @item before-init-hook
78 @item before-make-frame-hook
79 @xref{Creating Frames}.
81 @item before-revert-hook
84 @item before-save-hook
85 @xref{Saving Buffers}.
87 @item blink-paren-function
90 @item buffer-access-fontify-functions
91 @xref{Lazy Properties}.
93 @item calendar-load-hook
94 @inforef{Calendar Customizing,, emacs-xtra}.
96 @item change-major-mode-hook
97 @xref{Creating Buffer-Local}.
99 @item command-line-functions
100 @xref{Command-Line Arguments}.
102 @item comment-indent-function
103 @xref{Options for Comments,, Options Controlling Comments, emacs, the
106 @item custom-define-hook
107 Hook called after defining each customize option.
109 @item deactivate-mark-hook
112 @item desktop-after-read-hook
113 Normal hook run after a successful @code{desktop-read}. May be used
114 to show a buffer list. @xref{Saving Emacs Sessions,, Saving Emacs
115 Sessions, emacs, the GNU Emacs Manual}.
117 @item desktop-no-desktop-file-hook
118 Normal hook run when @code{desktop-read} can't find a desktop file.
119 May be used to show a dired buffer. @xref{Saving Emacs Sessions,,
120 Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
122 @item desktop-save-hook
123 Normal hook run before the desktop is saved in a desktop file. This
124 is useful for truncating history lists, for example. @xref{Saving
125 Emacs Sessions,, Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
127 @item diary-display-hook
128 @inforef{Fancy Diary Display,, emacs-xtra}.
131 List of functions called after the display of the diary. Can be used
132 for appointment notification.
134 @item disabled-command-function
135 @xref{Disabling Commands}.
137 @item echo-area-clear-hook
138 @xref{The Echo Area}.
140 @item emacs-startup-hook
144 @xref{Visiting Functions}.
146 @item find-file-not-found-functions
147 @xref{Visiting Functions}.
149 @item first-change-hook
152 @item font-lock-beginning-of-syntax-function
153 @xref{Syntactic Font Lock}.
155 @item font-lock-fontify-buffer-function
156 @xref{Other Font Lock Variables}.
158 @item font-lock-fontify-region-function
159 @xref{Other Font Lock Variables}.
161 @item font-lock-mark-block-function
162 @xref{Other Font Lock Variables}.
164 @item font-lock-syntactic-face-function
165 @xref{Syntactic Font Lock}.
167 @item font-lock-unfontify-buffer-function
168 @xref{Other Font Lock Variables}.
170 @item font-lock-unfontify-region-function
171 @xref{Other Font Lock Variables}.
173 @item initial-calendar-window-hook
174 @inforef{Calendar Customizing,, emacs-xtra}.
176 @item kbd-macro-termination-hook
177 @xref{Keyboard Macros}.
179 @item kill-buffer-hook
180 @xref{Killing Buffers}.
182 @item kill-buffer-query-functions
183 @xref{Killing Buffers}.
185 @item kill-emacs-hook
186 @xref{Killing Emacs}.
188 @item kill-emacs-query-functions
189 @xref{Killing Emacs}.
191 @item lisp-indent-function
193 @item list-diary-entries-hook
194 @inforef{Fancy Diary Display,, emacs-xtra}.
196 @item mail-setup-hook
197 @xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs
200 @item mark-diary-entries-hook
201 @inforef{Fancy Diary Display,, emacs-xtra}.
203 @item menu-bar-update-hook
206 @item minibuffer-setup-hook
207 @xref{Minibuffer Misc}.
209 @item minibuffer-exit-hook
210 @xref{Minibuffer Misc}.
212 @item mouse-position-function
213 @xref{Mouse Position}.
215 @item nongregorian-diary-listing-hook
216 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
218 @item nongregorian-diary-marking-hook
219 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
223 @item post-command-hook
224 @xref{Command Overview}.
226 @item pre-abbrev-expand-hook
227 @xref{Abbrev Expansion}.
229 @item pre-command-hook
230 @xref{Command Overview}.
232 @item print-diary-entries-hook
233 @inforef{Diary Customizing,, emacs-xtra}.
235 @item redisplay-end-trigger-functions
238 @item scheme-indent-function
241 @xref{Suspending Emacs}.
243 @item suspend-resume-hook
244 @xref{Suspending Emacs}.
246 @item temp-buffer-setup-hook
247 @xref{Temporary Displays}.
249 @item temp-buffer-show-function
250 @xref{Temporary Displays}.
252 @item temp-buffer-show-hook
253 @xref{Temporary Displays}.
255 @item term-setup-hook
256 @xref{Terminal-Specific}.
258 @item today-visible-calendar-hook
259 @inforef{Calendar Customizing,, emacs-xtra}.
261 @item today-invisible-calendar-hook
262 @inforef{Calendar Customizing,, emacs-xtra}.
264 @item window-configuration-change-hook
267 @item window-scroll-functions
270 @item window-setup-hook
271 @xref{Window Systems}.
273 @item window-size-change-functions
276 @item write-contents-functions
277 @xref{Saving Buffers}.
279 @item write-file-functions
280 @xref{Saving Buffers}.
282 @item write-region-annotate-functions
283 @xref{Saving Properties}.
287 arch-tag: 55fd0296-d906-4551-b300-979d3846aa88