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
9 The following is a list of hook variables that let you provide
10 functions to be called from within Emacs on suitable occasions.
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.
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}. Mode hooks are omitted in the list below.
24 The variables whose names end in @samp{-hooks} or @samp{-functions} are
25 usually @dfn{abnormal hooks}; their values are lists of functions, but
26 these functions are called in a special way (they are passed arguments,
27 or their values are used). A few of these variables are actually normal
28 hooks which were named before we established the convention that normal
29 hooks' names should end in @samp{-hook}.
31 The variables whose names end in @samp{-function} have single functions
32 as their values. (In older Emacs versions, some of these variables had
33 names ending in @samp{-hook} even though they were not normal hooks;
34 however, we have renamed all of those.)
36 @c We need to xref to where each hook is documented or else document
40 @item activate-mark-hook
43 @item after-change-functions
46 @item after-change-major-mode-hook
52 @item after-insert-file-functions
53 @xref{Saving Properties}.
55 @item after-make-frame-functions
56 @xref{Creating Frames}.
58 @item after-revert-hook
62 @xref{Saving Buffers}.
64 @item auto-fill-function
70 @item before-change-functions
73 @item before-init-hook
76 @item before-make-frame-hook
77 @xref{Creating Frames}.
79 @item before-revert-hook
82 @item before-save-hook
83 @xref{Saving Buffers}.
85 @item blink-paren-function
88 @item buffer-access-fontify-functions
89 @xref{Lazy Properties}.
91 @item calendar-load-hook
92 @inforef{Calendar Customizing,, emacs-xtra}.
94 @item change-major-mode-hook
95 @xref{Creating Buffer-Local}.
97 @item command-line-functions
98 @xref{Command-Line Arguments}.
100 @item comment-indent-function
101 @xref{Options for Comments,, Options Controlling Comments, emacs, the
104 @item custom-define-hook
105 Hook called after defining each customize option.
107 @item deactivate-mark-hook
110 @item desktop-after-read-hook
111 Normal hook run after a successful @code{desktop-read}. May be used
112 to show a buffer list. @xref{Saving Emacs Sessions,, Saving Emacs
113 Sessions, emacs, the GNU Emacs Manual}.
115 @item desktop-no-desktop-file-hook
116 Normal hook run when @code{desktop-read} can't find a desktop file.
117 May be used to show a dired buffer. @xref{Saving Emacs Sessions,,
118 Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
120 @item desktop-save-hook
121 Normal hook run before the desktop is saved in a desktop file. This
122 is useful for truncating history lists, for example. @xref{Saving
123 Emacs Sessions,, Saving Emacs Sessions, emacs, the GNU Emacs Manual}.
125 @item diary-display-hook
126 @inforef{Fancy Diary Display,, emacs-xtra}.
129 List of functions called after the display of the diary. Can be used
130 for appointment notification.
132 @item disabled-command-function
133 @xref{Disabling Commands}.
135 @item echo-area-clear-hook
136 @xref{The Echo Area}.
138 @item emacs-startup-hook
142 @xref{Visiting Functions}.
144 @item find-file-not-found-functions
145 @xref{Visiting Functions}.
147 @item first-change-hook
150 @item initial-calendar-window-hook
151 @inforef{Calendar Customizing,, emacs-xtra}.
153 @item kbd-macro-termination-hook
154 @xref{Keyboard Macros}.
156 @item kill-buffer-hook
157 @xref{Killing Buffers}.
159 @item kill-buffer-query-functions
160 @xref{Killing Buffers}.
162 @item kill-emacs-hook
163 @xref{Killing Emacs}.
165 @item kill-emacs-query-functions
166 @xref{Killing Emacs}.
168 @item lisp-indent-function
170 @item list-diary-entries-hook
171 @inforef{Fancy Diary Display,, emacs-xtra}.
173 @item mail-setup-hook
174 @xref{Mail Mode Misc,, Mail Mode Miscellany, emacs, the GNU Emacs
177 @item mark-diary-entries-hook
178 @inforef{Fancy Diary Display,, emacs-xtra}.
180 @item menu-bar-update-hook
183 @item minibuffer-setup-hook
184 @xref{Minibuffer Misc}.
186 @item minibuffer-exit-hook
187 @xref{Minibuffer Misc}.
189 @item mouse-position-function
190 @xref{Mouse Position}.
192 @item nongregorian-diary-listing-hook
193 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
195 @item nongregorian-diary-marking-hook
196 @inforef{Hebrew/Islamic Entries,, emacs-xtra}.
198 @item post-command-hook
199 @xref{Command Overview}.
201 @item pre-abbrev-expand-hook
202 @xref{Abbrev Expansion}.
204 @item pre-command-hook
205 @xref{Command Overview}.
207 @item print-diary-entries-hook
208 @inforef{Diary Customizing,, emacs-xtra}.
210 @item redisplay-end-trigger-functions
213 @item scheme-indent-function
216 @xref{Suspending Emacs}.
218 @item suspend-resume-hook
219 @xref{Suspending Emacs}.
221 @item temp-buffer-setup-hook
222 @xref{Temporary Displays}.
224 @item temp-buffer-show-function
225 @xref{Temporary Displays}.
227 @item temp-buffer-show-hook
228 @xref{Temporary Displays}.
230 @item term-setup-hook
231 @xref{Terminal-Specific}.
233 @item today-visible-calendar-hook
234 @inforef{Calendar Customizing,, emacs-xtra}.
236 @item today-invisible-calendar-hook
237 @inforef{Calendar Customizing,, emacs-xtra}.
239 @item window-configuration-change-hook
242 @item window-scroll-functions
245 @item window-setup-hook
246 @xref{Window Systems}.
248 @item window-size-change-functions
251 @item write-contents-functions
252 @xref{Saving Buffers}.
254 @item write-file-functions
255 @xref{Saving Buffers}.
257 @item write-region-annotate-functions
258 @xref{Saving Properties}.
262 arch-tag: 55fd0296-d906-4551-b300-979d3846aa88