home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / info / elisp.i02 < prev    next >
Encoding:
GNU Info File  |  1993-06-14  |  51.0 KB  |  1,196 lines

  1. This is Info file elisp, produced by Makeinfo-1.47 from the input file
  2. elisp.texi.
  3.  
  4.    This file documents GNU Emacs Lisp.
  5.  
  6.    This is edition 1.03 of the GNU Emacs Lisp Reference Manual, for
  7. Emacs Version 18.
  8.  
  9.    Published by the Free Software Foundation, 675 Massachusetts Avenue,
  10. Cambridge, MA 02139 USA
  11.  
  12.    Copyright (C) 1990 Free Software Foundation, Inc.
  13.  
  14.    Permission is granted to make and distribute verbatim copies of this
  15. manual provided the copyright notice and this permission notice are
  16. preserved on all copies.
  17.  
  18.    Permission is granted to copy and distribute modified versions of
  19. this manual under the conditions for verbatim copying, provided that
  20. the entire resulting derived work is distributed under the terms of a
  21. permission notice identical to this one.
  22.  
  23.    Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that this permission notice may be stated in a
  26. translation approved by the Foundation.
  27.  
  28. 
  29. File: elisp,  Node: Printing Notation,  Next: Error Messages,  Prev: Evaluation Notation,  Up: Conventions
  30.  
  31. Printing Notation
  32. -----------------
  33.  
  34.    Many of the examples in this manual print text when they are
  35. evaluated.  If you execute the code from an example in a Lisp
  36. Interaction buffer (such as the buffer `*scratch*'), the printed text
  37. is inserted into the buffer.  If the example is executed by other means
  38. (such as by evaluating the function `eval-region'), the text printed is
  39. usually displayed in the echo area.  You should be aware that text
  40. displayed in the echo area is truncated to a single line.
  41.  
  42.    In examples that print text, the printed text is indicated with
  43. `-|', irrespective of how the form is executed.  The value returned by
  44. evaluating the form (here `bar') follows on a separate line.
  45.  
  46.      (progn (print 'foo) (print 'bar))
  47.           -| foo
  48.           -| bar
  49.           => bar
  50.  
  51. 
  52. File: elisp,  Node: Error Messages,  Next: Buffer Text Notation,  Prev: Printing Notation,  Up: Conventions
  53.  
  54. Error Messages
  55. --------------
  56.  
  57.    Some examples cause errors to be signaled.  In them, the error
  58. message (which always appears in the echo area) is shown on a line
  59. starting with `error-->'.  Note that `error-->' itself does not appear
  60. in the echo area.
  61.  
  62.      (+ 23 'x)
  63.      error--> Wrong type argument: integer-or-marker-p, x
  64.  
  65. 
  66. File: elisp,  Node: Buffer Text Notation,  Next: Format of Descriptions,  Prev: Error Messages,  Up: Conventions
  67.  
  68. Buffer Text Notation
  69. --------------------
  70.  
  71.    Some examples show modifications to text in a buffer, with "before"
  72. and "after" versions of the text.  In such cases, the entire contents
  73. of the buffer in question are included between two lines of dashes
  74. containing the buffer name.  In addition, the location of point is shown
  75. as `-!-'.  (The symbol for point, of course, is not part of the text in
  76. the buffer; it indicates the place *between* two characters where point
  77. is located.)
  78.  
  79.      ---------- Buffer: foo ----------
  80.      This is the -!-contents of foo.
  81.      ---------- Buffer: foo ----------
  82.      
  83.      (insert "changed ")
  84.           => nil
  85.      ---------- Buffer: foo ----------
  86.      This is the changed -!-contents of foo.
  87.      ---------- Buffer: foo ----------
  88.  
  89. 
  90. File: elisp,  Node: Format of Descriptions,  Prev: Buffer Text Notation,  Up: Conventions
  91.  
  92. Format of Descriptions
  93. ----------------------
  94.  
  95.    Functions, variables, macros, commands, user options, and special
  96. forms are described in this manual in a uniform format.  The first line
  97. of a description contains the name of the item followed by its
  98. arguments, if any. The category--function, variable, or
  99. whatever--appears at the beginning of the line. The description follows
  100. on succeeding lines, sometimes with examples.
  101.  
  102. * Menu:
  103.  
  104. * A Sample Function Description::
  105. * A Sample Variable Description::
  106.  
  107. 
  108. File: elisp,  Node: A Sample Function Description,  Next: A Sample Variable Description,  Prev: Format of Descriptions,  Up: Format of Descriptions
  109.  
  110. A Sample Function Description
  111. .............................
  112.  
  113.    In a function description, the name of the function being described
  114. appears first.  It is followed on the same line by a list of parameters.
  115. The names used for the parameters are also used in the body of the
  116. description.
  117.  
  118.    The appearance of the keyword `&optional' in the parameter list
  119. indicates that the arguments for subsequent parameters may be omitted
  120. (omitted parameters default to `nil').  Do not write `&optional' when
  121. you call the function.
  122.  
  123.    The keyword `&rest' (which will always be followed by a single
  124. parameter) indicates that any number of arguments can follow.  The value
  125. of the single following parameter will be a list of all these arguments.
  126. Do not write `&rest' when you call the function.
  127.  
  128.    Here is a description of an imaginary function `foo':
  129.  
  130.  -- Function: foo INTEGER1 &optional INTEGER2 &rest INTEGERS
  131.      The function `foo' subtracts INTEGER1 from INTEGER2, then adds all
  132.      the rest of the arguments to the result.  If INTEGER2 is not
  133.      supplied, then the number 19 is used by default.
  134.  
  135.           (foo 1 5 3 9)
  136.                => 16
  137.           (foo 5)
  138.                => 14
  139.  
  140.      More generally,
  141.  
  142.           (foo W X Y...)
  143.           ==
  144.           (+ (- X W) Y...)
  145.  
  146.    Any parameter whose name contains the name of a type (e.g., INTEGER,
  147. INTEGER1 or BUFFER) is expected to be of that type.  A plural of a type
  148. (such as BUFFERS) often means a list of objects of that type. 
  149. Parameters named OBJECT may be of any type. (*Note Types of Lisp
  150. Object::, for a list of Emacs object types.) Parameters with other
  151. sorts of names (e.g., NEW-FILE) are discussed specifically in the
  152. description of the function.  In some sections, features common to
  153. parameters of several functions are described at the beginning.
  154.  
  155.    *Note Lambda Expressions::, for a more complete description of
  156. optional and rest arguments.
  157.  
  158.    Command, macro, and special form descriptions have the same format,
  159. but the word `Function' is replaced by `Command', `Macro', or `Special
  160. Form', respectively.  Commands are simply functions that may be called
  161. interactively; macros process their arguments differently from functions
  162. (the arguments are not evaluated), but are presented the same way.
  163.  
  164.    Special form descriptions use a more complex notation to specify
  165. optional and repeated parameters because they can break the argument
  166. list down into separate arguments in more complicated ways.
  167. ``[OPTIONAL-ARG]'' means that OPTIONAL-ARG is optional and
  168. `REPEATED-ARGS...' stands for zero or more arguments.  Parentheses are
  169. used when several arguments are grouped into additional levels of list
  170. structure.  Here is an example:
  171.  
  172.  -- Special Form: count-loop (VAR [FROM TO [INC]]) BODY...
  173.      This imaginary special form implements a loop that executes the
  174.      BODY forms and then increments the variable VAR on each iteration.
  175.       On the first iteration, the variable has the value FROM; on
  176.      subsequent iterations, it is incremented by 1 (or by INC if that
  177.      is given).  The loop exits before executing BODY if VAR equals TO.
  178.       Here is an example:
  179.  
  180.           (count-loop (i 0 10)
  181.             (prin1 i) (princ " ")
  182.             (prin1 (aref vector i)) (terpri))
  183.  
  184.      If FROM and TO are omitted, then VAR is bound to `nil' before the
  185.      loop begins, and the loop exits if VAR is non-`nil' at the
  186.      beginning of an iteration.  Here is an example:
  187.  
  188.           (count-loop (done)
  189.             (if (pending)
  190.                 (fixit)
  191.               (setq done t)))
  192.  
  193.      In this special form, the arguments FROM and TO are optional, but
  194.      must both be present or both absent.  If they are present, INC may
  195.      optionally be specified as well.  These arguments are grouped with
  196.      the argument VAR into a list, to distinguish them from BODY, which
  197.      includes all remaining elements of the form.
  198.  
  199. 
  200. File: elisp,  Node: A Sample Variable Description,  Prev: A Sample Function Description,  Up: Format of Descriptions
  201.  
  202. A Sample Variable Description
  203. .............................
  204.  
  205.    A "variable" is a name that can hold a value.  Although any variable
  206. can be set by the user, certain variables that exist specifically so
  207. that users can change them are called "user options".  Ordinary
  208. variables and user options are described using a format like that for
  209. functions except that there are no arguments.
  210.  
  211.    Here is a description of the imaginary `electric-future-map'
  212. variable.
  213.  
  214.  -- Variable: electric-future-map
  215.      The value of this variable is a full keymap used by electric
  216.      command future mode.  The functions in this map will allow you to
  217.      edit commands you have not yet thought about executing.
  218.  
  219.    User option descriptions have the same format, but `Variable' is
  220. replaced by `User Option'.
  221.  
  222. 
  223. File: elisp,  Node: Acknowledgements,  Prev: Conventions,  Up: Introduction
  224.  
  225. Acknowledgements
  226. ================
  227.  
  228.    This manual was written by Robert Krawitz, Bil Lewis, Dan LaLiberte,
  229. Richard M. Stallman and Chris Welty, the volunteers of the GNU manual
  230. group, in an effort extending over several years.  Robert J. Chassell
  231. helped to review and edit the manual, with the support of the Defense
  232. Advanced Research Projects Agency, ARPA Order 6082, arranged by Warren
  233. A. Hunt, Jr. of Computational Logic, Inc.
  234.  
  235.    Corrections were supplied by Karl Berry, Bard Bloom, David Boyes,
  236. Alan Carroll, David A. Duff, Beverly Erlebacher, David Eckelkamp, Eirik
  237. Fuller, Eric Hanchrow, George Hartzell, Nathan Hess, Dan Jacobson, Jak
  238. Kirman, Bob Knighten, Frederick M. Korz, Joe Lammens, K. Richard Magill,
  239. Brian Marick, Roland McGrath, Skip Montanaro, John Gardiner Myers,
  240. Arnold D. Robbins, Raul Rockwell, Shinichirou Sugou, Kimmo Suominen,
  241. Edward Tharp, Bill Trost, Jean White, Matthew Wilding, Carl Witty, Dale
  242. Worley, Rusty Wright, and David D. Zuhn.
  243.  
  244. 
  245. File: elisp,  Node: Types of Lisp Object,  Next: Numbers,  Prev: Introduction,  Up: Top
  246.  
  247. Lisp Data Types
  248. ***************
  249.  
  250.    A Lisp "object" is a piece of data used and manipulated by Lisp
  251. programs.  For our purposes, a "type" or "data type" is a set of
  252. possible objects.
  253.  
  254.    Every object belongs to at least one type.  Objects of the same type
  255. have similar structures and may usually be used in the same contexts.
  256. Types can overlap, and objects can belong to two or more types.
  257. Consequently, we can ask whether an object belongs to a particular type,
  258. but not for "the" type of an object.
  259.  
  260.    A few fundamental object types are built into Emacs.  These, from
  261. which all other types are constructed, are called "primitive types".
  262. They include "integer", "cons", "symbol", "string", "vector", "subr"
  263. and several special types, such as "buffer", that are related to
  264. editing.  (*Note Editing Types::.)
  265.  
  266.    While an object may be a member of more than one type, every object
  267. is a member of exactly one primitive type.  The primitive type of an
  268. object is stored with the object's data.  A Lisp function is provided
  269. for each primitive type to check whether an object is a member of that
  270. type.
  271.  
  272.    Note that Lisp is unlike many other languages in that Lisp objects
  273. are "self-typing": the primitive type of the object is implicit in the
  274. object itself.  For example, if an object is a vector, it cannot be
  275. treated as a number because Lisp knows it is a vector, not a number.  In
  276. most languages, the programmer must declare the data type of each
  277. variable, and the type is known by the compiler but not represented in
  278. the data.  Such type declarations do not exist in Emacs Lisp.
  279.  
  280.    This chapter describes the purpose, printed representation, and read
  281. syntax of each of the standard types in GNU Emacs Lisp.  Details on how
  282. to use these types can be found in later chapters.
  283.  
  284. * Menu:
  285.  
  286. * Printed Representation::      How Lisp objects are represented as text.
  287. * Comments::                    Comments and their formatting conventions.
  288. * Programming Types::           Types found in all Lisp systems.
  289. * Editing Types::               Types specific to Emacs.
  290. * Type Predicates::             Tests related to types.
  291. * Equality Predicates::         Tests of equality between any two objects.
  292.  
  293. 
  294. File: elisp,  Node: Printed Representation,  Next: Comments,  Prev: Types of Lisp Object,  Up: Types of Lisp Object
  295.  
  296. Printed Representation and Read Syntax
  297. ======================================
  298.  
  299.    The "printed representation" of an object is the format of the
  300. output generated by the Lisp printer (the function `print') for that
  301. object.  The "read syntax" of an object is the format of the input
  302. accepted by the Lisp reader (the function `read') for that object. 
  303. Most objects have more than one possible read syntax.  Some types of
  304. object have no read syntax; except in these cases, the printed
  305. representation of an object is also a read syntax for it.
  306.  
  307.    In other languages, an expression is text; it has no other form.  In
  308. Lisp, an expression is primarily a Lisp object and only secondarily the
  309. text that is the object's read syntax.  Often there is no need to
  310. emphasize this distinction, but you must keep it in the back of your
  311. mind, or you will occasionally be very confused.
  312.  
  313.    Every type has a printed representation.  Some types have no read
  314. syntax, since it may not make sense to enter objects of these types
  315. directly in a Lisp program.  For example, the buffer type does not have
  316. a read syntax.  Objects of these types are printed in "hash notation":
  317. the characters `#<' followed by a descriptive string (typically the
  318. type name followed by the name of the object), and closed with a
  319. matching `>'.  Hash notation cannot be read at all, so the Lisp reader
  320. signals the error `invalid-read-syntax' whenever a `#' is encountered.
  321.  
  322.      (current-buffer)
  323.           => #<buffer objects.texi>
  324.  
  325.    When you evaluate an expression interactively, the Lisp interpreter
  326. first reads the textual representation of it, producing a Lisp object,
  327. and then evaluates that object (*note Evaluation::.).  However,
  328. evaluation and reading are separate activities.  Reading returns the
  329. Lisp object represented by the text that is read; the object may or may
  330. not be evaluated later.  *Note Input Functions::, for a description of
  331. `read', the basic function for reading objects.
  332.  
  333. 
  334. File: elisp,  Node: Comments,  Next: Programming Types,  Prev: Printed Representation,  Up: Types of Lisp Object
  335.  
  336. Comments
  337. ========
  338.  
  339.    A "comment" is text that is written in a program only for the sake
  340. of humans that read the program, and that has no effect on the meaning
  341. of the program.  In Lisp, a comment starts with a semicolon (`;') and
  342. continues to the end of line.  Comments are discarded by the Lisp
  343. reader, and do not become part of the Lisp objects which represent the
  344. program within the Lisp system.
  345.  
  346.    We recommend these conventions for where to put comments and how to
  347. indent them:
  348.  
  349. `;'
  350.      Comments that start with a single semicolon, `;', should all be
  351.      aligned to the same column on the right of the source code.  Such
  352.      comments usually explain how the code on the same line does its
  353.      job.  In Lisp mode and related modes, the `M-;'
  354.      (`indent-for-comment') command automatically inserts such a `;' in
  355.      the right place, or aligns such a comment if it is already
  356.      inserted.
  357.  
  358.      (The following examples are taken from the Emacs sources.)
  359.  
  360.           (setq base-version-list                 ; there was a base
  361.                 (assoc (substring fn 0 start-vn)  ; version to which
  362.                        file-version-assoc-list))  ; this looks like
  363.                                                   ; a subversion
  364.  
  365. `;;'
  366.      Comments that start with two semicolons, `;;', should be aligned to
  367.      the same level of indentation as the code.  Such comments are used
  368.      to describe the purpose of the following lines or the state of the
  369.      program at that point.  For example:
  370.  
  371.             (prog1 (setq auto-fill-hook
  372.                          ...
  373.                          ...
  374.               ;; update mode-line
  375.               (set-buffer-modified-p (buffer-modified-p))))
  376.  
  377.      These comments are also written before a function definition to
  378.      explain what the function does and how to call it properly.
  379.  
  380. `;;;'
  381.      Comments that start with three semicolons, `;;;', should start at
  382.      the left margin.  Such comments are not used within function
  383.      definitions, but are used to make more general comments.  For
  384.      example:
  385.  
  386.           ;;; This Lisp code is run in Emacs when it is to operate as
  387.           ;;; a server for other processes.
  388.  
  389. `;;;;'
  390.      Comments that start with four semicolons, `;;;;', should be aligned
  391.      to the left margin and are used for headings of major sections of a
  392.      program.  For example:
  393.  
  394.           ;;;; The kill ring
  395.  
  396. The indentation commands of the Lisp modes in Emacs, such as `M-;'
  397. (`indent-for-comment') and TAB (`lisp-indent-line') automatically
  398. indent comments according to these conventions, depending on the the
  399. number of semicolons.  *Note  Manipulating Comments: (emacs)Comments.
  400.  
  401.    Any character may be included in a comment, but it is advisable to
  402. precede a character with syntactic significance in Lisp (such as `\' or
  403. unpaired `(' or `)') with a `\', to prevent it from confusing the Emacs
  404. commands for editing Lisp.
  405.  
  406. 
  407. File: elisp,  Node: Programming Types,  Next: Editing Types,  Prev: Comments,  Up: Types of Lisp Object
  408.  
  409. Programming Types
  410. =================
  411.  
  412.    There are two general categories of types in Emacs Lisp: those having
  413. to do with Lisp programming, and those having to do with editing.  The
  414. former are provided in many Lisp implementations, in one form or
  415. another.  The latter are unique to Emacs Lisp.
  416.  
  417. * Menu:
  418.  
  419. * Number Type::         Primarily integers.
  420. * Character Type::      The representation of letters, numbers and
  421.                         control characters.
  422. * Sequence Type::       Both lists and arrays are classified as sequences.
  423. * List Type::           Lists gave Lisp its name (not to mention reputation).
  424. * Array Type::          Arrays include strings and vectors.
  425. * String Type::         An (efficient) array of characters.
  426. * Vector Type::         One-dimensional arrays.
  427. * Symbol Type::         A multi-use object that refers to a function,
  428.                         variable, property list, or itself.
  429. * Lisp Function Type::  A piece of executable code you can call from elsewhere.
  430. * Lisp Macro Type::     A method of expanding an expression into another
  431.                           expression, more fundamental but less pretty.
  432. * Primitive Function Type::     A function written in C, callable from Lisp.
  433. * Autoload Type::       A type used for automatically loading seldom-used
  434.                         functions.
  435.  
  436. 
  437. File: elisp,  Node: Number Type,  Next: Character Type,  Prev: Programming Types,  Up: Programming Types
  438.  
  439. Number Type
  440. -----------
  441.  
  442.    Integers are the only kind of number in GNU Emacs Lisp, version 18.
  443. The range of values for integers is -8388608 to 8388607 (24 bits; i.e.,
  444. -2**23 to 2**23 - 1) on most machines, but is 25 or 26 bits on some
  445. systems.  It is important to note that the Emacs Lisp arithmetic
  446. functions do not check for overflow.  Thus `(1+ 8388607)' is -8388608
  447. on 24-bit implementations.
  448.  
  449.    Version 19 supports floating point numbers.
  450.  
  451.    The read syntax for numbers is a sequence of (base ten) digits with
  452. an optional sign.  The printed representation produced by the Lisp
  453. interpreter never has a leading `+'.
  454.  
  455.      -1               ; The integer -1.
  456.      1                ; The integer 1.
  457.      +1               ; Also the integer 1.
  458.      16777217         ; Also the integer 1! (on a 24-bit or 25-bit implementation)
  459.  
  460.    *Note Numbers::, for more information.
  461.  
  462. 
  463. File: elisp,  Node: Character Type,  Next: Sequence Type,  Prev: Number Type,  Up: Programming Types
  464.  
  465. Character Type
  466. --------------
  467.  
  468.    A "character" in Emacs Lisp is nothing more than an integer.  In
  469. other words, characters are represented by their eight-bit ASCII
  470. values.  For example, the character `A' is represented as the
  471. integer 65.  If an arbitrary integer is used as a character, only the
  472. lower eight bits are significant.
  473.  
  474.    Individual characters are not often used in programs.  It is far more
  475. common to work with *strings*, which are sequences composed of
  476. characters.  *Note String Type::.
  477.  
  478.    Since characters are really integers, the printed representation of a
  479. character is a decimal number.  This is also a possible read syntax for
  480. a character, but it is not convenient for that purpose.  Therefore,
  481. Emacs Lisp provides a variety of read syntax formats, such as `?A' and
  482. `?\101', for entering characters.  They all start with a question mark.
  483.  
  484.    The usual read syntax for alphanumeric characters is a question mark
  485. followed by the character; thus, `?A' for the character `A', `?B' for
  486. the character `B', and `?a' for the character `a'.  For example:
  487.  
  488.      ?Q => 81
  489.      
  490.      ?q => 113
  491.  
  492.    The characters backspace, tab, newline, vertical tab, formfeed,
  493. return, and escape may be represented as `?\b', `?\t', `?\n', `?\v',
  494. `?\f', `?\r', `?\e', respectively.  Those values are 8, 9, 10, 11, 12,
  495. 13, and 27 in decimal. Thus,
  496.  
  497.      ?\b => 8                 ; backspace, BS, `C-h'
  498.      ?\t => 9                 ; tab, TAB, `C-i'
  499.      ?\n => 10                ; newline, LFD, `C-j'
  500.      ?\v => 11                ; vertical tab, `C-k'
  501.      ?\f => 12                ; formfeed character, `C-l'
  502.      ?\r => 13                ; carriage return, RET, `C-m'
  503.      ?\e => 27                ; escape character, ESC, `C-['
  504.      ?\\ => 92                ; backslash character, `\'
  505.  
  506.    Control characters may be represented using yet another read syntax.
  507. This consists of a question mark followed by a backslash, caret, and the
  508. corresponding non-control character, in either upper or lower case.  For
  509. example, either `?\^I' or `?\^i' may be used as the read syntax for the
  510. character `C-i', the character whose value is 9.
  511.  
  512.    Instead of the `^', you can use `C-'; thus, `?\C-i' is equivalent to
  513. `?\^I', and `?\C-i' is equivalent to `?\^i'.  For example:
  514.  
  515.      ?\^I => 9
  516.      
  517.      ?\C-I => 9
  518.  
  519.    The DEL key can be considered and written as `Control-?':
  520.  
  521.      ?\^? => 127
  522.      
  523.      ?\C-? => 127
  524.  
  525.    When you represent control characters to be found in files or
  526. strings, we recommend the `^' syntax; but when you refer to keyboard
  527. input, we prefer the `C-' syntax.  This does not affect the meaning of
  528. the program, but may guide the understanding of people who read it.
  529.  
  530.    A "meta character" is a character that has its eighth bit set. The
  531. read syntax for these characters is question mark, backslash, `M-', and
  532. the corresponding seven-bit character.  For example, `?\M-A' stands for
  533. `M-A', the character with code 193 (301 octal).  The seven-bit
  534. character can be written directly or specified by any of the `\'
  535. escapes described above or below.  Thus, `M-A' can be written as
  536. `?\M-A', or as `?\M-\101', or as `?\301'.  Likewise, the character
  537. whose decimal printed representation is 130 (202 octal) can use any one
  538. of the following for its read syntax: `?\202', `?\M-\C-b', `?\C-\M-b',
  539. or `?\M-\002'.  For example:
  540.  
  541.      ?\C-\M-b => 130          ?\M-\C-b => 130
  542.      
  543.      ?\^\M-b => 130           ?\M-\002 => 130
  544.  
  545.    Finally, the most general read syntax consists of a question mark
  546. followed by a backslash and the ASCII code for the character in octal
  547. (up to three octal digits); thus, `?\101' for the character `A',
  548. `?\001' for the character `C-a', and `?\002' for the character `C-b'. 
  549. Although this syntax can represent any character, it is preferred only
  550. when the precise octal value is more important than the ASCII
  551. representation.  (These sequences which start with backslash are also
  552. known as "escape sequences", because backslash plays the role of an
  553. escape character, but they have nothing to do with the character ESC.)
  554.  
  555.      ?\012 => 10        ?\n => 10         ?\C-j => 10
  556.      
  557.      ?\101 => 65        ?A => 65
  558.      
  559.      ?\301 => 193       ?\M-A => 193      ?\M-\101 => 193
  560.  
  561.    A backslash is allowed, and harmless, preceding any character without
  562. a special escape meaning; thus, `?\A' is equivalent to `?A'. There is
  563. no reason to use a backslash before most such characters. However, any
  564. of the characters `()\|;'`"#.,' should be preceded by a backslash to
  565. avoid confusing the Emacs commands for editing Lisp code. Whitespace
  566. characters such as space, tab, newline and formfeed should also be
  567. preceded by a backslash.  However, it is cleaner to use one of the
  568. easily readable escape sequences, such as `\t', instead of an actual
  569. control character such as a tab.
  570.  
  571. 
  572. File: elisp,  Node: Sequence Type,  Next: List Type,  Prev: Character Type,  Up: Programming Types
  573.  
  574. Sequence Types
  575. --------------
  576.  
  577.    A "sequence" is a Lisp object that represents an ordered set of
  578. elements.  There are two kinds of sequence in Emacs Lisp, lists and
  579. arrays.  Thus, an object of type list or of type array is also
  580. considered a sequence.
  581.  
  582.    Arrays are further subdivided into strings and vectors.  Vectors can
  583. hold elements of any type, but string elements must be
  584. characters--integers from 0 to 255.
  585.  
  586.    Lists, strings and vectors are different, but they have important
  587. similarities.  For example, all have a length L, and all have elements
  588. which can be indexed from zero to L minus one.  Also, several
  589. functions, called sequence functions, accept any kind of sequence.  For
  590. example, the function `elt' can be used to extract an element of a
  591. sequence, given its index.  *Note Sequences Arrays Vectors::.
  592.  
  593.    It is impossible to read the same sequence twice, in the sense of
  594. `eq' (*note Equality Predicates::.), since sequences are always created
  595. anew upon reading.  There is one exception: the empty list `()' is
  596. always read as the same object, `nil'.
  597.  
  598. 
  599. File: elisp,  Node: List Type,  Next: Array Type,  Prev: Sequence Type,  Up: Programming Types
  600.  
  601. List Type
  602. ---------
  603.  
  604.    A "list" is a series of cons cells, linked together.  A "cons cell"
  605. is an object comprising two pointers named the CAR and the CDR.  Each
  606. of them can point to any Lisp object, but when the cons cell is part of
  607. a list, the CDR points either to another cons cell or to the empty
  608. list.  *Note Lists::, for functions that work on lists.
  609.  
  610.    The names CAR and CDR have only historical meaning now.  The
  611. original Lisp implementation ran on an IBM 704 computer which divided
  612. words into two parts, called the "address" part and the "decrement";
  613. CAR was an instruction to extract the contents of the address part of a
  614. register, and CDR an instruction to extract the contents of the
  615. decrement.  By contrast, "cons cells" are named for the function `cons'
  616. that creates them, which in turn is named for its purpose, the
  617. construction of cells.
  618.  
  619.    Because cons cells are so central to Lisp, we also have a word for
  620. "an object which is not a cons cell".  These objects are called "atoms".
  621.  
  622.    The read syntax and printed representation for lists are identical,
  623. and consist of a left parenthesis, an arbitrary number of elements, and
  624. a right parenthesis.
  625.  
  626.    Upon reading, any object inside the parentheses is made into an
  627. element of the list.  That is, a cons cell is made for each element.
  628. The CAR of the cons cell points to the element, and its CDR points to
  629. the next cons cell which holds the next element in the list. The CDR of
  630. the last cons cell is set to point to `nil'.
  631.  
  632.    A list can be illustrated by a diagram in which the cons cells are
  633. shown as pairs of boxes.  (The Lisp reader cannot read such an
  634. illustration; unlike the textual notation, which can be understood both
  635. humans and computers, the box illustrations can only be understood by
  636. humans.)  The following represents the three-element list `(rose violet
  637. buttercup)':
  638.  
  639.          ___ ___      ___ ___      ___ ___
  640.         |___|___|--> |___|___|--> |___|___|--> nil
  641.           |            |            |
  642.           |            |            |
  643.            --> rose     --> violet   --> buttercup
  644.  
  645.    In the diagram, each box represents a slot that can refer to any Lisp
  646. object.  Each pair of boxes represents a cons cell.  Each arrow is a
  647. reference to a Lisp object, either an atom or another cons cell.
  648.  
  649.    In this example, the first box, the CAR of the first cons cell,
  650. refers to or "contains" `rose' (a symbol).  The second box, the CDR of
  651. the first cons cell, refers to the next pair of boxes, the second cons
  652. cell.  The CAR of the second cons cell refers to `violet' and the CDR
  653. refers to the third cons cell.  The CDR of the third (and last) cons
  654. cell refers to `nil'.
  655.  
  656.    Here is another diagram of the same list, `(rose violet buttercup)',
  657. sketched in a different manner:
  658.  
  659.       ---------------         ----------------         -------------------
  660.      |car    |cdr    |       |car     |cdr    |       |car        |cdr    |
  661.      | rose  |   o---------->| violet |   o---------->| buttercup |  nil  |
  662.      |       |       |       |        |       |       |           |       |
  663.       ---------------         ----------------         -------------------
  664.  
  665.    A list with no elements in it is the "empty list"; it is identical
  666. to the symbol `nil'.  In other words, `nil' is both a symbol and a list.
  667.  
  668.    Here are examples of lists written in Lisp syntax:
  669.  
  670.      (A 2 "A")            ; A list of three elements.
  671.      ()                   ; A list of no elements (the empty list).
  672.      nil                  ; A list of no elements (the empty list).
  673.      ("A ()")             ; A list of one element: the string `"A ()"'.
  674.      (A ())               ; A list of two elements: `A' and the empty list.
  675.      (A nil)              ; Equivalent to the previous.
  676.      ((A B C))            ; A list of one element
  677.                           ; (which is a list of three elements).
  678.  
  679.    Here is the list `(A ())', or equivalently `(A nil)', depicted with
  680. boxes and arrows:
  681.  
  682.          ___ ___      ___ ___
  683.         |___|___|--> |___|___|--> nil
  684.           |            |
  685.           |            |
  686.            --> A        --> nil
  687.  
  688. * Menu:
  689.  
  690. * Dotted Pair Notation::        An alternative syntax for lists.
  691. * Association List Type::       A specially constructed list.
  692.  
  693. 
  694. File: elisp,  Node: Dotted Pair Notation,  Next: Association List Type,  Prev: List Type,  Up: List Type
  695.  
  696. Dotted Pair Notation
  697. ....................
  698.  
  699.    "Dotted pair notation" is an alternative syntax for cons cells that
  700. represents the CAR and CDR explicitly.  In this syntax, `(A . B)'
  701. stands for a cons cell whose CAR is the object A, and whose CDR is the
  702. object B.  Dotted pair notation is therefore more general than list
  703. syntax.  In the dotted pair notation, the list `(1 2 3)' is written as
  704. `(1 .  (2 . (3 . nil)))'.  For `nil'-terminated lists, the two
  705. notations produce the same result, but list notation is usually clearer
  706. and more convenient when it is applicable.  When printing a list, the
  707. dotted pair notation is only used if the CDR of a cell is not a list.
  708.  
  709.    Box notation can also be used to illustrate what dotted pairs look
  710. like.  For example, `(rose . violet)' is diagrammed as follows:
  711.  
  712.          ___ ___
  713.         |___|___|--> violet
  714.           |
  715.           |
  716.            --> rose
  717.  
  718.    Dotted pair notation can be combined with list notation to represent
  719. a chain of cons cells with a non-`nil' final CDR.  For example, `(rose
  720. violet . buttercup)' is equivalent to `(rose . (violet . buttercup))'. 
  721. The object looks like this:
  722.  
  723.          ___ ___      ___ ___
  724.         |___|___|--> |___|___|--> buttercup
  725.           |            |
  726.           |            |
  727.            --> rose     --> violet
  728.  
  729.    These diagrams make it evident that `(rose . violet . buttercup)'
  730. must have an invalid syntax since it would require that a cons cell
  731. have three parts rather than two.
  732.  
  733.    The list `(rose violet)' is equivalent to `(rose . (violet))' and
  734. looks like this:
  735.  
  736.          ___ ___      ___ ___
  737.         |___|___|--> |___|___|--> nil
  738.           |            |
  739.           |            |
  740.            --> rose     --> violet
  741.  
  742.    Similarly, the three-element list `(rose violet buttercup)' is
  743. equivalent to `(rose . (violet . (buttercup)))'. It looks like this:
  744.  
  745.          ___ ___      ___ ___      ___ ___
  746.         |___|___|--> |___|___|--> |___|___|--> nil
  747.           |            |            |
  748.           |            |            |
  749.            --> rose     --> violet   --> buttercup
  750.  
  751. 
  752. File: elisp,  Node: Association List Type,  Prev: Dotted Pair Notation,  Up: List Type
  753.  
  754. Association List Type
  755. .....................
  756.  
  757.    An "association list" or "alist" is a specially-constructed list
  758. whose elements are cons cells.  In each element, the CAR is considered
  759. a "key", and the CDR is considered an "associated value".  (In some
  760. cases, the associated value is stored in the CAR of the CDR.) 
  761. Association lists are often used to implement stacks, since new
  762. associations may easily be added to or removed from the front of the
  763. list.
  764.  
  765.    For example,
  766.  
  767.      (setq alist-of-colors '((rose . red) (lily . white)  (buttercup . yellow)))
  768.  
  769. sets the variable `alist-of-colors' to an alist of three elements.  In
  770. the first element, `rose' is the key and `red' is the value.
  771.  
  772.    *Note Association Lists::, for a further explanation of alists and
  773. for functions that work on alists.
  774.  
  775. 
  776. File: elisp,  Node: Array Type,  Next: String Type,  Prev: List Type,  Up: Programming Types
  777.  
  778. Array Type
  779. ----------
  780.  
  781.    An "array" is composed of an arbitrary number of other Lisp objects,
  782. arranged in a contiguous block of memory.  Any element of an array may
  783. be accessed in constant time.  In contrast, accessing an element of a
  784. list requires time proportional to the position of the element in the
  785. list.  (Elements at the end of a list take longer to access than
  786. elements at the beginning of a list.)
  787.  
  788.    Emacs defines two types of array, strings and vectors.  A string is
  789. an array of characters and a vector is an array of arbitrary objects. 
  790. Both are one-dimensional.  (Most other programming languages support
  791. multidimensional arrays, but we don't think they are essential in Emacs
  792. Lisp.)  Each type of array has its own read syntax; see *Note String
  793. Type::, and *Note Vector Type::.
  794.  
  795.    An array may have any length up to the largest integer; but once
  796. created, it has a fixed size.  The first element of an array has index
  797. zero, the second element has index 1, and so on.  This is called
  798. "zero-origin" indexing.  For example, an array of four elements has
  799. indices 0, 1, 2, and 3.
  800.  
  801.    The array type is contained in the sequence type and contains both
  802. strings and vectors.
  803.  
  804. 
  805. File: elisp,  Node: String Type,  Next: Vector Type,  Prev: Array Type,  Up: Programming Types
  806.  
  807. String Type
  808. -----------
  809.  
  810.    A "string" is an array of characters.  Strings are used for many
  811. purposes in Emacs, as can be expected in a text editor; for example, as
  812. the names of Lisp symbols, as messages for the user, and to represent
  813. text extracted from buffers.  Strings in Lisp are constants; evaluation
  814. of a string returns the same string.
  815.  
  816.    The read syntax for strings is a double-quote, an arbitrary number of
  817. characters, and another double-quote, `"like this"'.  The Lisp reader
  818. accepts the same formats for reading the characters of a string as it
  819. does for reading single characters (without the question mark that
  820. begins a character literal).  You can enter a nonprinting character such
  821. as tab, `C-a' or `M-C-A' using the convenient escape sequences, like
  822. this: `"\t, \C-a, \M-\C-a"'.  You can include a double-quote in a
  823. string by preceding it with a backslash; thus, `"\""' is a string
  824. containing just a single double-quote character. (*Note Character
  825. Type::, for a description of the read syntax for characters.)
  826.  
  827.    In contrast with the C programming language, newlines are allowed in
  828. Emacs Lisp string literals.  But an escaped newline--one that is
  829. preceded by `\'--does not become part of the string; i.e., the Lisp
  830. reader ignores an escaped newline in a string literal.
  831.  
  832.      "It is useful to include newlines in
  833.      documentation strings, but the newline is \
  834.      ignored if escaped."
  835.           => "It is useful to include newlines in
  836.      documentation strings, but the newline is ignored if escaped."
  837.  
  838.    The printed representation of a string consists of a double-quote,
  839. the characters it contains, and another double-quote.  However, any
  840. backslash or double-quote characters in the string are preceded with a
  841. backslash like this: `"this \" is an embedded quote"'.
  842.  
  843.    *Note Strings and Characters::, for functions that work on strings.
  844.  
  845. 
  846. File: elisp,  Node: Vector Type,  Next: Symbol Type,  Prev: String Type,  Up: Programming Types
  847.  
  848. Vector Type
  849. -----------
  850.  
  851.    A "vector" is a one-dimensional array of elements of any type.  It
  852. takes a constant amount of time to access any element of a vector.  (In
  853. a list, the access time of an element is proportional to the distance of
  854. the element from the beginning of the list.)
  855.  
  856.    The printed representation of a vector consists of a left square
  857. bracket, the elements, and a right square bracket.  This is also the
  858. read syntax.  Like numbers and strings, vectors are considered constants
  859. for evaluation.
  860.  
  861.      [1 "two" (three)]      ; A vector of three elements.
  862.           => [1 "two" (three)]
  863.  
  864.    *Note Vectors::, for functions that work with vectors.
  865.  
  866. 
  867. File: elisp,  Node: Symbol Type,  Next: Lisp Function Type,  Prev: Vector Type,  Up: Programming Types
  868.  
  869. Symbol Type
  870. -----------
  871.  
  872.    A "symbol" in GNU Emacs Lisp is an object with a name.  The symbol
  873. name is the printed representation of the symbol.  In ordinary use, the
  874. name is unique--no two symbols have the same name.
  875.  
  876.    A symbol may be used in programs as a variable, as a function name,
  877. or to hold a list of properties.  Or it may serve only to be distinct
  878. from all other Lisp objects, so that its presence in a data structure
  879. may be recognized reliably.  In a given context, usually only one of
  880. these uses is intended.
  881.  
  882.    A symbol name can contain any characters whatever.  Most symbol names
  883. are written with letters, digits, and the punctuation characters
  884. `-+=*/'.  Such names require no special punctuation; the characters of
  885. the name suffice as long as the name does not look like a number. (If
  886. it does, write a `\' at the beginning of the name to force
  887. interpretation as a symbol.)  The characters `_~!@$%^&:<>{}' are less
  888. often used but also require no special punctuation.  Any other
  889. characters may be included in a symbol's name by escaping them with a
  890. backslash.  In contrast to its use in strings, however, a backslash in
  891. the name of a symbol quotes the single character that follows the
  892. backslash, without conversion.  For example, in a string, `\t'
  893. represents a tab character; in the name of a symbol, however, `\t'
  894. merely quotes the letter `t'.  To have a symbol with a tab character in
  895. its name, you must actually type an tab (preceded with a backslash).
  896. But you would hardly ever do such a thing.
  897.  
  898.      Common Lisp note: in Common Lisp, lower case letters are always
  899.      "folded" to upper case, unless they are explicitly escaped.  This
  900.      is in contrast to Emacs Lisp, in which upper case and lower case
  901.      letters are distinct.
  902.  
  903.    Here are several examples of symbol names.  Note that the `+' in the
  904. fifth example is escaped to prevent it from being read as a number.
  905. This is not necessary in the last example because the rest of the name
  906. makes it invalid as a number.
  907.  
  908.      foo                 ; A symbol named `foo'.
  909.      FOO                 ; A symbol named `FOO', different from `foo'.
  910.      char-to-string      ; A symbol named `char-to-string'.
  911.      1+                  ; A symbol named `1+'
  912.                          ;     (not `+1', which is an integer).
  913.      \+1                 ; A symbol named `+1' (not a very readable name).
  914.      \(*\ 1\ 2\)         ; A symbol named `(* 1 2)' (a worse name).
  915.      +-*/_~!@$%^&=:<>{}  ; A symbol named `+-*/_~!@$%^&=:<>{}'.
  916.                          ;     These characters need not be escaped.
  917.  
  918. 
  919. File: elisp,  Node: Lisp Function Type,  Next: Lisp Macro Type,  Prev: Symbol Type,  Up: Programming Types
  920.  
  921. Lisp Function Type
  922. ------------------
  923.  
  924.    Just as functions in other programming languages are executable, a
  925. "Lisp function" object is a piece of executable code.  However, Lisp
  926. functions are primarily Lisp objects, and only secondarily the text
  927. which represents them.  These Lisp objects are lambda expressions: lists
  928. whose first element is the symbol `lambda' (*note Lambda
  929. Expressions::.).
  930.  
  931.    In most programming languages, it is impossible to have a function
  932. without a name.  In Lisp, a function has no intrinsic name.  A lambda
  933. expression is also called an "anonymous function" (*note Anonymous
  934. Functions::.).  A named function in Lisp is actually a symbol with a
  935. valid function in its function cell (*note Defining Functions::.).
  936.  
  937.    Most of the time, functions are called when their names are written
  938. in Lisp expressions in Lisp programs.  However, a function object found
  939. or constructed at run time can be called and passed arguments with the
  940. primitive functions `funcall' and `apply'.  *Note Calling Functions::.
  941.  
  942. 
  943. File: elisp,  Node: Lisp Macro Type,  Next: Primitive Function Type,  Prev: Lisp Function Type,  Up: Programming Types
  944.  
  945. Lisp Macro Type
  946. ---------------
  947.  
  948.    A "Lisp macro" is a user-defined construct that extends the Lisp
  949. language.  It is represented as an object much like a function, but with
  950. different parameter-passing semantics.  A Lisp macro has the form of a
  951. list whose first element is the symbol `macro' and whose CDR is a Lisp
  952. function object, including the `lambda' symbol.
  953.  
  954.    Lisp macro objects are usually defined with the built-in function
  955. `defmacro', but any list that begins with `macro' is a macro as far as
  956. Emacs is concerned.  *Note Macros::, for an explanation of how to write
  957. a macro.
  958.  
  959. 
  960. File: elisp,  Node: Primitive Function Type,  Next: Autoload Type,  Prev: Lisp Macro Type,  Up: Programming Types
  961.  
  962. Primitive Function Type
  963. -----------------------
  964.  
  965.    A "primitive function" is a function callable from Lisp but written
  966. in the C programming language.  Primitive functions are also called
  967. "subrs" or "built-in functions".  (The word "subr" is derived from
  968. "subroutine".)  Most primitive functions evaluate all their arguments
  969. when they are called.  A primitive function that does not evaluate all
  970. its arguments is called a "special form" (*note Special Forms::.).
  971.  
  972.    It does not matter to the caller of a function whether the function
  973. is primitive.  However, this does matter if you are trying to
  974. substitute a function written in Lisp for a primitive of the same name.
  975.  The reason is that the primitive function may be called directly from
  976. C code.  When the redefined function is called from Lisp, the new
  977. definition will be used; but calls from C code may still use the old
  978. definition.
  979.  
  980.    The term "function" is used to refer to all Emacs functions, whether
  981. written in Lisp or C.  *Note Lisp Function Type::, for information
  982. about the functions written in Lisp.
  983.  
  984.    Primitive functions have no read syntax and print in hash notation
  985. with the name of the subroutine.
  986.  
  987.      (symbol-function 'car)          ; Access the function cell of the symbol.
  988.           => #<subr car>
  989.      (subrp (symbol-function 'car))  ; Is this a primitive function?
  990.           => t                       ; Yes.
  991.  
  992. 
  993. File: elisp,  Node: Autoload Type,  Prev: Primitive Function Type,  Up: Programming Types
  994.  
  995. Autoload Type
  996. -------------
  997.  
  998.    An "autoload object" is a list whose first element is the symbol
  999. `autoload'.  It is stored as the function definition of a symbol to say
  1000. that a file of Lisp code should be loaded when necessary to find the
  1001. true definition of that symbol.  The autoload object contains the name
  1002. of the file, plus some other information about the real definition.
  1003.  
  1004.    After the file has been loaded, the symbol should have a new function
  1005. definition that is not an autoload object.  The new definition is then
  1006. called as if it had been there to begin with.  From the user's point of
  1007. view, the function call works as expected, using the function definition
  1008. in the loaded file.
  1009.  
  1010.    An autoload object is usually created with the function `autoload',
  1011. which stores the object in the function cell of a symbol.  *Note
  1012. Autoload::, for more details.
  1013.  
  1014. 
  1015. File: elisp,  Node: Editing Types,  Next: Type Predicates,  Prev: Programming Types,  Up: Types of Lisp Object
  1016.  
  1017. Editing Types
  1018. =============
  1019.  
  1020.    The types in the previous section are common to many Lisp-like
  1021. languages.  But Emacs Lisp provides several additional data types for
  1022. purposes connected with editing.
  1023.  
  1024. * Menu:
  1025.  
  1026. * Buffer Type::         The basic object of editing.
  1027. * Window Type::         What makes buffers visible.
  1028. * Window Configuration Type::   Save what the screen looks like.
  1029. * Marker Type::         A position in a buffer.
  1030. * Process Type::        A process running on the underlying OS.
  1031. * Stream Type::         Receive or send characters.
  1032. * Keymap Type::         What function a keystroke invokes.
  1033. * Syntax Table Type::   What a character means.
  1034.  
  1035. 
  1036. File: elisp,  Node: Buffer Type,  Next: Window Type,  Prev: Editing Types,  Up: Editing Types
  1037.  
  1038. Buffer Type
  1039. -----------
  1040.  
  1041.    A "buffer" is an object that holds text that can be edited (*note
  1042. Buffers::.).  Most buffers hold the contents of a disk file (*note
  1043. Files::.) so they can be edited, but some are used for other purposes. 
  1044. Most buffers are also meant to be seen by the user, and therefore
  1045. displayed, at some time, in a window (*note Windows::.).  But a buffer
  1046. need not be displayed in a window.
  1047.  
  1048.    The contents of a buffer are much like a string, but buffers are not
  1049. used like strings in Emacs Lisp, and the available operations are
  1050. different.  For example, text can be inserted into a buffer very
  1051. quickly, while "inserting" text into a string is accomplished by
  1052. concatenation and the result is an entirely new string object.
  1053.  
  1054.    Each buffer has a designated position called "point" (*note
  1055. Positions::.).  And one buffer is the "current buffer".  Most editing
  1056. commands act on the contents of the current buffer in the neighborhood
  1057. of point.  Many other functions manipulate or test the characters in
  1058. the current buffer and much of this manual is devoted to describing
  1059. these functions (*note Text::.).
  1060.  
  1061.    Several other data structures are associated with each buffer:
  1062.  
  1063.    * a local syntax table (*note Syntax Tables::.);
  1064.  
  1065.    * a local keymap (*note Keymaps::.); and,
  1066.  
  1067.    * a local variable binding list (*note Variables::.).
  1068.  
  1069. The local keymap and variable list contain entries which individually
  1070. override global bindings or values.  These are used to customize the
  1071. behavior of programs in different buffers, without actually changing the
  1072. programs.
  1073.  
  1074.    Buffers have no read syntax.  They print in hash notation with the
  1075. buffer name.
  1076.  
  1077.      (current-buffer)
  1078.           => #<buffer objects.texi>
  1079.  
  1080. 
  1081. File: elisp,  Node: Window Type,  Next: Window Configuration Type,  Prev: Buffer Type,  Up: Editing Types
  1082.  
  1083. Window Type
  1084. -----------
  1085.  
  1086.    A "window" describes the portion of the terminal screen that Emacs
  1087. uses to display a buffer.  Every window has one associated buffer, whose
  1088. contents appear in the window.  By contrast, a given buffer may appear
  1089. in one window, no window, or several windows.
  1090.  
  1091.    Though many windows may exist simultaneously, one window is
  1092. designated the "selected window".  This is the window where the cursor
  1093. is (usually) displayed when Emacs is ready for a command.  The selected
  1094. window usually displays the current buffer, but this is not necessarily
  1095. the case.
  1096.  
  1097.    Windows have no read syntax.  They print in hash notation, giving the
  1098. window number and the name of the buffer being displayed.  The window
  1099. numbers exist to identify windows uniquely, since the buffer displayed
  1100. in any given window can change frequently.
  1101.  
  1102.      (selected-window)
  1103.           => #<window 1 on objects.texi>
  1104.  
  1105.    *Note Windows::, for a description of the functions that work on
  1106. windows.
  1107.  
  1108. 
  1109. File: elisp,  Node: Window Configuration Type,  Next: Marker Type,  Prev: Window Type,  Up: Editing Types
  1110.  
  1111. Window Configuration Type
  1112. -------------------------
  1113.  
  1114.    A "window configuration" stores information about the positions and
  1115. sizes of windows at the time the window configuration is created, so
  1116. that the screen layout may be recreated later.
  1117.  
  1118.    Window configurations have no read syntax.  They print as
  1119. `#<window-configuration>'.  *Note Window Configurations::, for a
  1120. description of several functions related to window configurations.
  1121.  
  1122. 
  1123. File: elisp,  Node: Marker Type,  Next: Process Type,  Prev: Window Configuration Type,  Up: Editing Types
  1124.  
  1125. Marker Type
  1126. -----------
  1127.  
  1128.    A "marker" denotes a position in a specific buffer.  Markers
  1129. therefore have two components: one for the buffer, and one for the
  1130. position.  The position value is changed automatically as necessary as
  1131. text is inserted into or deleted from the buffer.  This is to ensure
  1132. that the marker always points between the same two characters in the
  1133. buffer.
  1134.  
  1135.    Markers have no read syntax.  They print in hash notation, giving the
  1136. current character position and the name of the buffer.
  1137.  
  1138.      (point-marker)
  1139.           => #<marker at 10779 in objects.texi>
  1140.  
  1141.    *Note Markers::, for information on how to test, create, copy, and
  1142. move markers.
  1143.  
  1144. 
  1145. File: elisp,  Node: Process Type,  Next: Stream Type,  Prev: Marker Type,  Up: Editing Types
  1146.  
  1147. Process Type
  1148. ------------
  1149.  
  1150.    The word "process" means a running program.  Emacs itself runs in a
  1151. process of this sort.  However, in Emacs Lisp, a process is a Lisp
  1152. object that designates a subprocess created by Emacs process.  External
  1153. subprocesses, such as shells, GDB, ftp, and compilers, may be used to
  1154. extend the processing capability of Emacs.
  1155.  
  1156.    A process takes input from Emacs and returns output to Emacs for
  1157. further manipulation.  Both text and signals can be communicated between
  1158. Emacs and a subprocess.
  1159.  
  1160.    Processes have no read syntax.  They print in hash notation, giving
  1161. the name of the process:
  1162.  
  1163.      (process-list)
  1164.           => (#<process shell>)
  1165.  
  1166.    *Note Processes::, for information about functions that create,
  1167. delete, return information about, send input or signals to, and receive
  1168. output from processes.
  1169.  
  1170. 
  1171. File: elisp,  Node: Stream Type,  Next: Keymap Type,  Prev: Process Type,  Up: Editing Types
  1172.  
  1173. Stream Type
  1174. -----------
  1175.  
  1176.    A "stream" is an object that can be used as a source or sink for
  1177. characters--either to supply characters for input or to accept them as
  1178. output.  Many different types can be used this way: markers, buffers,
  1179. strings, and functions.  Most often, input streams (character sources)
  1180. obtain characters from the keyboard, a buffer, or a file, and output
  1181. streams (character sinks) send characters to a buffer, such as a
  1182. `*Help*' buffer, or to the echo area.
  1183.  
  1184.    The object `nil', in addition to its other meanings, may be used as
  1185. a stream.  It stands for the value of the variable `standard-input' or
  1186. `standard-output'.  Also, the object `t' as a stream specifies input
  1187. using the minibuffer (*note Minibuffers::.) or output in the echo area
  1188. (*note The Echo Area::.).
  1189.  
  1190.    Streams have no special printed representation or read syntax, and
  1191. print as whatever primitive type they are.
  1192.  
  1193.    *Note Streams::, for a description of various functions related to
  1194. streams, including various parsing and printing functions.
  1195.  
  1196.