a1767faf833337816030708a18789c8910753740
[chise/xemacs-chise.git] / info / lispref.info-46
1 This is ../info/lispref.info, produced by makeinfo version 4.0 from
2 lispref/lispref.texi.
3
4 INFO-DIR-SECTION XEmacs Editor
5 START-INFO-DIR-ENTRY
6 * Lispref: (lispref).           XEmacs Lisp Reference Manual.
7 END-INFO-DIR-ENTRY
8
9    Edition History:
10
11    GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU
12 Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid
13 Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994
14 XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995
15 GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp
16 Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp
17 Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp
18 Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May,
19 November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998
20
21    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software
22 Foundation, Inc.  Copyright (C) 1994, 1995 Sun Microsystems, Inc.
23 Copyright (C) 1995, 1996 Ben Wing.
24
25    Permission is granted to make and distribute verbatim copies of this
26 manual provided the copyright notice and this permission notice are
27 preserved on all copies.
28
29    Permission is granted to copy and distribute modified versions of
30 this manual under the conditions for verbatim copying, provided that the
31 entire resulting derived work is distributed under the terms of a
32 permission notice identical to this one.
33
34    Permission is granted to copy and distribute translations of this
35 manual into another language, under the above conditions for modified
36 versions, except that this permission notice may be stated in a
37 translation approved by the Foundation.
38
39    Permission is granted to copy and distribute modified versions of
40 this manual under the conditions for verbatim copying, provided also
41 that the section entitled "GNU General Public License" is included
42 exactly as in the original, and provided that the entire resulting
43 derived work is distributed under the terms of a permission notice
44 identical to this one.
45
46    Permission is granted to copy and distribute translations of this
47 manual into another language, under the above conditions for modified
48 versions, except that the section entitled "GNU General Public License"
49 may be included in a translation approved by the Free Software
50 Foundation instead of in the original English.
51
52 \1f
53 File: lispref.info,  Node: Garbage Collection,  Prev: Pure Storage,  Up: Building XEmacs and Object Allocation
54
55 Garbage Collection
56 ==================
57
58    When a program creates a list or the user defines a new function
59 (such as by loading a library), that data is placed in normal storage.
60 If normal storage runs low, then XEmacs asks the operating system to
61 allocate more memory in blocks of 2k bytes.  Each block is used for one
62 type of Lisp object, so symbols, cons cells, markers, etc., are
63 segregated in distinct blocks in memory.  (Vectors, long strings,
64 buffers and certain other editing types, which are fairly large, are
65 allocated in individual blocks, one per object, while small strings are
66 packed into blocks of 8k bytes. [More correctly, a string is allocated
67 in two sections: a fixed size chunk containing the length, list of
68 extents, etc.; and a chunk containing the actual characters in the
69 string.  It is this latter chunk that is either allocated individually
70 or packed into 8k blocks.  The fixed size chunk is packed into 2k
71 blocks, as for conses, markers, etc.])
72
73    It is quite common to use some storage for a while, then release it
74 by (for example) killing a buffer or deleting the last pointer to an
75 object.  XEmacs provides a "garbage collector" to reclaim this
76 abandoned storage.  (This name is traditional, but "garbage recycler"
77 might be a more intuitive metaphor for this facility.)
78
79    The garbage collector operates by finding and marking all Lisp
80 objects that are still accessible to Lisp programs.  To begin with, it
81 assumes all the symbols, their values and associated function
82 definitions, and any data presently on the stack, are accessible.  Any
83 objects that can be reached indirectly through other accessible objects
84 are also accessible.
85
86    When marking is finished, all objects still unmarked are garbage.  No
87 matter what the Lisp program or the user does, it is impossible to refer
88 to them, since there is no longer a way to reach them.  Their space
89 might as well be reused, since no one will miss them.  The second
90 ("sweep") phase of the garbage collector arranges to reuse them.
91
92    The sweep phase puts unused cons cells onto a "free list" for future
93 allocation; likewise for symbols, markers, extents, events, floats,
94 compiled-function objects, and the fixed-size portion of strings.  It
95 compacts the accessible small string-chars chunks so they occupy fewer
96 8k blocks; then it frees the other 8k blocks.  Vectors, buffers,
97 windows, and other large objects are individually allocated and freed
98 using `malloc' and `free'.
99
100      Common Lisp note: unlike other Lisps, XEmacs Lisp does not call
101      the garbage collector when the free list is empty.  Instead, it
102      simply requests the operating system to allocate more storage, and
103      processing continues until `gc-cons-threshold' bytes have been
104      used.
105
106      This means that you can make sure that the garbage collector will
107      not run during a certain portion of a Lisp program by calling the
108      garbage collector explicitly just before it (provided that portion
109      of the program does not use so much space as to force a second
110      garbage collection).
111
112  - Command: garbage-collect
113      This command runs a garbage collection, and returns information on
114      the amount of space in use.  (Garbage collection can also occur
115      spontaneously if you use more than `gc-cons-threshold' bytes of
116      Lisp data since the previous garbage collection.)
117
118      `garbage-collect' returns a list containing the following
119      information:
120
121           ((USED-CONSES . FREE-CONSES)
122            (USED-SYMS . FREE-SYMS)
123            (USED-MARKERS . FREE-MARKERS)
124            USED-STRING-CHARS
125            USED-VECTOR-SLOTS
126            (PLIST))
127           
128           => ((73362 . 8325) (13718 . 164)
129           (5089 . 5098) 949121 118677
130           (conses-used 73362 conses-free 8329 cons-storage 658168
131           symbols-used 13718 symbols-free 164 symbol-storage 335216
132           bit-vectors-used 0 bit-vectors-total-length 0
133           bit-vector-storage 0 vectors-used 7882
134           vectors-total-length 118677 vector-storage 537764
135           compiled-functions-used 1336 compiled-functions-free 37
136           compiled-function-storage 44440 short-strings-used 28829
137           long-strings-used 2 strings-free 7722
138           short-strings-total-length 916657 short-string-storage 1179648
139           long-strings-total-length 32464 string-header-storage 441504
140           floats-used 3 floats-free 43 float-storage 2044 markers-used 5089
141           markers-free 5098 marker-storage 245280 events-used 103
142           events-free 835 event-storage 110656 extents-used 10519
143           extents-free 2718 extent-storage 372736
144           extent-auxiliarys-used 111 extent-auxiliarys-freed 3
145           extent-auxiliary-storage 4440 window-configurations-used 39
146           window-configurations-on-free-list 5
147           window-configurations-freed 10 window-configuration-storage 9492
148           popup-datas-used 3 popup-data-storage 72 toolbar-buttons-used 62
149           toolbar-button-storage 4960 toolbar-datas-used 12
150           toolbar-data-storage 240 symbol-value-buffer-locals-used 182
151           symbol-value-buffer-local-storage 5824
152           symbol-value-lisp-magics-used 22
153           symbol-value-lisp-magic-storage 1496
154           symbol-value-varaliases-used 43
155           symbol-value-varalias-storage 1032 opaque-lists-used 2
156           opaque-list-storage 48 color-instances-used 12
157           color-instance-storage 288 font-instances-used 5
158           font-instance-storage 180 opaques-used 11 opaque-storage 312
159           range-tables-used 1 range-table-storage 16 faces-used 34
160           face-storage 2584 glyphs-used 124 glyph-storage 4464
161           specifiers-used 775 specifier-storage 43869 weak-lists-used 786
162           weak-list-storage 18864 char-tables-used 40
163           char-table-storage 41920 buffers-used 25 buffer-storage 7000
164           extent-infos-used 457 extent-infos-freed 73
165           extent-info-storage 9140 keymaps-used 275 keymap-storage 12100
166           consoles-used 4 console-storage 384 command-builders-used 2
167           command-builder-storage 120 devices-used 2 device-storage 344
168           frames-used 3 frame-storage 624 image-instances-used 47
169           image-instance-storage 3008 windows-used 27 windows-freed 2
170           window-storage 9180 lcrecord-lists-used 15
171           lcrecord-list-storage 360 hash-tables-used 631
172           hash-table-storage 25240 streams-used 1 streams-on-free-list 3
173           streams-freed 12 stream-storage 91))
174
175      Here is a table explaining each element:
176
177     USED-CONSES
178           The number of cons cells in use.
179
180     FREE-CONSES
181           The number of cons cells for which space has been obtained
182           from the operating system, but that are not currently being
183           used.
184
185     USED-SYMS
186           The number of symbols in use.
187
188     FREE-SYMS
189           The number of symbols for which space has been obtained from
190           the operating system, but that are not currently being used.
191
192     USED-MARKERS
193           The number of markers in use.
194
195     FREE-MARKERS
196           The number of markers for which space has been obtained from
197           the operating system, but that are not currently being used.
198
199     USED-STRING-CHARS
200           The total size of all strings, in characters.
201
202     USED-VECTOR-SLOTS
203           The total number of elements of existing vectors.
204
205     PLIST
206           A list of alternating keyword/value pairs providing more
207           detailed information. (As you can see above, quite a lot of
208           information is provided.)
209
210  - User Option: gc-cons-threshold
211      The value of this variable is the number of bytes of storage that
212      must be allocated for Lisp objects after one garbage collection in
213      order to trigger another garbage collection.  A cons cell counts
214      as eight bytes, a string as one byte per character plus a few
215      bytes of overhead, and so on; space allocated to the contents of
216      buffers does not count.  Note that the subsequent garbage
217      collection does not happen immediately when the threshold is
218      exhausted, but only the next time the Lisp evaluator is called.
219
220      The initial threshold value is 500,000.  If you specify a larger
221      value, garbage collection will happen less often.  This reduces the
222      amount of time spent garbage collecting, but increases total
223      memory use.  You may want to do this when running a program that
224      creates lots of Lisp data.
225
226      You can make collections more frequent by specifying a smaller
227      value, down to 10,000.  A value less than 10,000 will remain in
228      effect only until the subsequent garbage collection, at which time
229      `garbage-collect' will set the threshold back to 10,000. (This does
230      not apply if XEmacs was configured with `--debug'.  Therefore, be
231      careful when setting `gc-cons-threshold' in that case!)
232
233  - Function: memory-limit
234      This function returns the address of the last byte XEmacs has
235      allocated, divided by 1024.  We divide the value by 1024 to make
236      sure it fits in a Lisp integer.
237
238      You can use this to get a general idea of how your actions affect
239      the memory usage.
240
241  - Variable: pre-gc-hook
242      This is a normal hook to be run just before each garbage
243      collection.  Interrupts, garbage collection, and errors are
244      inhibited while this hook runs, so be extremely careful in what
245      you add here.  In particular, avoid consing, and do not interact
246      with the user.
247
248  - Variable: post-gc-hook
249      This is a normal hook to be run just after each garbage collection.
250      Interrupts, garbage collection, and errors are inhibited while
251      this hook runs, so be extremely careful in what you add here.  In
252      particular, avoid consing, and do not interact with the user.
253
254  - Variable: gc-message
255      This is a string to print to indicate that a garbage collection is
256      in progress.  This is printed in the echo area.  If the selected
257      frame is on a window system and `gc-pointer-glyph' specifies a
258      value (i.e. a pointer image instance) in the domain of the
259      selected frame, the mouse cursor will change instead of this
260      message being printed.
261
262  - Glyph: gc-pointer-glyph
263      This holds the pointer glyph used to indicate that a garbage
264      collection is in progress.  If the selected window is on a window
265      system and this glyph specifies a value (i.e. a pointer image
266      instance) in the domain of the selected window, the cursor will be
267      changed as specified during garbage collection.  Otherwise, a
268      message will be printed in the echo area, as controlled by
269      `gc-message'.  *Note Glyphs::.
270
271    If XEmacs was configured with `--debug', you can set the following
272 two variables to get direct information about all the allocation that
273 is happening in a segment of Lisp code.
274
275  - Variable: debug-allocation
276      If non-zero, print out information to stderr about all objects
277      allocated.
278
279  - Variable: debug-allocation-backtrace
280      Length (in stack frames) of short backtrace printed out by
281      `debug-allocation'.
282
283 \1f
284 File: lispref.info,  Node: Standard Errors,  Next: Standard Buffer-Local Variables,  Prev: Building XEmacs and Object Allocation,  Up: Top
285
286 Standard Errors
287 ***************
288
289    Here is the complete list of the error symbols in standard Emacs,
290 grouped by concept.  The list includes each symbol's message (on the
291 `error-message' property of the symbol) and a cross reference to a
292 description of how the error can occur.
293
294    Each error symbol has an `error-conditions' property that is a list
295 of symbols.  Normally this list includes the error symbol itself and
296 the symbol `error'.  Occasionally it includes additional symbols, which
297 are intermediate classifications, narrower than `error' but broader
298 than a single error symbol.  For example, all the errors in accessing
299 files have the condition `file-error'.
300
301    As a special exception, the error symbol `quit' does not have the
302 condition `error', because quitting is not considered an error.
303
304    *Note Errors::, for an explanation of how errors are generated and
305 handled.
306
307 `SYMBOL'
308      STRING; REFERENCE.
309
310 `error'
311      `"error"'
312      *Note Errors::.
313
314 `quit'
315      `"Quit"'
316      *Note Quitting::.
317
318 `args-out-of-range'
319      `"Args out of range"'
320      *Note Sequences Arrays Vectors::.
321
322 `arith-error'
323      `"Arithmetic error"'
324      See `/' and `%' in *Note Numbers::.
325
326 `beginning-of-buffer'
327      `"Beginning of buffer"'
328      *Note Motion::.
329
330 `buffer-read-only'
331      `"Buffer is read-only"'
332      *Note Read Only Buffers::.
333
334 `cyclic-function-indirection'
335      `"Symbol's chain of function indirections contains a loop"'
336      *Note Function Indirection::.
337
338 `domain-error'
339      `"Arithmetic domain error"'
340 `end-of-buffer'
341      `"End of buffer"'
342      *Note Motion::.
343
344 `end-of-file'
345      `"End of file during parsing"'
346      This is not a `file-error'.
347      *Note Input Functions::.
348
349 `file-error'
350      This error and its subcategories do not have error-strings,
351      because the error message is constructed from the data items alone
352      when the error condition `file-error' is present.
353      *Note Files::.
354
355 `file-locked'
356      This is a `file-error'.
357      *Note File Locks::.
358
359 `file-already-exists'
360      This is a `file-error'.
361      *Note Writing to Files::.
362
363 `file-supersession'
364      This is a `file-error'.
365      *Note Modification Time::.
366
367 `invalid-byte-code'
368      `"Invalid byte code"'
369      *Note Byte Compilation::.
370
371 `invalid-function'
372      `"Invalid function"'
373      *Note Classifying Lists::.
374
375 `invalid-read-syntax'
376      `"Invalid read syntax"'
377      *Note Input Functions::.
378
379 `invalid-regexp'
380      `"Invalid regexp"'
381      *Note Regular Expressions::.
382
383 `mark-inactive'
384      `"The mark is not active now"'
385 `no-catch'
386      `"No catch for tag"'
387      *Note Catch and Throw::.
388
389 `overflow-error'
390      `"Arithmetic overflow error"'
391 `protected-field'
392      `"Attempt to modify a protected field"'
393 `range-error'
394      `"Arithmetic range error"'
395 `search-failed'
396      `"Search failed"'
397      *Note Searching and Matching::.
398
399 `setting-constant'
400      `"Attempt to set a constant symbol"'
401      *Note Variables that Never Change: Constant Variables.
402
403 `singularity-error'
404      `"Arithmetic singularity error"'
405 `tooltalk-error'
406      `"ToolTalk error"'
407      *Note ToolTalk Support::.
408
409 `undefined-keystroke-sequence'
410      `"Undefined keystroke sequence"'
411 `void-function'
412      `"Symbol's function definition is void"'
413      *Note Function Cells::.
414
415 `void-variable'
416      `"Symbol's value as variable is void"'
417      *Note Accessing Variables::.
418
419 `wrong-number-of-arguments'
420      `"Wrong number of arguments"'
421      *Note Classifying Lists::.
422
423 `wrong-type-argument'
424      `"Wrong type argument"'
425      *Note Type Predicates::.
426
427    These error types, which are all classified as special cases of
428 `arith-error', can occur on certain systems for invalid use of
429 mathematical functions.
430
431 `domain-error'
432      `"Arithmetic domain error"'
433      *Note Math Functions::.
434
435 `overflow-error'
436      `"Arithmetic overflow error"'
437      *Note Math Functions::.
438
439 `range-error'
440      `"Arithmetic range error"'
441      *Note Math Functions::.
442
443 `singularity-error'
444      `"Arithmetic singularity error"'
445      *Note Math Functions::.
446
447 `underflow-error'
448      `"Arithmetic underflow error"'
449      *Note Math Functions::.
450
451 \1f
452 File: lispref.info,  Node: Standard Buffer-Local Variables,  Next: Standard Keymaps,  Prev: Standard Errors,  Up: Top
453
454 Buffer-Local Variables
455 **********************
456
457    The table below lists the general-purpose Emacs variables that are
458 automatically local (when set) in each buffer.  Many Lisp packages
459 define such variables for their internal use; we don't list them here.
460
461 `abbrev-mode'
462      *note Abbrevs::
463
464 `auto-fill-function'
465      *note Auto Filling::
466
467 `buffer-auto-save-file-name'
468      *note Auto-Saving::
469
470 `buffer-backed-up'
471      *note Backup Files::
472
473 `buffer-display-table'
474      *note Display Tables::
475
476 `buffer-file-format'
477      *note Format Conversion::
478
479 `buffer-file-name'
480      *note Buffer File Name::
481
482 `buffer-file-number'
483      *note Buffer File Name::
484
485 `buffer-file-truename'
486      *note Buffer File Name::
487
488 `buffer-file-type'
489      *note Files and MS-DOS::
490
491 `buffer-invisibility-spec'
492      *note Invisible Text::
493
494 `buffer-offer-save'
495      *note Saving Buffers::
496
497 `buffer-read-only'
498      *note Read Only Buffers::
499
500 `buffer-saved-size'
501      *note Point::
502
503 `buffer-undo-list'
504      *note Undo::
505
506 `cache-long-line-scans'
507      *note Text Lines::
508
509 `case-fold-search'
510      *note Searching and Case::
511
512 `ctl-arrow'
513      *note Usual Display::
514
515 `comment-column'
516      *note Comments: (emacs)Comments.
517
518 `default-directory'
519      *note System Environment::
520
521 `defun-prompt-regexp'
522      *note List Motion::
523
524 `fill-column'
525      *note Auto Filling::
526
527 `goal-column'
528      *note Moving Point: (emacs)Moving Point.
529
530 `left-margin'
531      *note Indentation::
532
533 `local-abbrev-table'
534      *note Abbrevs::
535
536 `local-write-file-hooks'
537      *note Saving Buffers::
538
539 `major-mode'
540      *note Mode Help::
541
542 `mark-active'
543      *note The Mark::
544
545 `mark-ring'
546      *note The Mark::
547
548 `minor-modes'
549      *note Minor Modes::
550
551 `modeline-format'
552      *note Modeline Data::
553
554 `modeline-buffer-identification'
555      *note Modeline Variables::
556
557 `modeline-format'
558      *note Modeline Data::
559
560 `modeline-modified'
561      *note Modeline Variables::
562
563 `modeline-process'
564      *note Modeline Variables::
565
566 `mode-name'
567      *note Modeline Variables::
568
569 `overwrite-mode'
570      *note Insertion::
571
572 `paragraph-separate'
573      *note Standard Regexps::
574
575 `paragraph-start'
576      *note Standard Regexps::
577
578 `point-before-scroll'
579      Used for communication between mouse commands and scroll-bar
580      commands.
581
582 `require-final-newline'
583      *note Insertion::
584
585 `selective-display'
586      *note Selective Display::
587
588 `selective-display-ellipses'
589      *note Selective Display::
590
591 `tab-width'
592      *note Usual Display::
593
594 `truncate-lines'
595      *note Truncation::
596
597 `vc-mode'
598      *note Modeline Variables::
599
600 \1f
601 File: lispref.info,  Node: Standard Keymaps,  Next: Standard Hooks,  Prev: Standard Buffer-Local Variables,  Up: Top
602
603 Standard Keymaps
604 ****************
605
606    The following symbols are used as the names for various keymaps.
607 Some of these exist when XEmacs is first started, others are loaded
608 only when their respective mode is used.  This is not an exhaustive
609 list.
610
611    Almost all of these maps are used as local maps.  Indeed, of the
612 modes that presently exist, only Vip mode and Terminal mode ever change
613 the global keymap.
614
615 `bookmark-map'
616      A keymap containing bindings to bookmark functions.
617
618 `Buffer-menu-mode-map'
619      A keymap used by Buffer Menu mode.
620
621 `c++-mode-map'
622      A keymap used by C++ mode.
623
624 `c-mode-map'
625      A keymap used by C mode.  A sparse keymap used by C mode.
626
627 `command-history-map'
628      A keymap used by Command History mode.
629
630 `ctl-x-4-map'
631      A keymap for subcommands of the prefix `C-x 4'.
632
633 `ctl-x-5-map'
634      A keymap for subcommands of the prefix `C-x 5'.
635
636 `ctl-x-map'
637      A keymap for `C-x' commands.
638
639 `debugger-mode-map'
640      A keymap used by Debugger mode.
641
642 `dired-mode-map'
643      A keymap for `dired-mode' buffers.
644
645 `edit-abbrevs-map'
646      A keymap used in `edit-abbrevs'.
647
648 `edit-tab-stops-map'
649      A keymap used in `edit-tab-stops'.
650
651 `electric-buffer-menu-mode-map'
652      A keymap used by Electric Buffer Menu mode.
653
654 `electric-history-map'
655      A keymap used by Electric Command History mode.
656
657 `emacs-lisp-mode-map'
658      A keymap used by Emacs Lisp mode.
659
660 `help-map'
661      A keymap for characters following the Help key.
662
663 `Helper-help-map'
664      A keymap used by the help utility package.
665      It has the same keymap in its value cell and in its function cell.
666
667 `Info-edit-map'
668      A keymap used by the `e' command of Info.
669
670 `Info-mode-map'
671      A keymap containing Info commands.
672
673 `isearch-mode-map'
674      A keymap that defines the characters you can type within
675      incremental search.
676
677 `itimer-edit-map'
678      A keymap used when in Itimer Edit mode.
679
680 `lisp-interaction-mode-map'
681      A keymap used by Lisp mode.
682
683 `lisp-mode-map'
684      A keymap used by Lisp mode.
685
686      A keymap for minibuffer input with completion.
687
688 `minibuffer-local-isearch-map'
689      A keymap for editing isearch strings in the minibuffer.
690
691 `minibuffer-local-map'
692      Default keymap to use when reading from the minibuffer.
693
694 `minibuffer-local-must-match-map'
695      A keymap for minibuffer input with completion, for exact match.
696
697 `mode-specific-map'
698      The keymap for characters following `C-c'.  Note, this is in the
699      global map.  This map is not actually mode specific: its name was
700      chosen to be informative for the user in `C-h b'
701      (`display-bindings'), where it describes the main use of the `C-c'
702      prefix key.
703
704 `modeline-map'
705      The keymap consulted for mouse-clicks on the modeline of a window.
706
707 `objc-mode-map'
708      A keymap used in Objective C mode as a local map.
709
710 `occur-mode-map'
711      A local keymap used by Occur mode.
712
713 `overriding-local-map'
714      A keymap that overrides all other local keymaps.
715
716 `query-replace-map'
717      A local keymap used for responses in `query-replace' and related
718      commands; also for `y-or-n-p' and `map-y-or-n-p'.  The functions
719      that use this map do not support prefix keys; they look up one
720      event at a time.
721
722 `read-expression-map'
723      The minibuffer keymap used for reading Lisp expressions.
724
725 `read-shell-command-map'
726      The minibuffer keymap used by shell-command and related commands.
727
728 `shared-lisp-mode-map'
729      A keymap for commands shared by all sorts of Lisp modes.
730
731 `text-mode-map'
732      A keymap used by Text mode.
733
734 `toolbar-map'
735      The keymap consulted for mouse-clicks over a toolbar.
736
737 `view-mode-map'
738      A keymap used by View mode.
739
740 \1f
741 File: lispref.info,  Node: Standard Hooks,  Next: Index,  Prev: Standard Keymaps,  Up: Top
742
743 Standard Hooks
744 **************
745
746    The following is a list of hook variables that let you provide
747 functions to be called from within Emacs on suitable occasions.
748
749    Most of these variables have names ending with `-hook'.  They are
750 "normal hooks", run by means of `run-hooks'.  The value of such a hook
751 is a list of functions.  The recommended way to put a new function on
752 such a hook is to call `add-hook'.  *Note Hooks::, for more information
753 about using hooks.
754
755    The variables whose names end in `-function' have single functions
756 as their values.  Usually there is a specific reason why the variable is
757 not a normal hook, such as the need to pass arguments to the function.
758 (In older Emacs versions, some of these variables had names ending in
759 `-hook' even though they were not normal hooks.)
760
761    The variables whose names end in `-hooks' or `-functions' have lists
762 of functions as their values, but these functions are called in a
763 special way (they are passed arguments, or else their values are used).
764
765 `activate-menubar-hook'
766
767 `activate-popup-menu-hook'
768
769 `ad-definition-hooks'
770
771 `adaptive-fill-function'
772
773 `add-log-current-defun-function'
774
775 `after-change-functions'
776
777 `after-delete-annotation-hook'
778
779 `after-init-hook'
780
781 `after-insert-file-functions'
782
783 `after-revert-hook'
784
785 `after-save-hook'
786
787 `after-set-visited-file-name-hooks'
788
789 `after-write-file-hooks'
790
791 `auto-fill-function'
792
793 `auto-save-hook'
794
795 `before-change-functions'
796
797 `before-delete-annotation-hook'
798
799 `before-init-hook'
800
801 `before-revert-hook'
802
803 `blink-paren-function'
804
805 `buffers-menu-switch-to-buffer-function'
806
807 `c++-mode-hook'
808
809 `c-delete-function'
810
811 `c-mode-common-hook'
812
813 `c-mode-hook'
814
815 `c-special-indent-hook'
816
817 `calendar-load-hook'
818
819 `change-major-mode-hook'
820
821 `command-history-hook'
822
823 `comment-indent-function'
824
825 `compilation-buffer-name-function'
826
827 `compilation-exit-message-function'
828
829 `compilation-finish-function'
830
831 `compilation-parse-errors-function'
832
833 `compilation-mode-hook'
834
835 `create-console-hook'
836
837 `create-device-hook'
838
839 `create-frame-hook'
840
841 `dabbrev-friend-buffer-function'
842
843 `dabbrev-select-buffers-function'
844
845 `delete-console-hook'
846
847 `delete-device-hook'
848
849 `delete-frame-hook'
850
851 `deselect-frame-hook'
852
853 `diary-display-hook'
854
855 `diary-hook'
856
857 `dired-after-readin-hook'
858
859 `dired-before-readin-hook'
860
861 `dired-load-hook'
862
863 `dired-mode-hook'
864
865 `disabled-command-hook'
866
867 `display-buffer-function'
868
869 `ediff-after-setup-control-frame-hook'
870
871 `ediff-after-setup-windows-hook'
872
873 `ediff-before-setup-control-frame-hook'
874
875 `ediff-before-setup-windows-hook'
876
877 `ediff-brief-help-message-function'
878
879 `ediff-cleanup-hook'
880
881 `ediff-control-frame-position-function'
882
883 `ediff-display-help-hook'
884
885 `ediff-focus-on-regexp-matches-function'
886
887 `ediff-forward-word-function'
888
889 `ediff-hide-regexp-matches-function'
890
891 `ediff-keymap-setup-hook'
892
893 `ediff-load-hook'
894
895 `ediff-long-help-message-function'
896
897 `ediff-make-wide-display-function'
898
899 `ediff-merge-split-window-function'
900
901 `ediff-meta-action-function'
902
903 `ediff-meta-redraw-function'
904
905 `ediff-mode-hook'
906
907 `ediff-prepare-buffer-hook'
908
909 `ediff-quit-hook'
910
911 `ediff-registry-setup-hook'
912
913 `ediff-select-hook'
914
915 `ediff-session-action-function'
916
917 `ediff-session-group-setup-hook'
918
919 `ediff-setup-diff-regions-function'
920
921 `ediff-show-registry-hook'
922
923 `ediff-show-session-group-hook'
924
925 `ediff-skip-diff-region-function'
926
927 `ediff-split-window-function'
928
929 `ediff-startup-hook'
930
931 `ediff-suspend-hook'
932
933 `ediff-toggle-read-only-function'
934
935 `ediff-unselect-hook'
936
937 `ediff-window-setup-function'
938
939 `edit-picture-hook'
940
941 `electric-buffer-menu-mode-hook'
942
943 `electric-command-history-hook'
944
945 `electric-help-mode-hook'
946
947 `emacs-lisp-mode-hook'
948
949 `fill-paragraph-function'
950
951 `find-file-hooks'
952
953 `find-file-not-found-hooks'
954
955 `first-change-hook'
956
957 `font-lock-after-fontify-buffer-hook'
958
959 `font-lock-beginning-of-syntax-function'
960
961 `font-lock-mode-hook'
962
963 `fume-found-function-hook'
964
965 `fume-list-mode-hook'
966
967 `fume-rescan-buffer-hook'
968
969 `fume-sort-function'
970
971 `gnus-startup-hook'
972
973 `hack-local-variables-hook'
974
975 `highlight-headers-follow-url-function'
976
977 `hyper-apropos-mode-hook'
978
979 `indent-line-function'
980
981 `indent-mim-hook'
982
983 `indent-region-function'
984
985 `initial-calendar-window-hook'
986
987 `isearch-mode-end-hook'
988
989 `isearch-mode-hook'
990
991 `java-mode-hook'
992
993 `kill-buffer-hook'
994
995 `kill-buffer-query-functions'
996
997 `kill-emacs-hook'
998
999 `kill-emacs-query-functions'
1000
1001 `kill-hooks'
1002
1003 `LaTeX-mode-hook'
1004
1005 `latex-mode-hook'
1006
1007 `ledit-mode-hook'
1008
1009 `lisp-indent-function'
1010
1011 `lisp-interaction-mode-hook'
1012
1013 `lisp-mode-hook'
1014
1015 `list-diary-entries-hook'
1016
1017 `load-read-function'
1018
1019 `log-message-filter-function'
1020
1021 `m2-mode-hook'
1022
1023 `mail-citation-hook'
1024
1025 `mail-mode-hook'
1026
1027 `mail-setup-hook'
1028
1029 `make-annotation-hook'
1030
1031 `makefile-mode-hook'
1032
1033 `map-frame-hook'
1034
1035 `mark-diary-entries-hook'
1036
1037 `medit-mode-hook'
1038
1039 `menu-no-selection-hook'
1040
1041 `mh-compose-letter-hook'
1042
1043 `mh-folder-mode-hook'
1044
1045 `mh-letter-mode-hook'
1046
1047 `mim-mode-hook'
1048
1049 `minibuffer-exit-hook'
1050
1051 `minibuffer-setup-hook'
1052
1053 `mode-motion-hook'
1054
1055 `mouse-enter-frame-hook'
1056
1057 `mouse-leave-frame-hook'
1058
1059 `mouse-track-cleanup-hook'
1060
1061 `mouse-track-click-hook'
1062
1063 `mouse-track-down-hook'
1064
1065 `mouse-track-drag-hook'
1066
1067 `mouse-track-drag-up-hook'
1068
1069 `mouse-track-up-hook'
1070
1071 `mouse-yank-function'
1072
1073 `news-mode-hook'
1074
1075 `news-reply-mode-hook'
1076
1077 `news-setup-hook'
1078
1079 `nongregorian-diary-listing-hook'
1080
1081 `nongregorian-diary-marking-hook'
1082
1083 `nroff-mode-hook'
1084
1085 `objc-mode-hook'
1086
1087 `outline-mode-hook'
1088
1089 `perl-mode-hook'
1090
1091 `plain-TeX-mode-hook'
1092
1093 `post-command-hook'
1094
1095 `post-gc-hook'
1096
1097 `pre-abbrev-expand-hook'
1098
1099 `pre-command-hook'
1100
1101 `pre-display-buffer-function'
1102
1103 `pre-gc-hook'
1104
1105 `pre-idle-hook'
1106
1107 `print-diary-entries-hook'
1108
1109 `prolog-mode-hook'
1110
1111 `protect-innocence-hook'
1112
1113 `remove-message-hook'
1114
1115 `revert-buffer-function'
1116
1117 `revert-buffer-insert-contents-function'
1118
1119 `rmail-edit-mode-hook'
1120
1121 `rmail-mode-hook'
1122
1123 `rmail-retry-setup-hook'
1124
1125 `rmail-summary-mode-hook'
1126
1127 `scheme-indent-hook'
1128
1129 `scheme-mode-hook'
1130
1131 `scribe-mode-hook'
1132
1133 `select-frame-hook'
1134
1135 `send-mail-function'
1136
1137 `shell-mode-hook'
1138
1139 `shell-set-directory-error-hook'
1140
1141 `special-display-function'
1142
1143 `suspend-hook'
1144
1145 `suspend-resume-hook'
1146
1147 `temp-buffer-show-function'
1148
1149 `term-setup-hook'
1150
1151 `terminal-mode-hook'
1152
1153 `terminal-mode-break-hook'
1154
1155 `TeX-mode-hook'
1156
1157 `tex-mode-hook'
1158
1159 `text-mode-hook'
1160
1161 `today-visible-calendar-hook'
1162
1163 `today-invisible-calendar-hook'
1164
1165 `tooltalk-message-handler-hook'
1166
1167 `tooltalk-pattern-handler-hook'
1168
1169 `tooltalk-unprocessed-message-hook'
1170
1171 `unmap-frame-hook'
1172
1173 `vc-checkin-hook'
1174
1175 `vc-checkout-writable-buffer-hook'
1176
1177 `vc-log-after-operation-hook'
1178
1179 `vc-make-buffer-writable-hook'
1180
1181 `view-hook'
1182
1183 `vm-arrived-message-hook'
1184
1185 `vm-arrived-messages-hook'
1186
1187 `vm-chop-full-name-function'
1188
1189 `vm-display-buffer-hook'
1190
1191 `vm-edit-message-hook'
1192
1193 `vm-forward-message-hook'
1194
1195 `vm-iconify-frame-hook'
1196
1197 `vm-inhibit-write-file-hook'
1198
1199 `vm-key-functions'
1200
1201 `vm-mail-hook'
1202
1203 `vm-mail-mode-hook'
1204
1205 `vm-menu-setup-hook'
1206
1207 `vm-mode-hook'
1208
1209 `vm-quit-hook'
1210
1211 `vm-rename-current-buffer-function'
1212
1213 `vm-reply-hook'
1214
1215 `vm-resend-bounced-message-hook'
1216
1217 `vm-resend-message-hook'
1218
1219 `vm-retrieved-spooled-mail-hook'
1220
1221 `vm-select-message-hook'
1222
1223 `vm-select-new-message-hook'
1224
1225 `vm-select-unread-message-hook'
1226
1227 `vm-send-digest-hook'
1228
1229 `vm-summary-mode-hook'
1230
1231 `vm-summary-pointer-update-hook'
1232
1233 `vm-summary-redo-hook'
1234
1235 `vm-summary-update-hook'
1236
1237 `vm-undisplay-buffer-hook'
1238
1239 `vm-visit-folder-hook'
1240
1241 `window-setup-hook'
1242
1243 `write-contents-hooks'
1244
1245 `write-file-data-hooks'
1246
1247 `write-file-hooks'
1248
1249 `write-region-annotate-functions'
1250
1251 `x-lost-selection-hooks'
1252
1253 `x-sent-selection-hooks'
1254
1255 `zmacs-activate-region-hook'
1256
1257 `zmacs-deactivate-region-hook'
1258
1259 `zmacs-update-region-hook'