home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / info / elisp.i23 (.txt) < prev    next >
GNU Info File  |  1993-06-14  |  32KB  |  694 lines

  1. This is Info file elisp, produced by Makeinfo-1.47 from the input file
  2. elisp.texi.
  3.    This file documents GNU Emacs Lisp.
  4.    This is edition 1.03 of the GNU Emacs Lisp Reference Manual, for
  5. Emacs Version 18.
  6.    Published by the Free Software Foundation, 675 Massachusetts Avenue,
  7. Cambridge, MA 02139 USA
  8.    Copyright (C) 1990 Free Software Foundation, Inc.
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided that
  14. the entire resulting derived work is distributed under the terms of a
  15. permission notice identical to this one.
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that this permission notice may be stated in a
  19. translation approved by the Foundation.
  20. File: elisp,  Node: Garbage Collection,  Next: Writing Emacs Primitives,  Prev: Pure Storage,  Up: GNU Emacs Internals
  21. Garbage Collection
  22. ==================
  23.    When a program creates a list or the user defines a new function
  24. (such as by loading a library), then that data is placed in normal
  25. storage. If normal storage runs low, then Emacs asks the operating
  26. system to allocate more memory in blocks of 1k bytes.  Each block is
  27. used for one type of Lisp object, so symbols, cons cells, markers, etc.
  28. are segregated in distinct blocks in memory.  (Vectors, buffers and
  29. certain other editing types, which are fairly large, are allocated in
  30. individual blocks, one per object, while strings are packed into blocks
  31. of 8k bytes.)
  32.    It is quite common to use some storage for a while, then release it
  33. by, for example, killing a buffer or deleting the last pointer to an
  34. object.  Emacs provides a "garbage collector" to reclaim this abandoned
  35. storage.  (This name is traditional, but "garbage recycler" might be a
  36. more intuitive metaphor for this facility.)
  37.    The garbage collector operates by scanning all the objects that have
  38. been allocated and marking those that are still accessible to Lisp
  39. programs.  To begin with, all the symbols, their values and associated
  40. function definitions, and any data presently on the stack, are
  41. accessible.  Any objects which can be reached indirectly through other
  42. accessible objects are also accessible.
  43.    When this is finished, all inaccessible objects are garbage.  No
  44. matter what the Lisp program or the user does, it is impossible to refer
  45. to them, since there is no longer a way to reach them.  Their space
  46. might as well be reused, since no one will notice.  That is what the
  47. garbage collector arranges to do.
  48.    Unused cons cells are chained together onto a "free list" for future
  49. allocation; likewise for symbols and markers.  The accessible strings
  50. are compacted so they are contiguous in memory; then the rest of the
  51. space formerly occupied by strings is made available to the string
  52. creation functions.  Vectors, buffers, windows and other large objects
  53. are individually allocated and freed using `malloc'.
  54.      Common Lisp note: unlike other Lisps, GNU Emacs Lisp does not call
  55.      the garbage collector when the free list is empty.  Instead, it
  56.      simply requests the operating system to allocate more storage, and
  57.      processing continues until `gc-cons-threshold' bytes have been
  58.      used.
  59.      This means that you can make sure that the garbage collector will
  60.      not run during a certain portion of a Lisp program by calling the
  61.      garbage collector explicitly just before it (provided that portion
  62.      of the program does not use so much space as to force a second
  63.      garbage collection).
  64.  -- Command: garbage-collect
  65.      This command runs a garbage collection, and returns information on
  66.      the amount of space in use.  (Garbage collection can also occur
  67.      spontaneously if you use more than `gc-cons-threshold' bytes of
  68.      Lisp data since the previous garbage collection.)
  69.      `garbage-collect' returns a list containing the following
  70.      information:
  71.           ((USED-CONSES . FREE-CONSES)
  72.            (USED-SYMS . FREE-SYMS)
  73.            (USED-MARKERS . FREE-MARKERS)
  74.            USED-STRING-CHARS
  75.            USED-VECTOR-SLOTS)
  76.           
  77.           (garbage-collect)
  78.                => ((3435 . 2332) (1688 . 0) (57 . 417) 24510 3839)
  79.      Here is a table explaining each element:
  80.     USED-CONSES
  81.           The number of cons cells in use.
  82.     FREE-CONSES
  83.           The number of cons cells for which space has been obtained
  84.           from the operating system, but that are not currently being
  85.           used.
  86.     USED-SYMS
  87.           The number of symbols in use.
  88.     FREE-SYMS
  89.           The number of symbols for which space has been obtained from
  90.           the operating system, but that are not currently being used.
  91.     USED-MARKERS
  92.           The number of markers in use.
  93.     FREE-MARKERS
  94.           The number of markers for which space has been obtained from
  95.           the operating system, but that are not currently being used.
  96.     USED-STRING-CHARS
  97.           The total size of all strings, in characters.
  98.     USED-VECTOR-SLOTS
  99.           The total number of elements of existing vectors.
  100.  -- User Option: gc-cons-threshold
  101.      The value of this variable is the number of bytes of storage that
  102.      must be allocated for Lisp objects after one garbage collection in
  103.      order to request another garbage collection.  A cons cell counts
  104.      as eight bytes, a string as one byte per character plus a few
  105.      bytes of overhead, and so on.  (Space allocated to the contents of
  106.      buffers does not count.)  Note that the new garbage collection
  107.      does not happen immediately when the threshold is exhausted, but
  108.      only the next time the Lisp evaluator is called.
  109.      The initial threshold value is 100,000.  If you specify a larger
  110.      value, garbage collection will happen less often.  This reduces the
  111.      amount of time spent garbage collecting, but increases total
  112.      memory use. You may want to do this when running a program which
  113.      creates lots of Lisp data.
  114.      You can make collections more frequent by specifying a smaller
  115.      value, down to 10,000.  A value less than 10,000 will remain in
  116.      effect only until the subsequent garbage collection, at which time
  117.      `garbage-collect' will set the threshold back to 100,000.
  118. File: elisp,  Node: Writing Emacs Primitives,  Next: Object Internals,  Prev: Garbage Collection,  Up: GNU Emacs Internals
  119. Writing Emacs Primitives
  120. ========================
  121.    Lisp primitives are Lisp functions implemented in C.  The details of
  122. interfacing the C function so that Lisp can call it are handled by a few
  123. C macros.  The only way to really understand how to write new C code is
  124. to read the source, but we can explain some things here.
  125.    An example of a special form is the definition of `or', from
  126. `eval.c'.  (An ordinary function would have the same general
  127. appearance.)
  128.      DEFUN ("or", For, Sor, 0, UNEVALLED, 0,
  129.        "Eval args until one of them yields non-NIL, then return that value.\n\
  130.      The remaining args are not evalled at all.\n\
  131.      If all args return NIL, return NIL.")
  132.        (args)
  133.           Lisp_Object args;
  134.      {
  135.        register Lisp_Object val;
  136.        Lisp_Object args_left;
  137.        struct gcpro gcpro1;
  138.      
  139.        if (NULL(args))
  140.          return Qnil;
  141.      
  142.        args_left = args;
  143.        GCPRO1 (args_left);
  144.      
  145.        do
  146.          {
  147.            val = Feval (Fcar (args_left));
  148.            if (!NULL (val))
  149.              break;
  150.            args_left = Fcdr (args_left);
  151.          }
  152.        while (!NULL(args_left));
  153.      
  154.        UNGCPRO;
  155.        return val;
  156.      }
  157.    Let's start with a precise explanation of the arguments to the
  158. `DEFUN' macro:
  159.   1. The first argument is the name of the Lisp symbol to define with
  160.      this function; it is `or'.
  161.   2. The second argument is the C function name for this function. 
  162.      This is the name that is used in C code for calling the function. 
  163.      The name is, by convention, `F' prepended to the Lisp name, with
  164.      all dashes (`-') in the Lisp name changed to underscores.  Thus,
  165.      to call this function from C code, call `For'.  Remember that the
  166.      arguments must be of type `Lisp_Object'; various macros and
  167.      functions for creating values of type `Lisp_Object' are declared
  168.      in the file `lisp.h'.
  169.   3. The third argument is a C variable name to use for a structure that
  170.      holds the data for the subr object that represents the function in
  171.      Lisp. This structure conveys the Lisp symbol name to the
  172.      initialization routine that will create the symbol and store the
  173.      subr object as its definition.  By convention, this name is the C
  174.      function name with `F' replaced with `S'.
  175.   4. The fourth argument is the minimum number of arguments that the
  176.      function requires.  In this case, no arguments are required.
  177.   5. The fifth argument is the maximum number of arguments that the
  178.      function accepts.  Alternatively, it can be `UNEVALLED',
  179.      indicating a special form that receives unevaluated arguments.  A
  180.      function with the equivalent of an `&rest' argument would have
  181.      `MANY' in this position.  Both `UNEVALLED' and `MANY' are macros. 
  182.      This argument must be one of these macros or a number at least as
  183.      large as the fourth argument.
  184.   6. The sixth argument is an interactive specification, a string such
  185.      as might be used as the argument of `interactive' in a Lisp
  186.      function. In this case it is 0 (a null pointer), indicating that
  187.      this function cannot be called interactively.  A value of `""'
  188.      indicates an interactive function not taking arguments.
  189.   7. The last argument is the documentation string.  It is written just
  190.      like a documentation string for a function defined in Lisp, except
  191.      you must write `\n\' at the end of each line.  In particular, the
  192.      first line should be a single sentence.
  193.    After the call to the `DEFUN' macro, you must write the list of
  194. argument names that every C function must have, followed by ordinary C
  195. declarations for them.  Normally, all the arguments must be declared as
  196. `Lisp_Object'.  If the function has no upper limit on the number of
  197. arguments in Lisp, then in C it receives two arguments: the number of
  198. Lisp arguments, and the address of a block containing their values. 
  199. These have types `int' and `Lisp_Object *'.
  200.    Within the function `For' itself, note the use of the macros
  201. `GCPRO1' and `UNGCPRO'.  `GCPRO1' is used to "protect" a variable from
  202. garbage collection--to inform the garbage collector that it must look
  203. in that variable and regard its contents as an accessible object.  This
  204. is necessary whenever you call `Feval' or anything that can directly or
  205. indirectly call `Feval'.  At such a time, any Lisp object that you
  206. intend to refer to again must be protected somehow. `UNGCPRO' cancels
  207. the protection of the variables that are protected in the current
  208. function.  It is necessary to do this explicitly.
  209.    For most data types, it suffices to know that one pointer to the
  210. object is protected; as long as the object is not recycled, all pointers
  211. to it remain valid.  This is not so for strings, because the garbage
  212. collector can move them.  When a string is moved, any pointers to it
  213. that the garbage collector does not know about will not be properly
  214. relocated.  Therefore, all pointers to strings must be protected across
  215. any point where garbage collection may be possible.
  216.    The macro `GCPRO1' protects just one local variable.  If you want to
  217. protect two, use `GCPRO2' instead; repeating `GCPRO1' will not work. 
  218. There are also `GCPRO3' and `GCPRO4'.
  219.    In addition to using these macros, you must declare the local
  220. variables such as `gcpro1' which they implicitly use.  If you protect
  221. two variables, with `GCPRO2', you must declare `gcpro1' and `gcpro2',
  222. as it uses them both.  Alas, we can't explain all the tricky details
  223. here.
  224.    Defining the C function is not enough; you must also create the Lisp
  225. symbol for the primitive and store a suitable subr object in its
  226. function cell.  This is done by adding code to an initialization
  227. routine.  The code looks like this:
  228.      defsubr (&SUBR-STRUCTURE-NAME);
  229. SUBR-STRUCTURE-NAME is the name you used as the third argument to
  230. `DEFUN'.
  231.    If you are adding a primitive to a file that already has Lisp
  232. primitives defined in it, find the function (near the end of the file)
  233. named `syms_of_SOMETHING', and add that function call to it. If the
  234. file doesn't have this function, or if you create a new file, add to it
  235. a `syms_of_FILENAME' (e.g., `syms_of_myfile'). Then find the spot in
  236. `emacs.c' where all of these functions are called, and add a call to
  237. `syms_of_FILENAME' there.
  238.    This function `syms_of_FILENAME' is also the place to define any C
  239. variables which are to be visible as Lisp variables. `DEFVAR_LISP' is
  240. used to make a C variable of type `Lisp_Object' visible in Lisp. 
  241. `DEFVAR_INT' is used to make a C variable of type `int' visible in Lisp
  242. with a value that is an integer.
  243.    Here is another function, with more complicated arguments.  This
  244. comes from the code for the X Window System, and it demonstrates the
  245. use of macros and functions to manipulate Lisp objects.
  246.      DEFUN ("coordinates-in-window-p", Fcoordinates_in_window_p,
  247.        Scoordinates_in_window_p, 2, 2,
  248.        "xSpecify coordinate pair: \nXExpression which evals to window: ",
  249.        "Return non-nil if POSITIONS (a list, (SCREEN-X SCREEN-Y)) is in WINDOW.\n\
  250.        Returned value is list of positions expressed\n\
  251.        relative to window upper left corner.")
  252.        (coordinate, window)
  253.           register Lisp_Object coordinate, window;
  254.      {
  255.        register Lisp_Object xcoord, ycoord;
  256.      
  257.        if (!CONSP (coordinate)) wrong_type_argument (Qlistp, coordinate);
  258.        CHECK_WINDOW (window, 2);
  259.        xcoord = Fcar (coordinate);
  260.        ycoord = Fcar (Fcdr (coordinate));
  261.        CHECK_NUMBER (xcoord, 0);
  262.        CHECK_NUMBER (ycoord, 1);
  263.        if ((XINT (xcoord) < XINT (XWINDOW (window)->left))
  264.            || (XINT (xcoord) >= (XINT (XWINDOW (window)->left)
  265.                                  + XINT (XWINDOW (window)->width))))
  266.          {
  267.            return Qnil;
  268.          }
  269.        XFASTINT (xcoord) -= XFASTINT (XWINDOW (window)->left);
  270.        if (XINT (ycoord) == (screen_height - 1))
  271.          return Qnil;
  272.        if ((XINT (ycoord) < XINT (XWINDOW (window)->top))
  273.            || (XINT (ycoord) >= (XINT (XWINDOW (window)->top)
  274.                                  + XINT (XWINDOW (window)->height)) - 1))
  275.          {
  276.            return Qnil;
  277.          }
  278.        XFASTINT (ycoord) -= XFASTINT (XWINDOW (window)->top);
  279.        return (Fcons (xcoord, Fcons (ycoord, Qnil)));
  280.      }
  281.    Note that you cannot directly call functions defined in Lisp as, for
  282. example, the primitive function `Fcons' is called above.  You must
  283. create the appropriate Lisp form, protect everything from garbage
  284. collection, and `Feval' the form, as was done in `For' above.
  285.    `eval.c' is a very good file to look through for examples; `lisp.h'
  286. contains the definitions for some important macros and functions.
  287. File: elisp,  Node: Object Internals,  Prev: Writing Emacs Primitives,  Up: GNU Emacs Internals
  288. Object Internals
  289. ================
  290.    GNU Emacs Lisp manipulates many different types of data.  The actual
  291. data are stored in a heap and the only access that programs have to it
  292. is through pointers.  Pointers are thirty-two bits wide in most
  293. implementations.  Depending on the operating system and type of machine
  294. for which you compile Emacs, twenty-four to twenty-six bits are used to
  295. address the object, and the remaining six to eight bits are used for a
  296. tag that identifies the object's type.
  297.    Because all access to data is through tagged pointers, it is always
  298. possible to determine the type of any object.  This allows variables to
  299. be untyped, and the values assigned to them to be changed without regard
  300. to type.  Function arguments also can be of any type; if you want a
  301. function to accept only a certain type of argument, you must check the
  302. type explicitly using a suitable predicate (*note Type Predicates::.).
  303. * Menu:
  304. * Buffer Internals::    Components of a buffer structure.
  305. * Window Internals::    Components of a window structure.
  306. * Process Internals::   Components of a process structure.
  307. File: elisp,  Node: Buffer Internals,  Next: Window Internals,  Prev: Object Internals,  Up: Object Internals
  308. Buffer Internals
  309. ----------------
  310.    Buffers contain fields not directly accessible by the Lisp
  311. programmer. We describe them here, naming them by the names used in the
  312. C code. Many are accessible indirectly in Lisp programs via Lisp
  313. primitives.
  314. `name'
  315.      The buffer name is a string which names the buffer.  It is
  316.      guaranteed to be unique.  *Note Buffer Names::.
  317. `save_modified'
  318.      This field contains the time when the buffer was last saved, as an
  319.      integer. *Note Buffer Modification::.
  320. `modtime'
  321.      This field contains the modification time of the visited file.  It
  322.      is set when the file is written or read.  Every time the buffer is
  323.      written to the file, this field is compared to the modification
  324.      time of the file.  *Note Buffer Modification::.
  325. `auto_save_modified'
  326.      This field contains the time when the buffer was last auto-saved.
  327. `last_window_start'
  328.      This field contains the `window-start' position in the buffer as of
  329.      the last time the buffer was displayed in a window.
  330. `undodata'
  331.      This field points to the buffer's undo stack.  *Note Undo::.
  332. `syntax_table_v'
  333.      This field contains the syntax table for the buffer.  *Note Syntax
  334.      Tables::.
  335. `markers'
  336.      This field contains the chain of all markers that point into the
  337.      buffer.  At each deletion or motion of the buffer gap, all of these
  338.      markers must be checked and perhaps updated.  *Note Markers::.
  339. `backed_up'
  340.      This field is a flag which tells whether a backup file has been
  341.      made for the visited file of this buffer.
  342. `mark'
  343.      This field contains the mark for the buffer.  The mark is a marker,
  344.      hence it is also included on the list `markers'.  *Note The Mark::.
  345. `local_var_alist'
  346.      This field contains the association list containing all of the
  347.      variables local in this buffer, and their values.  A copy of this
  348.      list is returned by the function `buffer-local-variables'.  *Note
  349.      Buffer-Local Variables::.
  350. `mode_line_format'
  351.      This field contains a Lisp object which controls how to display
  352.      the mode line for this buffer.  *Note Mode Line Format::.
  353. File: elisp,  Node: Window Internals,  Next: Process Internals,  Prev: Buffer Internals,  Up: Object Internals
  354. Window Internals
  355. ----------------
  356.    Windows have the following accessible fields:
  357. `height'
  358.      The height of the window, measured in lines.
  359. `width'
  360.      The width of the window, measured in columns.
  361. `buffer'
  362.      The buffer which the window is displaying.  This may change often
  363.      during the life of the window.
  364. `start'
  365.      The position in the buffer which is the first character to be
  366.      displayed in the window.
  367. `pointm'
  368.      This is the value of point in the current buffer when this window
  369.      is selected; when it is not selected, it retains its previous
  370.      value.
  371. `left'
  372.      This is the left-hand edge of the window, measured in columns. 
  373.      (The leftmost column on the screen is column 0.)
  374. `top'
  375.      This is the top edge of the window, measured in lines.  (The top
  376.      line on the screen is line 0.)
  377. `next'
  378.      This is the window that is the next in the chain of siblings.
  379. `prev'
  380.      This is the window that is the previous in the chain of siblings.
  381. `force_start'
  382.      This is a flag which, if non-`nil', says that the window has been
  383.      scrolled explicitly by the Lisp program.  At the next redisplay, if
  384.      point is off the screen, instead of scrolling the window to show
  385.      the text around point, point will be moved to a location that is
  386.      on the screen.
  387. `hscroll'
  388.      This is the number of columns that the display in the window is
  389.      scrolled horizontally to the left.  Normally, this is 0.
  390. `use_time'
  391.      This is the last time that the window was selected.  This field is
  392.      used by `get-lru-window'.
  393. File: elisp,  Node: Process Internals,  Prev: Window Internals,  Up: Object Internals
  394. Process Internals
  395. -----------------
  396.    The fields of a process are:
  397. `name'
  398.      A string, the name of the process.
  399. `command'
  400.      A list containing the command arguments that were used to start
  401.      this process.
  402. `filter'
  403.      A function used to accept output from the process instead of a
  404.      buffer, or `nil'.
  405. `sentinel'
  406.      A function called whenever the process receives a signal, or `nil'.
  407. `buffer'
  408.      The associated buffer of the process.
  409. `pid'
  410.      An integer, the Unix process ID.
  411. `childp'
  412.      A flag, non-`nil' if this is really a child process. It is `nil'
  413.      for a network connection.
  414. `flags'
  415.      A symbol indicating the state of the process.  Possible values
  416.      include `run', `stop', `closed', etc.
  417. `reason'
  418.      An integer, the Unix signal number that the process received that
  419.      caused the process to terminate or stop.  If the process has
  420.      exited, then this is the exit code it specified.
  421. `mark'
  422.      A marker indicating the position of end of last output from this
  423.      process inserted into the buffer.  This is usually the end of the
  424.      buffer.
  425. `kill_without_query'
  426.      A flag, non-`nil' meaning this process should not cause
  427.      confirmation to be needed if Emacs is killed.
  428. File: elisp,  Node: Standard Errors,  Next: Standard Buffer-Local Variables,  Prev: GNU Emacs Internals,  Up: Top
  429. Standard Errors
  430. ***************
  431.    Here is the complete list of the error symbols in standard Emacs,
  432. grouped by concept.  The list includes each symbol's message (on the
  433. `error-message' property of the symbol), and a cross reference to a
  434. description of how the error can occur.
  435.    Each error symbol has an `error-conditions' property which is a list
  436. of symbols.  Normally, this list includes the error symbol itself, and
  437. the symbol `error'.  Occasionally it includes additional symbols, which
  438. are intermediate classifications, narrower than `error' but broader
  439. than a single error symbol.  For example, all the errors in accessing
  440. files have the condition `file-error'.
  441.    As a special exception, the error symbol `quit' does not have the
  442. condition `error', because quitting is not considered an error.
  443.    *Note Errors::, for an explanation of how errors are generated and
  444. handled.
  445. `SYMBOL'
  446.      STRING; REFERENCE.
  447. `error'
  448.      `"error"'; see `error' in *Note Errors::.
  449. `quit'
  450.      `"Quit"'; see *Note Quitting::.
  451. `args-out-of-range'
  452.      `"Args out of range"'; see *Note Sequences Arrays Vectors::.
  453. `arith-error'
  454.      `"Arithmetic error"'; see `/' and `%' in *Note Numbers::.
  455. `beginning-of-buffer'
  456.      `"Beginning of buffer"'; see *Note Motion::.
  457. `buffer-read-only'
  458.      `"Buffer is read-only"'; see *Note Read Only Buffers::.
  459. `end-of-buffer'
  460.      `"End of buffer"'; see *Note Motion::.
  461. `end-of-file'
  462.      `"End of file during parsing"'; see *Note Input Functions::. This
  463.      is not a `file-error'.
  464. `file-error'
  465.      *Note Files::.  This error, and its subcategories, do not have
  466.      error-strings, because the error message is constructed from the
  467.      data items alone when the error condition `file-error' is present.
  468. `file-locked'
  469.      *Note File Locks::.  This is a `file-error'.
  470. `file-already-exists'
  471.      *Note Writing to Files::.  This is a `file-error'.
  472. `file-supersession'
  473.      *Note Buffer Modification::.  This is a `file-error'.
  474. `invalid-function'
  475.      `"Invalid function"'; see *Note Classifying Lists::.
  476. `invalid-read-syntax'
  477.      `"Invalid read syntax"'; see *Note Input Functions::.
  478. `invalid-regexp'
  479.      `"Invalid regexp"'; see *Note Regular Expressions::.
  480. `no-catch'
  481.      `"No catch for tag"'; see *Note Catch and Throw::.
  482. `search-failed'
  483.      `"Search failed"'; see *Note Searching and Matching::.
  484. `setting-constant'
  485.      `"Attempt to set a constant symbol"'; the values of the symbols
  486.      `nil' and `t' may not be changed.
  487. `void-function'
  488.      `"Symbol's function definition is void"';
  489.      see *Note Function Cells::.
  490. `void-variable'
  491.      `"Symbol's value as variable is void"';
  492.      see *Note Accessing Variables::.
  493. `wrong-number-of-arguments'
  494.      `"Wrong number of arguments"'; see *Note Classifying Lists::.
  495. `wrong-type-argument'
  496.      `"Wrong type argument"'; see *Note Type Predicates::.
  497. File: elisp,  Node: Standard Buffer-Local Variables,  Next: Standard Keymaps,  Prev: Standard Errors,  Up: Top
  498. Standard Buffer-Local Variables
  499. *******************************
  500.    The table below shows all of the variables that are automatically
  501. local (when set) in each buffer in Emacs Version 18 with the common
  502. packages loaded.
  503. `abbrev-mode'
  504.      *Note Abbrevs::.
  505. `auto-fill-hook'
  506.      *Note Auto Filling::.
  507. `buffer-auto-save-file-name'
  508.      *Note Auto-Saving::.
  509. `buffer-backed-up'
  510.      *Note Backup Files::.
  511. `buffer-file-name'
  512.      *Note Buffer File Name::.
  513. `buffer-read-only'
  514.      *Note Read Only Buffers::.
  515. `buffer-saved-size'
  516.      *Note Point::.
  517. `case-fold-search'
  518.      *Note Searching and Case::.
  519. `ctl-arrow'
  520.      *Note Control Char Display::.
  521. `default-directory'
  522.      *Note System Environment::.
  523. `fill-column'
  524.      *Note Auto Filling::.
  525. `left-margin'
  526.      *Note Indentation::.
  527. `local-abbrev-table'
  528.      *Note Abbrevs::.
  529. `major-mode'
  530.      *Note Mode Help::.
  531. `mark-ring'
  532.      *Note The Mark::.
  533. `minor-modes'
  534.      *Note Minor Modes::.
  535. `mode-name'
  536.      *Note Mode Line Variables::.
  537. `overwrite-mode'
  538.      *Note Insertion::.
  539. `paragraph-separate'
  540.      *Note Standard Regexps::.
  541. `paragraph-start'
  542.      *Note Standard Regexps::.
  543. `require-final-newline'
  544.      *Note Insertion::.
  545. `selective-display'
  546.      *Note Selective Display::.
  547. `selective-display-ellipses'
  548.      *Note Selective Display::.
  549. `tab-width'
  550.      *Note Control Char Display::.
  551. `truncate-lines'
  552.      *Note Truncation::.
  553. File: elisp,  Node: Standard Keymaps,  Next: Standard Hooks,  Prev: Standard Buffer-Local Variables,  Up: Top
  554. Standard Keymaps
  555. ****************
  556.    The following symbols are used as the names for various keymaps.
  557. Some of these exist when Emacs is first started, others are only loaded
  558. when their respective mode is used.  This is not an exhaustive list.
  559.    Almost all of these maps are used as local maps.  Indeed, of the
  560. modes that presently exist, only Vip mode and Terminal mode ever change
  561. the global keymap.
  562. `Buffer-menu-mode-map'
  563.      A full keymap used by Buffer Menu mode.
  564. `c-mode-map'
  565.      A sparse keymap used in C mode as a local map.
  566. `command-history-map'
  567.      A full keymap used by Command History mode.
  568. `ctl-x-4-map'
  569.      A sparse keymap for subcommands of the prefix `C-x 4'.
  570. `ctl-x-map'
  571.      A full keymap for `C-x' commands.
  572. `debugger-mode-map'
  573.      A full keymap used by Debugger mode.
  574. `dired-mode-map'
  575.      A full keymap for `dired-mode' buffers.
  576. `doctor-mode-map'
  577.      A sparse keymap used by Doctor mode.
  578. `edit-abbrevs-map'
  579.      A sparse keymap used in `edit-abbrevs'.
  580. `edit-tab-stops-map'
  581.      A sparse keymap used in `edit-tab-stops'.
  582. `electric-buffer-menu-mode-map'
  583.      A full keymap used by Electric Buffer Menu mode.
  584. `electric-history-map'
  585.      A full keymap used by Electric Command History mode.
  586. `emacs-lisp-mode-map'
  587.      A sparse keymap used in Emacs Lisp mode.
  588. `function-keymap'
  589.      The keymap for the definitions of keypad and function keys.
  590.      If there are none, then it contains an empty sparse keymap.
  591. `fundamental-mode-map'
  592.      The local keymap for Fundamental mode.
  593.      It is empty and should not be changed.
  594. `Helper-help-map'
  595.      A full keymap used by the help utility package.
  596.      It has the same keymap in its value cell and in its function cell.
  597. `Info-edit-map'
  598.      A sparse keymap used by the `e' command of Info.
  599. `Info-mode-map'
  600.      A sparse keymap containing Info commands.
  601. `lisp-interaction-mode-map'
  602.      A sparse keymap used in Lisp mode.
  603. `lisp-mode-map'
  604.      A sparse keymap used in Lisp mode.
  605. `mode-specific-map'
  606.      The keymap for characters following `C-c'.  Note, this is in the
  607.      global map.  This map is not actually mode specific: its name was
  608.      chosen to be informative for the user in `C-h b'
  609.      (`display-bindings'), where it describes the main use of the `C-c'
  610.      prefix key.
  611. `mouse-map'
  612.      A sparse keymap for mouse commands from the X Window System.
  613. `occur-mode-map'
  614.      A local keymap used in Occur mode.
  615. `text-mode-map'
  616.      A sparse keymap used by Text mode.
  617. `view-mode-map'
  618.      A full keymap used by View mode.
  619. File: elisp,  Node: Standard Hooks,  Next: Index,  Prev: Standard Keymaps,  Up: Top
  620. Standard Hooks
  621. **************
  622.    The following is a list of hooks available with the distributed 18.52
  623. version of GNU Emacs.  Some of these hooks are called with `run-hooks'
  624. and can be a list of functions.  Others are not called with `run-hooks'
  625. and may or may not allow a list of functions.  For example, the
  626. `suspend-hook' can only reference a single function. *Note Hooks::, for
  627. more information about using hooks.
  628.      *Note:* in version 19, `blink-paren-hook' and `auto-fill-hook' are
  629.      renamed to `blink-paren-function' and `auto-fill-function'
  630.      respectively, since they are not called by the `run-hooks'
  631.      function.
  632. `auto-fill-hook'
  633. `blink-paren-hook'
  634. `c-mode-hook'
  635. `command-history-hook'
  636. `comment-indent-hook'
  637. `define-hooked-global-abbrev'
  638. `define-hooked-local-abbrev'
  639. `dired-mode-hook'
  640. `disabled-command-hook'
  641. `edit-picture-hook'
  642. `electric-buffer-menu-mode-hook'
  643. `electric-command-history-hook'
  644. `electric-help-mode-hook'
  645. `emacs-lisp-mode-hook'
  646. `find-file-hooks'
  647. `find-file-not-found-hooks'
  648. `fortran-comment-hook'
  649. `fortran-mode-hook'
  650. `ftp-setup-write-file-hooks'
  651. `ftp-write-file-hook'
  652. `indent-mim-hook'
  653. `LaTeX-mode-hook'
  654. `ledit-mode-hook'
  655. `lisp-indent-hook'
  656. `lisp-interaction-mode-hook'
  657. `lisp-mode-hook'
  658. `m2-mode-hook'
  659. `mail-mode-hook'
  660. `mail-setup-hook'
  661. `medit-mode-hook'
  662. `mh-compose-letter-hook'
  663. `mh-folder-mode-hook'
  664. `mh-letter-mode-hook'
  665. `mim-mode-hook'
  666. `news-mode-hook'
  667. `news-reply-mode-hook'
  668. `news-setup-hook'
  669. `nroff-mode-hook'
  670. `outline-mode-hook'
  671. `plain-TeX-mode-hook'
  672. `prolog-mode-hook'
  673. `protect-innocence-hook'
  674. `rmail-edit-mode-hook'
  675. `rmail-mode-hook'
  676. `rmail-summary-mode-hook'
  677. `scheme-indent-hook'
  678. `scheme-mode-hook'
  679. `scribe-mode-hook'
  680. `shell-mode-hook'
  681. `shell-set-directory-error-hook'
  682. `suspend-hook'
  683. `suspend-resume-hook'
  684. `temp-buffer-show-hook'
  685. `term-setup-hook'
  686. `terminal-mode-hook'
  687. `terminal-mode-break-hook'
  688. `TeX-mode-hook'
  689. `text-mode-hook'
  690. `vi-mode-hook'
  691. `view-hook'
  692. `write-file-hooks'
  693. `x-process-mouse-hook'
  694.