home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / emacs-19.16 / etc / LNEWS < prev    next >
Encoding:
GNU Info File  |  1993-06-07  |  129.8 KB  |  3,169 lines

  1. This is Info file LNEWS, produced by Makeinfo-1.54 from the input file
  2. news.texi.
  3.  
  4. New Features in the Lisp Language
  5. =================================
  6.  
  7.    * The new function `delete' is a traditional Lisp function.  It takes
  8.      two arguments, ELT and LIST, and deletes from LIST any elements
  9.      that are equal to ELT.  It uses the function `equal' to compare
  10.      elements with ELT.
  11.  
  12.    * The new function `member' is a traditional Lisp function.  It takes
  13.      two arguments, ELT and LIST, and finds the first element of LIST
  14.      that is equal to ELT.  It uses the function `equal' to compare
  15.      each list element with ELT.
  16.  
  17.      The value is a sublist of LIST, whose first element is the one
  18.      that was found.  If no matching element is found, the value is
  19.      `nil'.
  20.  
  21.    * The new function `indirect-function' finds the effective function
  22.      definition of an object called as a function.  If the object is a
  23.      symbol, `indirect-function' looks in the function definition of the
  24.      symbol.  It keeps doing this until it finds something that is not a
  25.      symbol.
  26.  
  27.    * There are new escape sequences for use in character and string
  28.      constants.  The escape sequence `\a' is equivalent to `\C-g', the
  29.      ASCII BEL character (code 7).  The escape sequence `\x' followed
  30.      by a hexidecimal number represents the character whose ASCII code
  31.      is that number.  There is no limit on the number of digits in the
  32.      hexidecimal value.
  33.  
  34.    * The function `read' when reading from a buffer now does not skip a
  35.      terminator character that terminates a symbol.  It leaves that
  36.      character to be read (or just skipped, if it is whitespace) next
  37.      time.
  38.  
  39.    * When you use a function FUNCTION as the input stream for `read',
  40.      it is usually called with no arguments, and should return the next
  41.      character.  In Emacs 19, sometimes FUNCTION is called with one
  42.      argument (always a character).  When that happens, FUNCTION should
  43.      save the argument and arrange to return it when called next time.
  44.  
  45.    * `random' with integer argument N returns a random number between 0
  46.      and N-1.
  47.  
  48.    * The functions `documentation' and `documentation-property' now
  49.      take an additional optional argument which, if non-`nil', says to
  50.      refrain from calling `substitute-command-keys'.  This way, you get
  51.      the exact text of the documentation string as written, without the
  52.      usual substitutions.  Make sure to call `substitute-command-keys'
  53.      yourself if you decide to display the string.
  54.  
  55.    * The new function `invocation-name' returns as a string the program
  56.      name that was used to run Emacs, with any directory names
  57.      discarded.
  58.  
  59.    * The new function `map-y-or-n-p' makes it convenient to ask a series
  60.      of similar questions.  The arguments are PROMPTER, ACTOR, LIST,
  61.      and optional HELP.
  62.  
  63.      The value of LIST is a list of objects, or a function of no
  64.      arguments to return either the next object or `nil' meaning there
  65.      are no more.
  66.  
  67.      The argument PROMPTER specifies how to ask each question.  If
  68.      PROMPTER is a string, the question text is computed like this:
  69.  
  70.           (format PROMPTER OBJECT)
  71.  
  72.      where OBJECT is the next object to ask about.
  73.  
  74.      If not a string, PROMPTER should be a function of one argument
  75.      (the next object to ask about) and should return the question text.
  76.  
  77.      The argument ACTOR should be a function of one argument, which is
  78.      called with each object that the user says yes for.  Its argument
  79.      is always one object from LIST.
  80.  
  81.      If HELP is given, it is a list `(OBJECT OBJECTS ACTION)', where
  82.      OBJECT is a string containing a singular noun that describes the
  83.      objects conceptually being acted on; OBJECTS is the corresponding
  84.      plural noun and ACTION is a transitive verb describing ACTOR.  The
  85.      default is `("object" "objects" "act on")'.
  86.  
  87.      Each time a question is asked, the user may enter `y', `Y', or SPC
  88.      to act on that object; `n', `N', or DEL to skip that object; `!'
  89.      to act on all following objects; ESC or `q' to exit (skip all
  90.      following objects); `.' (period) to act on the current object and
  91.      then exit; or `C-h' to get help.
  92.  
  93.      `map-y-or-n-p' returns the number of objects acted on.
  94.  
  95.    * You can now "set" environment variables with the `setenv' command.
  96.      This works by setting the variable `process-environment', which
  97.      `getenv' now examines in preference to the environment Emacs
  98.      received from its parent.
  99.  
  100. New Features for Loading Libraries
  101. ==================================
  102.  
  103.    You can now arrange to run a hook if a particular Lisp library is
  104. loaded.
  105.  
  106.    The variable `after-load-alist' is an alist of expressions to be
  107. evalled when particular files are loaded.  Each element looks like
  108. `(FILENAME FORMS...)'.
  109.  
  110.    When `load' is run and the file name argument equals FILENAME, the
  111. FORMS in the corresponding element are executed at the end of loading.
  112. fILENAME must match exactly!  Normally FILENAME is the name of a
  113. library, with no directory specified, since that is how `load' is
  114. normally called.
  115.  
  116.    An error in FORMS does not undo the load, but does prevent execution
  117. of the rest of the FORMS.
  118.  
  119.    The function `eval-after-load' provides a convenient way to add
  120. entries to the alist.  Call it with two arguments, FILE and a form to
  121. execute.
  122.  
  123.    The function `autoload' now supports autoloading a keymap.  Use
  124. `keymap' as the fourth argument if the autoloaded function will become
  125. a keymap when loaded.
  126.  
  127.    There is a new feature for specifying which functions in a library
  128. should be autoloaded by writing special "magic" comments in that
  129. library itself.
  130.  
  131.    Write `;;;###autoload' on a line by itself before the real
  132. definition of the function, in its autoloadable source file; then the
  133. command `M-x update-file-autoloads' automatically puts the `autoload'
  134. call into `loaddefs.el'.
  135.  
  136.    You can also put other kinds of forms into `loaddefs.el', by writing
  137. `;;;###autoload' followed on the same line by the form.  `M-x
  138. update-file-autoloads' copies the form from that line.
  139.  
  140. Compilation Features
  141. ====================
  142.  
  143.    * Inline functions.
  144.  
  145.      You can define an "inline function" with `defsubst'.  Use
  146.      `defsubst' just like `defun', and it defines a function which you
  147.      can call in all the usual ways.  Whenever the function thus defined
  148.      is used in compiled code, the compiler will open code it.
  149.  
  150.      You can get somewhat the same effects with a macro, but a macro
  151.      has the limitation that you can use it only explicitly; a macro
  152.      cannot be called with `apply', `mapcar' and so on.  Also, it takes
  153.      some work to convert an ordinary function into a macro.  To
  154.      convert it into an inline function, simply replace `defun' with
  155.      `defsubst'.
  156.  
  157.      Making a function inline makes explicit calls run faster.  But it
  158.      also has disadvantages.  For one thing, it reduces flexibility; if
  159.      you change the definition of the function, calls already inlined
  160.      still use the old definition until you recompile them.
  161.  
  162.      Another disadvantage is that making a large function inline can
  163.      increase the size of compiled code both in files and in memory.
  164.      Since the advantages of inline functions are greatest for small
  165.      functions, you generally should not make large functions inline.
  166.  
  167.      Inline functions can be used and open coded later on in the same
  168.      file, following the definition, just like macros.
  169.  
  170.    * The command `byte-compile-file' now offers to save any buffer
  171.      visiting the file you are compiling.
  172.  
  173.    * The new command `compile-defun' reads, compiles and executes the
  174.      defun containing point.  If you use this on a defun that is
  175.      actually a function definition, the effect is to install a
  176.      compiled version of that function.
  177.  
  178.    * Whenever you load a Lisp file or library, you now receive a
  179.      warning if the directory contains both a `.el' file and a `.elc'
  180.      file, and the `.el' file is newer.  This typically indicates that
  181.      someone has updated the Lisp code but forgotten to recompile it,
  182.      so the changes do not take effect.  The warning is a reminder to
  183.      recompile.
  184.  
  185.    * The special form `eval-when-compile' marks the forms it contains to
  186.      be evaluated at compile time *only*.  At top-level, this is
  187.      analogous to the Common Lisp idiom `(eval-when (compile) ...)'.
  188.      Elsewhere, it is similar to the Common Lisp `#.' reader macro (but
  189.      not when interpreting).
  190.  
  191.      If you're thinking of using this feature, we recommend you
  192.      consider whether `provide' and `require' might do the job as well.
  193.  
  194.    * The special form `eval-and-compile' is similar to
  195.      `eval-when-compile', but the whole form is evaluated both at
  196.      compile time and at run time.
  197.  
  198.      If you're thinking of using this feature, we recommend you consider
  199.      whether `provide' and `require' might do the job as well.
  200.  
  201.    * Emacs Lisp has a new data type for byte-code functions.  This makes
  202.      them faster to call, and also saves space.  Internally, a byte-code
  203.      function object is much like a vector; however, the evaluator
  204.      handles this data type specially when it appears as a function to
  205.      be called.
  206.  
  207.      The printed representation for a byte-code function object is like
  208.      that for a vector, except that it starts with `#' before the
  209.      opening `['.  A byte-code function object must have at least four
  210.      elements; there is no maximum number, but only the first six
  211.      elements are actually used.  They are:
  212.  
  213.     ARGLIST
  214.           The list of argument symbols.
  215.  
  216.     BYTE-CODE
  217.           The string containing the byte-code instructions.
  218.  
  219.     CONSTANTS
  220.           The vector of constants referenced by the byte code.
  221.  
  222.     STACKSIZE
  223.           The maximum stack size this function needs.
  224.  
  225.     DOCSTRING
  226.           The documentation string (if any); otherwise, `nil'.
  227.  
  228.     INTERACTIVE
  229.           The interactive spec (if any).  This can be a string or a Lisp
  230.           expression.  It is `nil' for a function that isn't
  231.           interactive.
  232.  
  233.      The predicate `byte-code-function-p' tests whether a given object
  234.      is a byte-code function.
  235.  
  236.      You can create a byte-code function object in a Lisp program with
  237.      the function `make-byte-code'.  Its arguments are the elements to
  238.      put in the byte-code function object.
  239.  
  240.      You should not try to come up with the elements for a byte-code
  241.      function yourself, because if they are inconsistent, Emacs may
  242.      crash when you call the function.  Always leave it to the byte
  243.      compiler to create these objects; it, we hope, always makes the
  244.      elements consistent.
  245.  
  246. Floating Point Numbers
  247. ======================
  248.  
  249.    You can now use floating point numbers in Emacs, if you define the
  250. macro `LISP_FLOAT_TYPE' when you compile Emacs.
  251.  
  252.    The printed representation for floating point numbers requires
  253. either a decimal point surrounded by digits, or an exponent, or both.
  254. For example, `1500.0', `15e2', `15.0e2' and `1.5e3' are four ways of
  255. writing a floating point number whose value is 1500.
  256.  
  257.    The existing predicate `numberp' now returns `t' if the argument is
  258. any kind of number--either integer or floating.  The new predicates
  259. `integerp' and `floatp' check for specific types of numbers.
  260.  
  261.    You can do arithmetic on floating point numbers with the ordinary
  262. arithmetic functions, `+', `-', `*' and `/'.  If you call one of these
  263. functions with both integers and floating point numbers among the
  264. arguments, the arithmetic is done in floating point.  The same applies
  265. to the numeric comparison functions such as `=' and `<'.  The remainder
  266. function `%' does not accept floating point arguments, and neither do
  267. the bitwise boolean operations such as `logand' or the shift functions
  268. such as `ash'.
  269.  
  270.    There is a new arithmetic function, `abs', which returns the absolute
  271. value of its argument.  It handles both integers and floating point
  272. numbers.
  273.  
  274.    To convert an integer to floating point, use the function `float'.
  275. There are four functions to convert floating point numbers to integers;
  276. they differ in how they round.  `truncate' rounds toward 0, `floor'
  277. rounds down, `ceil' rounds up, and `round' produces the nearest integer.
  278.  
  279.    You can use `logb' to extract the binary exponent of a floating
  280. point number.  More precisely, it is the logarithm base 2, rounded down
  281. to an integer.
  282.  
  283.    Emacs has several new mathematical functions that accept any kind of
  284. number as argument, but always return floating point numbers.
  285.  
  286. `cos'
  287. `sin'
  288. `tan'
  289.      Trigonometric functions.
  290.  
  291. `acos'
  292. `asin'
  293. `atan'
  294.      Inverse trigonometric functions.
  295.  
  296. `exp'
  297.      The exponential function (power of E).
  298.  
  299. `log'
  300.      Logarithm base E.
  301.  
  302. `log10'
  303.      Logarithm base 10
  304.  
  305. `expt'
  306.      Raise X to power Y.
  307.  
  308. `sqrt'
  309.      The square root function.
  310.  
  311.    The new function `string-to-number' now parses a string containing
  312. either an integer or a floating point number, returning the number.
  313.  
  314.    The `format' function now handles the specifications `%e', `%f' and
  315. `%g' for printing floating point numbers; likewise `message'.
  316.  
  317.    The new variable `float-output-format' controls how Lisp prints
  318. floating point numbers.  Its value should be `nil' or a string.
  319.  
  320.    If it is a string, it should contain a `%'-spec like those accepted
  321. by `printf' in C, but with some restrictions.  It must start with the
  322. two characters `%.'.  After that comes an integer which is the
  323. precision specification, and then a letter which controls the format.
  324.  
  325.    The letters allowed are `e', `f' and `g'.  Use `e' for exponential
  326. notation (`DIG.DIGITSeEXPT').  Use `f' for decimal point notation
  327. (`DIGITS.DIGITS').  Use `g' to choose the shorter of those two formats
  328. for the number at hand.
  329.  
  330.    The precision in any of these cases is the number of digits following
  331. the decimal point.  With `e', a precision of 0 means to omit the
  332. decimal point.  0 is not allowed with `f' or `g'.
  333.  
  334.    A value of `nil' means to use the format `%.20g'.
  335.  
  336.    No matter what the value of `float-output-format', printing ensures
  337. that the result fits the syntax rules for a floating point number.  If
  338. it doesn't fit (for example, if it looks like an integer), it is
  339. modified to fit.  By contrast, the `format' function formats floating
  340. point numbers without requiring the output to fit the syntax rules for
  341. floating point number.
  342.  
  343. New Features for Printing And Formatting Output
  344. ===============================================
  345.  
  346.    * The `format' function has a new feature: `%S'.  This print spec
  347.      prints any kind of Lisp object, even a string, using its Lisp
  348.      printed representation.
  349.  
  350.      By contrast, `%s' prints everything without quotation.
  351.  
  352.    * `prin1-to-string' now takes an optional second argument which says
  353.      not to print the Lisp quotation characters.  (In other words, to
  354.      use `princ' instead of `prin1'.)
  355.  
  356.    * The new variable `print-level' specifies the maximum depth of list
  357.      nesting to print before cutting off all deeper structure.  A value
  358.      of `nil' means no limit.
  359.  
  360. Changes in Basic Editing Functions
  361. ==================================
  362.  
  363.    * There are two new primitives for putting text in the kill ring:
  364.      `kill-new' and `kill-append'.
  365.  
  366.      The function `kill-new' adds a string to the front of the kill
  367.      ring.
  368.  
  369.      Use `kill-append' to add a string to a previous kill.  The second
  370.      argument BEFORE-P, if non-`nil', says to add the string at the
  371.      beginning; otherwise, it goes at the end.
  372.  
  373.      Both of these functions apply `interprogram-cut-function' to the
  374.      entire string of killed text that ends up at the beginning of the
  375.      kill ring.
  376.  
  377.    * The new function `current-kill' rotates the yanking pointer in the
  378.      kill ring by N places, and returns the text at that place in the
  379.      ring.  If the optional second argument DO-NOT-MOVE is non-`nil',
  380.      it doesn't actually move the yanking point; it just returns the
  381.      Nth kill forward.  If N is zero, indicating a request for the
  382.      latest kill, `current-kill' calls `interprogram-paste-function'
  383.      (documented below) before consulting the kill ring.
  384.  
  385.      All Emacs Lisp programs should either use `current-kill',
  386.      `kill-new', and `kill-append' to manipulate the kill ring, or be
  387.      sure to call `interprogram-paste-function' and
  388.      `interprogram-cut-function' as appropriate.
  389.  
  390.    * The variables `interprogram-paste-function' and
  391.      `interprogram-cut-function' exist so that you can provide functions
  392.      to transfer killed text to and from other programs.
  393.  
  394.    * The `kill-region' function can now be used in read-only buffers.
  395.      It beeps, but adds the region to the kill ring without deleting it.
  396.  
  397.    * The new function `compare-buffer-substrings' lets you compare two
  398.      substrings of the same buffer or two different buffers.  Its
  399.      arguments look like this:
  400.  
  401.           (compare-buffer-substrings BUF1 BEG1 END1 BUF2 BEG2 END2)
  402.  
  403.      The first three arguments specify one substring, giving a buffer
  404.      and two positions within the buffer.  The last three arguments
  405.      specify the other substring in the same way.
  406.  
  407.      The value is negative if the first substring is less, positive if
  408.      the first is greater, and zero if they are equal.  The absolute
  409.      value of the result is one plus the index of the first different
  410.      characters.
  411.  
  412.    * Overwrite mode treats tab and newline characters specially.  You
  413.      can now turn off this special treatment by setting
  414.      `overwrite-binary-mode' to `t'.
  415.  
  416.    * Once the mark "exists" in a buffer, it normally never ceases to
  417.      exist.  However, in Transient Mark mode, it may become "inactive".
  418.      The variable `mark-active', which is always local in all buffers,
  419.      indicates whether the mark is active: non-`nil' means yes.
  420.  
  421.      When the mark is inactive, the function `mark' normally gets an
  422.      error.  However, `(mark t)' returns the position of the inactive
  423.      mark.
  424.  
  425.      The function `push-mark' normally does not activate the mark.
  426.      However, it accepts an optional third argument ACTIVATE which, if
  427.      non-`nil', says to activate.
  428.  
  429.      A command can request deactivation of the mark upon return to the
  430.      editor command loop by setting `deactivate-mark' to a non-`nil'
  431.      value.  Transient Mark mode works by causing the command loop to
  432.      take note of `deactivate-mark' and actually deactivate the mark.
  433.  
  434.      Transient Mark mode enables highlighting of the region when the
  435.      mark is active.  This is currently implemented only under the X
  436.      Window System.  A few other commands vary their behavior slightly
  437.      in this case, by testing `transient-mark-mode'.  More
  438.      specifically, they avoid special display actions such as moving
  439.      the cursor temporarily, which are not needed when the region is
  440.      shown by highlighting.
  441.  
  442.      The variables `activate-mark-hook' and `deactivate-mark-hook' are
  443.      normal hooks run, respectively, when the mark becomes active and
  444.      when it becomes inactive.  The hook `activate-mark-hook' is also
  445.      run at the end of a command if the mark is active and the region
  446.      may have changed.
  447.  
  448.    * The function `move-to-column' now accepts a second optional
  449.      argument FORCE, in addition to COLUMN; if the requested column
  450.      COLUMN is in the middle of a tab character and FORCE is non-`nil',
  451.      `move-to-column' replaces the tab with the appropriate sequence of
  452.      spaces so that it can place point exactly at COLUMN.
  453.  
  454.    * The search functions when successful now return the value of point
  455.      rather than just `t'.  This affects the functions
  456.      `search-forward', `search-backward', `word-search-forward',
  457.      `word-search-backward', `re-search-forward', and
  458.      `re-search-backward'.
  459.  
  460.    * When you do regular expression searching or matching, there is no
  461.      longer a limit to how many `\(...\)' pairs you can get information
  462.      about with `match-beginning' and `match-end'.  Also, these
  463.      parenthetical groupings may now be nested to any degree.
  464.  
  465.    * In a regular expression, when you use an asterisk after a
  466.      parenthetical grouping, and then ask about what range was matched
  467.      by the grouping, Emacs 19 reports just its last occurrence.  Emacs
  468.      18 used to report the range of all the repetitions put together.
  469.  
  470.      For example,
  471.  
  472.           (progn
  473.            (string-match "f\\(o\\)*" "foo")
  474.            (list (match-beginning 1)
  475.                  (match-end 1)))
  476.  
  477.      returns `(2 3)' in Emacs 19, corresponding to just the last
  478.      repetition of `\(o\)'.  In Emacs 18, that expression returns `(1
  479.      3)', encompassing both repetitions.
  480.  
  481.      If you want the Emacs 18 behavior, use a grouping *containing* the
  482.      asterisk: `"f\\(o*\\)"'.
  483.  
  484.    * The new special form `save-match-data' preserves the regular
  485.      expression match status.  Usage: `(save-match-data BODY...)'.
  486.  
  487.    * The function `translate-region' applies a translation table to the
  488.      characters in a part of the buffer.  Invoke it as
  489.      `(translate-region START END TABLE)'; START and END bound the
  490.      region to translate.
  491.  
  492.      The translation table TABLE is a string; `(aref TABLE OCHAR)'
  493.      gives the translated character corresponding to OCHAR.  If the
  494.      length of TABLE is less than 256, any characters with codes larger
  495.      than the length of TABLE are not altered by the translation.
  496.  
  497.      `translate-region' returns the number of characters which were
  498.      actually changed by the translation.  This does not count
  499.      characters which were mapped into themselves in the translation
  500.      table.
  501.  
  502.    * There are two new hook variables that let you notice all changes
  503.      in all buffers (or in a particular buffer, if you make them
  504.      buffer-local): `before-change-function' and
  505.      `after-change-function'.
  506.  
  507.      If `before-change-function' is non-`nil', then it is called before
  508.      any buffer modification.  Its arguments are the beginning and end
  509.      of the region that is going to change, represented as integers.
  510.      The buffer that's about to change is always the current buffer.
  511.  
  512.      If `after-change-function' is non-`nil', then it is called after
  513.      any buffer modification.  It takes three arguments: the beginning
  514.      and end of the region just changed, and the length of the text that
  515.      existed before the change.  (To get the current length, subtract
  516.      the region beginning from the region end.)  All three arguments are
  517.      integers.  The buffer that has just changed is always the current
  518.      buffer.
  519.  
  520.      Both of these variables are temporarily bound to `nil' during the
  521.      time that either of these hooks is running.  This means that if
  522.      one of these functions changes the buffer, that change won't run
  523.      these functions.  If you do want hooks to be run recursively,
  524.      write your hook functions to bind these variables back to their
  525.      usual values.
  526.  
  527.    * The hook `first-change-hook' is run using `run-hooks' whenever a
  528.      buffer is changed that was previously in the unmodified state.
  529.  
  530.    * The second argument to `insert-abbrev-table-description' is now
  531.      optional.
  532.  
  533. Text Properties
  534. ===============
  535.  
  536.    Each character in a buffer or a string can have a "text property
  537. list", much like the property list of a symbol.  The properties belong
  538. to a particular character at a particular place, such as, the letter
  539. `T' at the beginning of this sentence.  Each property has a name, which
  540. is usually a symbol, and an associated value, which can be any Lisp
  541. object--just as for properties of symbols.
  542.  
  543.    You can use the property `face' to control the font and color of
  544. text.  Several other property names have special meanings.  You can
  545. create properties of any name and examine them later for your own
  546. purposes.
  547.  
  548.    Copying text between strings and buffers preserves the properties
  549. along with the characters; this includes such diverse functions as
  550. `substring', `insert', and `buffer-substring'.
  551.  
  552.    Since text properties are considered part of the buffer contents,
  553. changing properties in a buffer "modifies" the buffer, and you can also
  554. undo such changes.
  555.  
  556.    Strings with text properties have a special printed representation
  557. which describes all the properties.  This representation is also the
  558. read syntax for such a string.  It looks like this:
  559.  
  560.      #("CHARACTERS" PROPERTY-DATA...)
  561.  
  562. where PROPERTY-DATA is zero or more elements in groups of three as
  563. follows:
  564.  
  565.      BEG END PLIST
  566.  
  567. The elements BEG and END are integers, and together specify a portion
  568. of the string; PLIST is the property list for that portion.
  569.  
  570. Examining Text Properties
  571. -------------------------
  572.  
  573.    The simplest way to examine text properties is to ask for the value
  574. of a particular property of a particular character.  For that, use
  575. `get-text-property'.  Use `text-properties-at' to get the entire
  576. property list of a character.
  577.  
  578.    `(get-text-property POS PROP OBJECT)' returns the PROP property of
  579. the character after POS in OBJECT (a buffer or string).  The argument
  580. OBJECT is optional and defaults to the current buffer.
  581.  
  582.    `(text-properties-at POS OBJECT)' returns the entire property list
  583. of the character after POS in the string or buffer OBJECT (which
  584. defaults to the current buffer).
  585.  
  586. Changing Text Properties
  587. ------------------------
  588.  
  589.    There are four primitives for changing properties of a specified
  590. range of text:
  591.  
  592. `add-text-properties'
  593.      This function puts on specified properties, leaving other existing
  594.      properties unaltered.
  595.  
  596. `put-text-property'
  597.      This function puts on a single specified property, leaving others
  598.      unaltered.
  599.  
  600. `remove-text-properties'
  601.      This function removes specified properties, leaving other
  602.      properties unaltered.
  603.  
  604. `set-text-properties'
  605.      This function replaces the entire property list, leaving no
  606.      vestige of the properties that that text used to have.
  607.  
  608.    All these functions take four arguments: START, END, PROPS, and
  609. OBJECT.  The last argument is optional and defaults to the current
  610. buffer.  The argument PROPS has the form of a property list.
  611.  
  612. Property Search Functions
  613. -------------------------
  614.  
  615.    In typical use of text properties, most of the time several or many
  616. consecutive characters have the same value for a property.  Rather than
  617. writing your programs to examine characters one by one, it is much
  618. faster to process chunks of text that have the same property value.
  619.  
  620.    The functions `next-property-change' and `previous-property-change'
  621. scan forward or backward from position POS in OBJECT, looking for a
  622. change in any property between two characters scanned.  They returns
  623. the position between those two characters, or `nil' if no change is
  624. found.
  625.  
  626.    The functions `next-single-property-change' and
  627. `previous-single-property-change' are similar except that you specify a
  628. particular property and they look for changes in the value of that
  629. property only.  The property is the second argument, and OBJECT is
  630. third.
  631.  
  632. Special Properties
  633. ------------------
  634.  
  635.    If a character has a `category' property, we call it the "category"
  636. of the character.  It should be a symbol.  The properties of the symbol
  637. serve as defaults for the properties of the character.
  638.  
  639.    You can use the property `face' to control the font and color of
  640. text.
  641.  
  642.    You can specify a different keymap for a portion of the text by means
  643. of a `local-map' property.  The property's value, for the character
  644. after point, replaces the buffer's local map.
  645.  
  646.    If a character has the property `read-only', then modifying that
  647. character is not allowed.  Any command that would do so gets an error.
  648.  
  649.    If a character has the property `modification-hooks', then its value
  650. should be a list of functions; modifying that character calls all of
  651. those functions.  Each function receives two arguments: the beginning
  652. and end of the part of the buffer being modified.  Note that if a
  653. particular modification hook function appears on several characters
  654. being modified by a single primitive, you can't predict how many times
  655. the function will be called.
  656.  
  657.    Insertion of text does not, strictly speaking, change any existing
  658. character, so there is a special rule for insertion.  It compares the
  659. `read-only' properties of the two surrounding characters; if they are
  660. `eq', then the insertion is not allowed.  Assuming insertion is
  661. allowed, it then gets the `modification-hooks' properties of those
  662. characters and calls all the functions in each of them.  (If a function
  663. appears on both characters, it may be called once or twice.)
  664.  
  665.    The special properties `point-entered' and `point-left' record hook
  666. functions that report motion of point.  Each time point moves, Emacs
  667. compares these two property values:
  668.  
  669.    * the `point-left' property of the character after the old location,
  670.      and
  671.  
  672.    * the `point-entered' property of the character after the new
  673.      location.
  674.  
  675. If these two values differ, each of them is called (if not `nil') with
  676. two arguments: the old value of point, and the new one.
  677.  
  678.    The same comparison is made for the characters before the old and new
  679. locations.  The result may be to execute two `point-left' functions
  680. (which may be the same function) and/or two `point-entered' functions
  681. (which may be the same function).  The `point-left' functions are
  682. always called before the `point-entered' functions.
  683.  
  684.    A primitive function may examine characters at various positions
  685. without moving point to those positions.  Only an actual change in the
  686. value of point runs these hook functions.
  687.  
  688. New Features for Files
  689. ======================
  690.  
  691.    * The new function `file-accessible-directory-p' tells you whether
  692.      you can open files in a particular directory.  Specify as an
  693.      argument either a directory name or a file name which names a
  694.      directory file.  The function returns `t' if you can open existing
  695.      files in that directory.
  696.  
  697.    * The new function `file-executable-p' returns `t' if its argument
  698.      is the name of a file you have permission to execute.
  699.  
  700.    * The function `file-truename' returns the "true name" of a
  701.      specified file.  This is the name that you get by following
  702.      symbolic links until none remain.  The argument must be an
  703.      absolute file name.
  704.  
  705.    * New functions `make-directory' and `delete-directory' create and
  706.      delete directories.  They both take one argument, which is the
  707.      name of the directory as a file.
  708.  
  709.    * The function `read-file-name' now takes an additional argument
  710.      which specifies an initial file name.  If you specify this
  711.      argument, `read-file-name' inserts it along with the directory
  712.      name.  It puts the cursor between the directory and the initial
  713.      file name.
  714.  
  715.      The user can then use the initial file name unchanged, modify it,
  716.      or simply kill it with `C-k'.
  717.  
  718.      If the variable `insert-default-directory' is `nil', then the
  719.      default directory is not inserted, and the new argument is ignored.
  720.  
  721.    * The function `file-relative-name' does the inverse of
  722.      expansion--it tries to return a relative name which is equivalent
  723.      to FILENAME when interpreted relative to DIRECTORY.  (If such a
  724.      relative name would be longer than the absolute name, it returns
  725.      the absolute name instead.)
  726.  
  727.    * The function `file-newest-backup' returns the name of the most
  728.      recent backup file for FILENAME, or `nil' that file has no backup
  729.      files.
  730.  
  731.    * The list returned by `file-attributes' now has 12 elements.  The
  732.      12th element is the file system number of the file system that the
  733.      file is in.  This element together with the file's inode number,
  734.      which is the 11th element, give enough information to distinguish
  735.      any two files on the system--no two files can have the same values
  736.      for both of these numbers.
  737.  
  738.    * The new function `set-visited-file-modtime' updates the current
  739.      buffer's recorded modification time from the visited file's time.
  740.  
  741.      This is useful if the buffer was not read from the file normally,
  742.      or if the file itself has been changed for some known benign
  743.      reason.
  744.  
  745.      If you give the function an argument, that argument specifies the
  746.      new value for the recorded modification time.  The argument should
  747.      be a list of the form `(HIGH . LOW)' or `(HIGH LOW)' containing
  748.      two integers, each of which holds 16 bits of the time.  (This is
  749.      the same format that `file-attributes' uses to return time values.)
  750.  
  751.      The new function `visited-file-modtime' returns the recorded last
  752.      modification time, in that same format.
  753.  
  754.    * The function `directory-files' now takes an optional fourth
  755.      argument which, if non-`nil', inhibits sorting the file names.
  756.      Use this if you want the utmost possible speed and don't care what
  757.      order the files are processed in.
  758.  
  759.      If the order of processing is at all visible to the user, then the
  760.      user will probably be happier if you do sort the names.
  761.  
  762.    * The variable `directory-abbrev-alist' contains an alist of
  763.      abbreviations to use for file directories.  Each element has the
  764.      form `(FROM . TO)', and says to replace FROM with TO when it
  765.      appears in a directory name.  This replacement is done when
  766.      setting up the default directory of a newly visited file.  The
  767.      FROM string is actually a regular expression; it should always
  768.      start with `^'.
  769.  
  770.      You can set this variable in `site-init.el' to describe the
  771.      abbreviations appropriate for your site.
  772.  
  773.    * The function `abbreviate-file-name' applies abbreviations from
  774.      `directory-abbrev-alist' to its argument, and substitutes `~' for
  775.      the user's home directory.
  776.  
  777.      Abbreviated directory names are useful for directories that are
  778.      normally accessed through symbolic links.  If you think of the
  779.      link's name as "the name" of the directory, you can define it as
  780.      an abbreviation for the directory's official name; then ordinarily
  781.      Emacs will call that directory by the link name you normally use.
  782.  
  783.    * `write-region' can write a given string instead of text from the
  784.      buffer.  Use the string as the first argument (in place of the
  785.      starting character position).
  786.  
  787.      You can supply a second file name as the fifth argument (VISIT).
  788.      Use this to write the data to one file (the first argument,
  789.      FILENAME) while nominally visiting a different file (the fifth
  790.      argument, VISIT).  The argument VISIT is used in the echo area
  791.      message and also for file locking; VISIT is stored in
  792.      `buffer-file-name'.
  793.  
  794.    * The value of `write-file-hooks' does not change when you switch to
  795.      a new major mode.  The intention is that these hooks have to do
  796.      with where the file came from, and not with what it contains.
  797.  
  798.    * There is a new hook variable for saving files:
  799.      `write-contents-hooks'.  It works just like `write-file-hooks'
  800.      except that switching to a new major mode clears it back to `nil'.
  801.      Major modes should use this hook variable rather than
  802.      `write-file-hooks'.
  803.  
  804.    * The hook `after-save-hook' runs just after a buffer has been saved
  805.      in its visited file.
  806.  
  807.    * The new function `set-default-file-modes' sets the file protection
  808.      for new files created with Emacs.  The argument must be an
  809.      integer.  (It would be better to permit symbolic arguments like
  810.      the `chmod' program, but that would take more work than this
  811.      function merits.)
  812.  
  813.      Use the new function `default-file-modes' to read the current
  814.      default file mode.
  815.  
  816.    * Call the new function `unix-sync' to force all pending disk output
  817.      to happen as soon as possible.
  818.  
  819. Making Certain File Names "Magic"
  820. =================================
  821.  
  822.    You can implement special handling for a class of file names.  You
  823. must supply a regular expression to define the class of names (all those
  824. which match the regular expression), plus a handler that implements all
  825. the primitive Emacs file operations for file names that do match.
  826.  
  827.    The value of `file-name-handler-alist' is a list of handlers,
  828. together with regular expressions that decide when to apply each
  829. handler.  Each element has the form `(REGEXP . HANDLER)'.  If a file
  830. name matches REGEXP, then all work on that file is done by calling
  831. HANDLER.
  832.  
  833.    All the Emacs primitives for file access and file name transformation
  834. check the given file name against `file-name-handler-alist', and call
  835. HANDLER to do the work if appropriate.  The first argument given to
  836. HANDLER is the name of the primitive; the remaining arguments are the
  837. arguments that were passed to that primitive.  (The first of these
  838. arguments is typically the file name itself.)  For example, if you do
  839. this:
  840.  
  841.      (file-exists-p FILENAME)
  842.  
  843. and FILENAME has handler HANDLER, then HANDLER is called like this:
  844.  
  845.      (funcall HANDLER 'file-exists-p FILENAME)
  846.  
  847.    Here are the primitives that you can handle in this way:
  848.  
  849.      `add-name-to-file', `copy-file', `delete-directory',
  850.      `delete-file', `directory-file-name', `directory-files',
  851.      `dired-compress-file', `dired-uncache', `expand-file-name',
  852.      `file-accessible-directory-p', `file-attributes',
  853.      `file-directory-p', `file-executable-p', `file-exists-p',
  854.      `file-local-copy', `file-modes', `file-name-all-completions',
  855.      `file-name-as-directory', `file-name-completion',
  856.      `file-name-directory', `file-name-nondirectory',
  857.      `file-name-sans-versions', `file-newer-than-file-p',
  858.      `file-readable-p', `file-symlink-p', `file-writable-p',
  859.      `insert-directory', `insert-file-contents', `load',
  860.      `make-directory', `make-symbolic-link', `rename-file',
  861.      `set-file-modes', `set-visited-file-modtime',
  862.      `unhandled-file-name-directory', `verify-visited-file-modtime',
  863.      `write-region'.
  864.  
  865.    The handler function must handle all of the above operations, and
  866. possibly others to be added in the future.  Therefore, it should always
  867. reinvoke the ordinary Lisp primitive when it receives an operation it
  868. does not recognize.  Here's one way to do this:
  869.  
  870.      (defun my-file-handler (operation &rest args)
  871.        ;; First check for the specific operations
  872.        ;; that we have special handling for.
  873.        (cond ((eq operation 'insert-file-contents) ...)
  874.              ((eq operation 'write-region) ...)
  875.              ...
  876.              ;; Handle any operation we don't know about.
  877.              (t (let (file-name-handler-alist)
  878.                   (apply operation args)))))
  879.  
  880.    The function `file-local-copy' copies file FILENAME to the local
  881. site, if it isn't there already.  If FILENAME specifies a "magic" file
  882. name which programs outside Emacs cannot directly read or write, this
  883. copies the contents to an ordinary file and returns that file's name.
  884.  
  885.    If FILENAME is an ordinary file name, not magic, then this function
  886. does nothing and returns `nil'.
  887.  
  888.    The function `unhandled-file-name-directory' is used to get a
  889. non-magic directory name from an arbitrary file name.  It uses the
  890. directory part of the specified file name if that is not magic.
  891. Otherwise, it asks the file name's handler what to do.
  892.  
  893. Frames
  894. ======
  895.  
  896.    Emacs now supports multiple X windows via a new data type known as a
  897. "frame".
  898.  
  899.    A frame is a rectangle on the screen that contains one or more Emacs
  900. windows.  Subdividing a frame works just like subdividing the screen in
  901. earlier versions of Emacs.
  902.  
  903.    There are two kinds of frames: terminal frames and X window frames.
  904. Emacs creates one terminal frame when it starts up with no X display; it
  905. uses Termcap or Terminfo to display using characters.  There is no way
  906. to create another terminal frame after startup.  If Emacs has an X
  907. display, it does not make a terminal frame, and there is none.
  908.  
  909.    When you are using X windows, Emacs starts out with a single X window
  910. frame.  You can create any number of X window frames using `make-frame'.
  911.  
  912.    Use the predicate `framep' to determine whether a given Lisp object
  913. is a frame.
  914.  
  915.    The function `redraw-frame' redisplays the entire contents of a
  916. given frame.
  917.  
  918. Creating and Deleting Frames
  919. ----------------------------
  920.  
  921.    Use `make-frame' to create a new frame.  This is the only primitive
  922. for creating frames.  In principle it could work under any window system
  923. which Emacs understands; the only one we support is X.
  924.  
  925.    `make-frame' takes just one argument, which is an alist specifying
  926. frame parameters.  Any parameters not mentioned in the argument alist
  927. default based on the value of `default-frame-alist'; parameters not
  928. specified there default from the standard X defaults file and X
  929. resources.
  930.  
  931.    When you invoke Emacs, if you specify arguments for window appearance
  932. and so forth, these go into `default-frame-alist' and that is how they
  933. have their effect.
  934.  
  935.    You can specify the parameters for the initial startup X window
  936. frame by setting `initial-frame-alist' in your `.emacs' file.  If these
  937. parameters specify a separate minibuffer-only frame, and you have not
  938. created one, Emacs creates one for you, using the parameter values
  939. specified in `minibuffer-frame-alist'.
  940.  
  941.    You can specify the size and position of a frame using the frame
  942. parameters `left', `top', `height' and `width'.  You must specify
  943. either both size parameters or neither.  You must specify either both
  944. position parameters or neither.  The geometry parameters that you don't
  945. specify are chosen by the window manager in its usual fashion.
  946.  
  947.    The function `x-parse-geometry' converts a standard X-style geometry
  948. string to an alist which you can use as part of the argument to
  949. `make-frame'.
  950.  
  951.    Use the function `delete-frame' to eliminate a frame.  Frames are
  952. like buffers where deletion is concerned; a frame actually continues to
  953. exist as a Lisp object until it is deleted *and* there are no
  954. references to it, but once it is deleted, it has no further effect on
  955. the screen.
  956.  
  957.    The function `frame-live-p' returns non-`nil' if the argument (a
  958. frame) has not been deleted.
  959.  
  960. Finding All Frames
  961. ------------------
  962.  
  963.    The function `frame-list' returns a list of all the frames that have
  964. not been deleted.  It is analogous to `buffer-list'.  The list that you
  965. get is newly created, so modifying the list doesn't have any effect on
  966. the internals of Emacs.  The function `visible-frame-list' returns the
  967. list of just the frames that are visible.
  968.  
  969.    `next-frame' lets you cycle conveniently through all the frames from
  970. an arbitrary starting point.  Its first argument is a frame.  Its second
  971. argument MINIBUF says what to do about minibuffers:
  972.  
  973. `nil'
  974.      Exclude minibuffer-only frames.
  975.  
  976. a window
  977.      Consider only the frames using that particular window as their
  978.      minibuffer.
  979.  
  980. anything else
  981.      Consider all frames.
  982.  
  983. Frames and Windows
  984. ------------------
  985.  
  986.    All the non-minibuffer windows in a frame are arranged in a tree of
  987. subdivisions; the root of this tree is available via the function
  988. `frame-root-window'.  Each window is part of one and only one frame;
  989. you can get the frame with `window-frame'.
  990.  
  991.    At any time, exactly one window on any frame is "selected within the
  992. frame".  You can get the frame's current selected window with
  993. `frame-selected-window'.  The significance of this designation is that
  994. selecting the frame selects for Emacs as a whole the window currently
  995. selected within that frame.
  996.  
  997.    Conversely, selecting a window for Emacs with `select-window' also
  998. makes that window selected within its frame.
  999.  
  1000. Frame Visibility
  1001. ----------------
  1002.  
  1003.    A frame may be "visible", "invisible", or "iconified".  If it is
  1004. invisible, it doesn't show in the screen, not even as an icon.  You can
  1005. set the visibility status of a frame with `make-frame-visible',
  1006. `make-frame-invisible', and `iconify-frame'.  You can examine the
  1007. visibility status with `frame-visible-p'--it returns `t' for a visible
  1008. frame, `nil' for an invisible frame, and `icon' for an iconified frame.
  1009.  
  1010. Selected Frame
  1011. --------------
  1012.  
  1013.    At any time, one frame in Emacs is the "selected frame".  The
  1014. selected window always resides on the selected frame.
  1015.  
  1016.  - Function: selected-frame
  1017.      This function returns the selected frame.
  1018.  
  1019.    The X server normally directs keyboard input to the X window that the
  1020. mouse is in.  Some window managers use mouse clicks or keyboard events
  1021. to "shift the focus" to various X windows, overriding the normal
  1022. behavior of the server.
  1023.  
  1024.    Lisp programs can switch frames "temporarily" by calling the function
  1025. `select-frame'.  This does not override the window manager; rather, it
  1026. escapes from the window manager's control until that control is somehow
  1027. reasserted.  The function takes one argument, a frame, and selects that
  1028. frame.  The selection lasts until the next time the user does something
  1029. to select a different frame, or until the next time this function is
  1030. called.
  1031.  
  1032.    Emacs cooperates with the X server and the window managers by
  1033. arranging to select frames according to what the server and window
  1034. manager ask for.  It does so by generating a special kind of input
  1035. event, called a "focus" event.  The command loop handles a focus event
  1036. by calling `internal-select-frame'.
  1037.  
  1038. Frame Size and Position
  1039. -----------------------
  1040.  
  1041.    The new functions `frame-height' and `frame-width' return the height
  1042. and width of a specified frame (or of the selected frame), measured in
  1043. characters.
  1044.  
  1045.    The new functions `frame-pixel-height' and `frame-pixel-width'
  1046. return the height and width of a specified frame (or of the selected
  1047. frame), measured in pixels.
  1048.  
  1049.    The new functions `frame-char-height' and `frame-char-width' return
  1050. the height and width of a character in a specified frame (or in the
  1051. selected frame), measured in pixels.
  1052.  
  1053.    `set-frame-size' sets the size of a frame, measured in characters;
  1054. its arguments are FRAME, COLS and ROWS.  To set the size with values
  1055. measured in pixels, you can use `modify-frame-parameters'.
  1056.  
  1057.    The function `set-frame-position' sets the position of the top left
  1058. corner of a frame.  Its arguments are FRAME, LEFT and TOP.
  1059.  
  1060. Frame Parameters
  1061. ----------------
  1062.  
  1063.    A frame has many parameters that affect how it displays.  Use the
  1064. function `frame-parameters' to get an alist of all the parameters of a
  1065. given frame.  To alter parameters, use `modify-frame-parameters', which
  1066. takes two arguments: the frame to modify, and an alist of parameters to
  1067. change and their new values.  Each element of ALIST has the form `(PARM
  1068. . VALUE)', where PARM is a symbol.  Parameters that aren't meaningful
  1069. are ignored.  If you don't mention a parameter in ALIST, its value
  1070. doesn't change.
  1071.  
  1072.    Just what parameters a frame has depends on what display mechanism it
  1073. uses.  Here is a table of the parameters of an X window frame:
  1074.  
  1075. `name'
  1076.      The name of the frame.
  1077.  
  1078. `left'
  1079.      The screen position of the left edge.
  1080.  
  1081. `top'
  1082.      The screen position of the top edge.
  1083.  
  1084. `height'
  1085.      The height of the frame contents, in pixels.
  1086.  
  1087. `width'
  1088.      The width of the frame contents, in pixels.
  1089.  
  1090. `window-id'
  1091.      The number of the X window for the frame.
  1092.  
  1093. `minibuffer'
  1094.      Whether this frame has its own minibuffer.  `t' means yes, `none'
  1095.      means no, `only' means this frame is just a minibuffer, a
  1096.      minibuffer window (in some other frame) means the new frame uses
  1097.      that minibuffer.
  1098.  
  1099. `font'
  1100.      The name of the font for the text.
  1101.  
  1102. `foreground-color'
  1103.      The color to use for the inside of a character.  Use strings to
  1104.      designate colors; the X server defines the meaningful color names.
  1105.  
  1106. `background-color'
  1107.      The color to use for the background of text.
  1108.  
  1109. `mouse-color'
  1110.      The color for the mouse cursor.
  1111.  
  1112. `cursor-color'
  1113.      The color for the cursor that shows point.
  1114.  
  1115. `border-color'
  1116.      The color for the border of the frame.
  1117.  
  1118. `cursor-type'
  1119.      The way to display the cursor.  There are two legitimate values:
  1120.      `bar' and `box'.  The value `bar' specifies a vertical bar between
  1121.      characters as the cursor.  The value `box' specifies an ordinary
  1122.      black box overlaying the character after point; that is the
  1123.      default.
  1124.  
  1125. `icon-type'
  1126.      Non-`nil' for a bitmap icon, `nil' for a text icon.
  1127.  
  1128. `border-width'
  1129.      The width in pixels of the window border.
  1130.  
  1131. `internal-border-width'
  1132.      The distance in pixels between text and border.
  1133.  
  1134. `auto-raise'
  1135.      Non-`nil' means selecting the frame raises it.
  1136.  
  1137. `auto-lower'
  1138.      Non-`nil' means deselecting the frame lowers it.
  1139.  
  1140. `vertical-scroll-bars'
  1141.      Non-`nil' gives the frame a scroll bar for vertical scrolling.
  1142.  
  1143. Minibufferless Frames
  1144. ---------------------
  1145.  
  1146.    Normally, each frame has its own minibuffer window at the bottom,
  1147. which is used whenever that frame is selected.  However, you can also
  1148. create frames with no minibuffers.  These frames must use the
  1149. minibuffer window of some other frame.
  1150.  
  1151.    The variable `default-minibuffer-frame' specifies where to find a
  1152. minibuffer for frames created without minibuffers of their own.  Its
  1153. value should be a frame which does have a minibuffer.
  1154.  
  1155.    You can also specify a minibuffer window explicitly when you create a
  1156. frame; then `default-minibuffer-frame' is not used.
  1157.  
  1158. X Window System Features
  1159. ========================
  1160.  
  1161.    * The new functions `mouse-position' and `set-mouse-position' give
  1162.      access to the current position of the mouse.
  1163.  
  1164.      `mouse-position' returns a description of the position of the
  1165.      mouse.  The value looks like `(FRAME X . Y)', where X and Y are
  1166.      measured in pixels relative to the top left corner of the inside
  1167.      of FRAME.
  1168.  
  1169.      `set-mouse-position' takes three arguments, FRAME, X and Y, and
  1170.      warps the mouse cursor to that location on the screen.
  1171.  
  1172.    * `track-mouse' is a new special form for tracking mouse motion.
  1173.      Use it in definitions of mouse clicks that want pay to attention to
  1174.      the motion of the mouse, not just where the buttons are pressed and
  1175.      released.  Here is how to use it:
  1176.  
  1177.           (track-mouse BODY...)
  1178.  
  1179.      While BODY executes, mouse motion generates input events just as
  1180.      mouse clicks do.  BODY can read them with `read-event' or
  1181.      `read-key-sequence'.
  1182.  
  1183.      `track-mouse' returns the value of the last form in BODY.
  1184.  
  1185.      The format of these events is described under "New Input Event
  1186.      Formats."
  1187.  
  1188.    * `x-set-selection' sets a "selection" in the X server.  It takes
  1189.      two arguments: a selection type TYPE, and the value to assign to
  1190.      it, DATA.  If DATA is `nil', it means to clear out the selection.
  1191.      Otherwise, DATA may be a string, a symbol, an integer (or a cons
  1192.      of two integers or list of two integers), or a cons of two markers
  1193.      pointing to the same buffer.  In the last case, the selection is
  1194.      considered to be the text between the markers.  The data may also
  1195.      be a vector of valid non-vector selection values.
  1196.  
  1197.      Each possible TYPE has its own selection value, which changes
  1198.      independently.  The usual values of TYPE are `PRIMARY' and
  1199.      `SECONDARY'; these are symbols with upper-case names, in accord
  1200.      with X protocol conventions.  The default is `PRIMARY'.
  1201.  
  1202.      To get the value of the selection, call `x-get-selection'.  This
  1203.      function accesses selections set up by Emacs and those set up by
  1204.      other X clients.  It takes two optional arguments, TYPE and
  1205.      DATA-TYPE.  The default for TYPE is `PRIMARY'.
  1206.  
  1207.      The DATA-TYPE argument specifies the form of data conversion to
  1208.      use; meaningful values include `TEXT', `STRING', `TARGETS',
  1209.      `LENGTH', `DELETE', `FILE_NAME', `CHARACTER_POSITION',
  1210.      `LINE_NUMBER', `COLUMN_NUMBER', `OWNER_OS', `HOST_NAME', `USER',
  1211.      `CLASS', `NAME', `ATOM', and `INTEGER'.  (These are symbols with
  1212.      upper-case names in accord with X Windows conventions.) The
  1213.      default for DATA-TYPE is `STRING'.
  1214.  
  1215.    * The X server has a set of numbered "cut buffers" which can store
  1216.      text or other data being moved between applications.  Use
  1217.      `x-get-cut-buffer' to get the contents of a cut buffer; specify the
  1218.      cut buffer number as argument.  Use `x-set-cut-buffer' with
  1219.      argument STRING to store a new string into the first cut buffer
  1220.      (moving the other values down through the series of cut buffers,
  1221.      kill-ring-style).
  1222.  
  1223.      Cut buffers are considered obsolete, but Emacs supports them for
  1224.      the sake of X clients that still use them.
  1225.  
  1226.    * You can close the connection with the X server with the function
  1227.      `x-close-current-connection'.  This takes no arguments.
  1228.  
  1229.      Then you can connect to a different X server with
  1230.      `x-open-connection'.  The first argument, DISPLAY, is the name of
  1231.      the display to connect to.
  1232.  
  1233.      The optional second argument XRM-STRING is a string of resource
  1234.      names and values, in the same format used in the `.Xresources'
  1235.      file.  The values you specify override the resource values
  1236.      recorded in the X server itself.  Here's an example of what this
  1237.      string might look like:
  1238.  
  1239.           "*BorderWidth: 3\n*InternalBorder: 2\n"
  1240.  
  1241.    * A series of new functions give you information about the X server
  1242.      and the screen you are using.
  1243.  
  1244.     `x-display-screens'
  1245.           The number of screens associated with the current display.
  1246.  
  1247.     `x-server-version'
  1248.           The version numbers of the X server in use.
  1249.  
  1250.     `x-server-vendor'
  1251.           The vendor supporting the X server in use.
  1252.  
  1253.     `x-display-pixel-height'
  1254.           The height of this X screen in pixels.
  1255.  
  1256.     `x-display-mm-height'
  1257.           The height of this X screen in millimeters.
  1258.  
  1259.     `x-display-pixel-width'
  1260.           The width of this X screen in pixels.
  1261.  
  1262.     `x-display-mm-width'
  1263.           The width of this X screen in millimeters.
  1264.  
  1265.     `x-display-backing-store'
  1266.           The backing store capability of this screen.  Values can be
  1267.           the symbols `always', `when-mapped', or `not-useful'.
  1268.  
  1269.     `x-display-save-under'
  1270.           Non-`nil' if this X screen supports the SaveUnder feature.
  1271.  
  1272.     `x-display-planes'
  1273.           The number of planes this display supports.
  1274.  
  1275.     `x-display-visual-class'
  1276.           The visual class for this X screen.  The value is one of the
  1277.           symbols `static-gray', `gray-scale', `static-color',
  1278.           `pseudo-color', `true-color', and `direct-color'.
  1279.  
  1280.     `x-display-color-p'
  1281.           `t' if the X screen in use is a color screen.
  1282.  
  1283.     `x-display-color-cells'
  1284.           The number of color cells this X screen supports.
  1285.  
  1286.      There is also a variable `x-no-window-manager', whose value is `t'
  1287.      if no X window manager is in use.
  1288.  
  1289.    * The function `x-synchronize' enables or disables an X Windows
  1290.      debugging mode: synchronous communication.  It takes one argument,
  1291.      non-`nil' to enable the mode and `nil' to disable.
  1292.  
  1293.      In synchronous mode, Emacs waits for a response to each X protocol
  1294.      command before doing anything else.  This means that errors are
  1295.      reported right away, and you can directly find the erroneous
  1296.      command.  Synchronous mode is not the default because it is much
  1297.      slower.
  1298.  
  1299.    * The function `x-get-resource' retrieves a resource value from the X
  1300.      Windows defaults database.  Its three arguments are ATTRIBUTE,
  1301.      NAME and CLASS.  It searches using a key of the form
  1302.      `INSTANCE.ATTRIBUTE', with class `Emacs', where INSTANCE is the
  1303.      name under which Emacs was invoked.
  1304.  
  1305.      The optional arguments COMPONENT and SUBCLASS add to the key and
  1306.      the class, respectively.  You must specify both of them or neither.
  1307.      If you specify them, the key is `INSTANCE.COMPONENT.ATTRIBUTE',
  1308.      and the class is `Emacs.SUBCLASS'.
  1309.  
  1310.    * `x-display-color-p' returns `t' if you are using an X server with
  1311.      a color display, and `nil' otherwise.
  1312.  
  1313.      `x-color-defined-p' takes as argument a string describing a color;
  1314.      it returns `t' if the display supports that color.  (If the color
  1315.      is `"black"' or `"white"' then even black-and-white displays
  1316.      support it.)
  1317.  
  1318.    * `x-popup-menu' has been generalized.  It now accepts a keymap as
  1319.      the MENU argument.  Then the menu items are the prompt strings of
  1320.      individual key bindings, and the item values are the keys which
  1321.      have those bindings.
  1322.  
  1323.      You can also supply a list of keymaps as the first argument; then
  1324.      each keymap makes one menu pane (but keymaps that don't provide
  1325.      any menu items don't appear in the menu at all).
  1326.  
  1327.      `x-popup-menu' also accepts a mouse button event as the POSITION
  1328.      argument.  Then it displays the menu at the location at which the
  1329.      event took place.  This is convenient for mouse-invoked commands
  1330.      that pop up menus.
  1331.  
  1332.    * You can use the function `x-rebind-key' to change the sequence of
  1333.      characters generated by the X server for one of the keyboard keys.
  1334.  
  1335.      The first two arguments, KEYCODE and SHIFT-MASK, should be numbers
  1336.      representing the keyboard code and shift mask respectively.  They
  1337.      specify what key to change.
  1338.  
  1339.      The third argument, NEWSTRING, is the new definition of the key.
  1340.      It is a sequence of characters that the key should produce as
  1341.      input.
  1342.  
  1343.      The shift mask value is a combination of bits according to this
  1344.      table:
  1345.  
  1346.     8
  1347.           Control
  1348.  
  1349.     4
  1350.           Meta
  1351.  
  1352.     2
  1353.           Shift
  1354.  
  1355.     1
  1356.           Shift Lock
  1357.  
  1358.      If you specify `nil' for SHIFT-MASK, then the key specified by
  1359.      KEYCODE is redefined for all possible shift combinations.
  1360.  
  1361.      For the possible values of KEYCODE and their meanings, see the
  1362.      file `/usr/lib/Xkeymap.txt'.  Keep in mind that the codes in that
  1363.      file are in octal!
  1364.  
  1365.      The related function `x-rebind-keys' redefines a single keyboard
  1366.      key, specifying the behavior for each of the 16 shift masks
  1367.      independently.  The first argument is KEYCODE, as in
  1368.      `x-rebind-key'.  The second argument STRINGS is a list of 16
  1369.      elements, one for each possible shift mask value; each element
  1370.      says how to redefine the key KEYCODE with the corresponding shift
  1371.      mask value.  If an element is a string, it is the new definition.
  1372.      If an element is `nil', the definition does not change for that
  1373.      shift mask.
  1374.  
  1375.    * The function `x-parse-geometry' parses a string specifying window
  1376.      size and position in the usual X format.  It returns an alist
  1377.      describing which parameters were specified, and the values that
  1378.      were given for them.
  1379.  
  1380.      The elements of the alist look like `(PARAMETER .  VALUE)'.  The
  1381.      possible PARAMETER values are `left', `top', `width', and `height'.
  1382.  
  1383. New Window Features
  1384. ===================
  1385.  
  1386.    * The new function `window-at' tells you which window contains a
  1387.      given horizontal and vertical position on a specified frame.  Call
  1388.      it with three arguments, like this:
  1389.  
  1390.           (window-at X COLUMN FRAME)
  1391.  
  1392.      The function returns the window which contains that cursor
  1393.      position in the frame FRAME.  If you omit FRAME, the selected
  1394.      frame is used.
  1395.  
  1396.    * The function `coordinates-in-window-p' takes two arguments and
  1397.      checks whether a particular frame position falls within a
  1398.      particular window.
  1399.  
  1400.           (coordinates-in-window-p COORDINATES WINDOW)
  1401.  
  1402.      The argument COORDINATES is a cons cell of this form:
  1403.  
  1404.           (X . Y)
  1405.  
  1406.      The two coordinates are measured in characters, and count from the
  1407.      top left corner of the screen or frame.
  1408.  
  1409.      The value of the function tells you what part of the window the
  1410.      position is in.  The possible values are:
  1411.  
  1412.     `(RELX . RELY)'
  1413.           The coordinates are inside WINDOW.  The numbers RELX and RELY
  1414.           are equivalent window-relative coordinates, counting from 0
  1415.           at the top left corner of the window.
  1416.  
  1417.     `mode-line'
  1418.           The coordinates are in the mode line of WINDOW.
  1419.  
  1420.     `vertical-split'
  1421.           The coordinates are in the vertical line between WINDOW and
  1422.           its neighbor to the right.
  1423.  
  1424.     `nil'
  1425.           The coordinates are not in any sense within WINDOW.
  1426.  
  1427.      You need not specify a frame when you call
  1428.      `coordinates-in-window-p', because it assumes you mean the frame
  1429.      which window WINDOW is on.
  1430.  
  1431.    * The function `minibuffer-window' now accepts a frame as argument
  1432.      and returns the minibuffer window used for that frame.  If you
  1433.      don't specify a frame, the currently selected frame is used.  The
  1434.      minibuffer window may be on the frame in question, but if that
  1435.      frame has no minibuffer of its own, it uses the minibuffer window
  1436.      of some other frame, and `minibuffer-window' returns that window.
  1437.  
  1438.    * Use `window-live-p' to test whether a window is still alive (that
  1439.      is, not deleted).
  1440.  
  1441.    * Use `window-minibuffer-p' to determine whether a given window is a
  1442.      minibuffer or not.  It no longer works to do this by comparing the
  1443.      window with the result of `(minibuffer-window)', because there can
  1444.      be more than one minibuffer window at a time (if you have multiple
  1445.      frames).
  1446.  
  1447.    * If you set the variable `pop-up-frames' non-`nil', then the
  1448.      functions to show something "in another window" actually create a
  1449.      new frame for the new window.  Thus, you will tend to have a frame
  1450.      for each window, and you can easily have a frame for each buffer.
  1451.  
  1452.      The value of the variable `pop-up-frame-function' controls how new
  1453.      frames are made.  The value should be a function which takes no
  1454.      arguments and returns a frame.  The default value is a function
  1455.      which creates a frame using parameters from `pop-up-frame-alist'.
  1456.  
  1457.    * `display-buffer' is the basic primitive for finding a way to show a
  1458.      buffer on the screen.  You can customize its behavior by storing a
  1459.      function in the variable `display-buffer-function'.  If this
  1460.      variable is non-`nil', then `display-buffer' calls it to do the
  1461.      work.  Your function should accept two arguments, as follows:
  1462.  
  1463.     BUFFER
  1464.           The buffer to be displayed.
  1465.  
  1466.     FLAG
  1467.           A flag which, if non-`nil', means you should find another
  1468.           window to display BUFFER in, even if it is already visible in
  1469.           the selected window.
  1470.  
  1471.      The function you supply will be used by commands such as
  1472.      `switch-to-buffer-other-window' and `find-file-other-window' as
  1473.      well as for your own calls to `display-buffer'.
  1474.  
  1475.    * `delete-window' now gives all of the deleted window's screen space
  1476.      to a single neighboring window.  Likewise, `enlarge-window' takes
  1477.      space from only one neighboring window until that window
  1478.      disappears; only then does it take from another window.
  1479.  
  1480.    * `next-window' and `previous-window' accept another argument,
  1481.      ALL-FRAMES.
  1482.  
  1483.      These functions now take three optional arguments: WINDOW, MINIBUF
  1484.      and ALL-FRAMES.  WINDOW is the window to start from (`nil' means
  1485.      use the selected window).  MINIBUF says whether to include the
  1486.      minibuffer in the windows to cycle through: `t' means yes, `nil'
  1487.      means yes if it is active, and anything else means no.
  1488.  
  1489.      Normally, these functions cycle through all the windows in the
  1490.      selected frame, plus the minibuffer used by the selected frame
  1491.      even if it lies in some other frame.
  1492.  
  1493.      If ALL-FRAMES is `t', then these functions cycle through all the
  1494.      windows in all the frames that currently exist.  If ALL-FRAMES is
  1495.      neither `t' nor `nil', then they limit themselves strictly to the
  1496.      windows in the selected frame, excluding the minibuffer in use if
  1497.      it lies in some other frame.
  1498.  
  1499.    * The functions `get-lru-window' and `get-largest-window' now take
  1500.      an optional argument ALL-FRAMES.  If it is non-`nil', the
  1501.      functions consider all windows on all frames.  Otherwise, they
  1502.      consider just the windows on the selected frame.
  1503.  
  1504.      Likewise, `get-buffer-window' takes an optional second argument
  1505.      ALL-FRAMES.
  1506.  
  1507.    * The variable `other-window-scroll-buffer' specifies which buffer
  1508.      `scroll-other-window' should scroll.
  1509.  
  1510.    * You can now mark a window as "dedicated" to its buffer.  Then
  1511.      Emacs will not try to use that window for any other buffer unless
  1512.      you explicitly request it.
  1513.  
  1514.      Use the new function `set-window-dedicated-p' to set the dedication
  1515.      flag of a window WINDOW to the value FLAG.  If FLAG is `t', this
  1516.      makes the window dedicated.  If FLAG is `nil', this makes the
  1517.      window non-dedicated.
  1518.  
  1519.      Use `window-dedicated-p' to examine the dedication flag of a
  1520.      specified window.
  1521.  
  1522.    * The new function `walk-windows' cycles through all visible
  1523.      windows, calling `proc' once for each window with the window as
  1524.      its sole argument.
  1525.  
  1526.      The optional second argument MINIBUF says whether to include
  1527.      minibuffer windows.  A value of `t' means count the minibuffer
  1528.      window even if not active.  A value of `nil' means count it only
  1529.      if active.  Any other value means not to count the minibuffer even
  1530.      if it is active.
  1531.  
  1532.      If the optional third argument ALL-FRAMES is `t', that means
  1533.      include all windows in all frames.  If ALL-FRAMES is `nil', it
  1534.      means to cycle within the selected frame, but include the
  1535.      minibuffer window (if MINIBUF says so) that that frame uses, even
  1536.      if it is on another frame.  If ALL-FRAMES is neither `nil' nor `t',
  1537.      `walk-windows' sticks strictly to the selected frame.
  1538.  
  1539.    * The function `window-end' is a counterpart to `window-start': it
  1540.      returns the buffer position of the end of the display in a given
  1541.      window (or the selected window).
  1542.  
  1543.    * The function `window-configuration-p' returns non-`nil' when given
  1544.      an object that is a window configuration (such as is returned by
  1545.      `current-window-configuration').
  1546.  
  1547. Display Features
  1548. ================
  1549.  
  1550.    * `baud-rate' is now a variable rather than a function.  This is so
  1551.      you can set it to reflect the effective speed of your terminal,
  1552.      when the system doesn't accurately know the speed.
  1553.  
  1554.    * You can now remove any echo area message and make the minibuffer
  1555.      visible.  To do this, call `message' with `nil' as the only
  1556.      argument.  This clears any existing message, and lets the current
  1557.      minibuffer contents show through.  Previously, there was no
  1558.      reliable way to make sure that the minibuffer contents were
  1559.      visible.
  1560.  
  1561.    * The variable `temp-buffer-show-hook' has been renamed
  1562.      `temp-buffer-show-function', because its value is a single function
  1563.      (of one argument), not a normal hook.
  1564.  
  1565.    * The new function `force-mode-line-update' causes redisplay of the
  1566.      current buffer's mode line.
  1567.  
  1568. Display Tables
  1569. ==============
  1570.  
  1571.    You can use the "display table" feature to control how all 256
  1572. possible character codes display on the screen.  This is useful for
  1573. displaying European languages that have letters not in the ASCII
  1574. character set.
  1575.  
  1576.    The display table maps each character code into a sequence of
  1577. "glyphs", each glyph being an image that takes up one character
  1578. position on the screen.  You can also define how to display each glyph
  1579. on your terminal, using the "glyph table".
  1580.  
  1581. Display Tables Proper
  1582. ---------------------
  1583.  
  1584.    Use `make-display-table' to create a display table.  The table
  1585. initially has `nil' in all elements.
  1586.  
  1587.    A display table is actually an array of 261 elements.  The first 256
  1588. elements of a display table control how to display each possible text
  1589. character.  The value should be `nil' or a vector (which is a sequence
  1590. of glyphs; see below).  `nil' as an element means to display that
  1591. character following the usual display conventions.
  1592.  
  1593.    The remaining five elements of a display table serve special purposes
  1594. (`nil' means use the default stated below):
  1595.  
  1596. 256
  1597.      The glyph for the end of a truncated screen line (the default for
  1598.      this is `\').
  1599.  
  1600. 257
  1601.      The glyph for the end of a continued line (the default is `$').
  1602.  
  1603. 258
  1604.      The glyph for the indicating an octal character code (the default
  1605.      is `\').
  1606.  
  1607. 259
  1608.      The glyph for indicating a control characters (the default is `^').
  1609.  
  1610. 260
  1611.      The vector of glyphs for indicating the presence of invisible
  1612.      lines (the default is `...').
  1613.  
  1614.    Each buffer typically has its own display table.  The display table
  1615. for the current buffer is stored in `buffer-display-table'.  (This
  1616. variable automatically becomes local if you set it.)  If this variable
  1617. is `nil', the value of `standard-display-table' is used in that buffer.
  1618.  
  1619.    Each window can have its own display table, which overrides the
  1620. display table of the buffer it is showing.
  1621.  
  1622.    If neither the selected window nor the current buffer has a display
  1623. table, and if `standard-display-table' is `nil', then Emacs uses the
  1624. usual display conventions:
  1625.  
  1626.    * Character codes 32 through 127 map to glyph codes 32 through 127.
  1627.  
  1628.    * Codes 0 through 31 map to sequences of two glyphs, where the first
  1629.      glyph is the ASCII code for `^'.
  1630.  
  1631.    * Character codes 128 through 255 map to sequences of four glyphs,
  1632.      where the first glyph is the ASCII code for `\', and the others
  1633.      represent digits.
  1634.  
  1635.    The usual display conventions are also used for any character whose
  1636. entry in the active display table is `nil'.  This means that when you
  1637. set up a display table, you need not specify explicitly what to do with
  1638. each character, only the characters for which you want unusual behavior.
  1639.  
  1640. Glyphs
  1641. ------
  1642.  
  1643.    A glyph stands for an image that takes up a single character
  1644. position on the screen.  A glyph is represented in Lisp as an integer.
  1645.  
  1646.    The meaning of each integer, as a glyph, is defined by the glyph
  1647. table, which is the value of the variable `glyph-table'.  It should be a
  1648. vector; the Gth element defines glyph code G.  The possible definitions
  1649. of a glyph code are:
  1650.  
  1651. INTEGER
  1652.      Define this glyph code as an alias for code INTEGER.  This is used
  1653.      with X Windows to specify a face code.
  1654.  
  1655. STRING
  1656.      Send the characters in STRING to the terminal to output this
  1657.      glyph.  This alternative is available only for character
  1658.      terminals, not with X.
  1659.  
  1660. `NIL'
  1661.      This glyph is simple.  On an ordinary terminal, the glyph code mod
  1662.      256 is the character to output.  With X, the glyph code mod 256 is
  1663.      character to output, and the glyph code divided by 256 specifies
  1664.      the "face code" to use while outputting it.
  1665.  
  1666.    Any glyph code beyond the length of the glyph table is automatically
  1667. simple.
  1668.  
  1669.    If `glyph-table' is `nil', then all possible glyph codes are simple.
  1670.  
  1671.    A "face" is a named combination of a font and a pair of colors
  1672. (foreground and background).  A glyph code can specify a face id number
  1673. to use for displaying that glyph.
  1674.  
  1675. ISO Latin 1
  1676. -----------
  1677.  
  1678.    If you have a terminal that can handle the entire ISO Latin 1
  1679. character set, you can arrange to use that character set as follows:
  1680.  
  1681.      (require 'disp-table)
  1682.      (standard-display-8bit 0 255)
  1683.  
  1684.    If you are editing buffers written in the ISO Latin 1 character set
  1685. and your terminal doesn't handle anything but ASCII, you can load the
  1686. file `iso-ascii' to set up a display table which makes the other ISO
  1687. characters display as sequences of ASCII characters.  For example, the
  1688. character "o with umlaut" displays as `{"o}'.
  1689.  
  1690.    Some European countries have terminals that don't support ISO Latin 1
  1691. but do support the special characters for that country's language.  You
  1692. can define a display table to work one language using such terminals.
  1693. For an example, see `lisp/iso-swed.el', which handles certain Swedish
  1694. terminals.
  1695.  
  1696.    You can load the appropriate display table for your terminal
  1697. automatically by writing a terminal-specific Lisp file for the terminal
  1698. type.
  1699.  
  1700. Overlays
  1701. ========
  1702.  
  1703.    You can use "overlays" to alter the appearance of a buffer's text on
  1704. the screen.  An overlay is an object which belongs to a particular
  1705. buffer, and has a specified beginning and end.  It also has properties
  1706. which you can examine and set; these affect the display of the text
  1707. within the overlay.
  1708.  
  1709. Overlay Properties
  1710. ------------------
  1711.  
  1712.    Overlay properties are like text properties in some respects, but the
  1713. differences are more important than the similarities.  Text properties
  1714. are considered a part of the text; overlays are specifically considered
  1715. not to be part of the text.  Thus, copying text between various buffers
  1716. and strings preserves text properties, but does not try to preserve
  1717. overlays.  Changing a buffer's text properties marks the buffer as
  1718. modified, while moving an overlay or changing its properties does not.
  1719.  
  1720. `face'
  1721.      This property specifies a face for displaying the text within the
  1722.      overlay.
  1723.  
  1724. `priority'
  1725.      This property's value (which should be a nonnegative number)
  1726.      determines the priority of the overlay.  The priority matters when
  1727.      two or more overlays cover the same character and both specify a
  1728.      face for display; the one whose `priority' value is larger takes
  1729.      priority over the other, and its face attributes override the face
  1730.      attributes of the lower priority overlay.
  1731.  
  1732.      Currently, all overlays take priority over text properties.  Please
  1733.      avoid using negative priority values, as we have not yet decided
  1734.      just what they should mean.
  1735.  
  1736. `window'
  1737.      If the `window' property is non-`nil', then the overlay applies
  1738.      only on that window.
  1739.  
  1740. Overlay Functions
  1741. -----------------
  1742.  
  1743.    Use the functions `overlay-get' and `overlay-put' to access and set
  1744. the properties of an overlay.  They take arguments like `get' and
  1745. `put', except that the first argument is an overlay rather than a
  1746. symbol.
  1747.  
  1748.    To create an overlay, call `(make-overlay START END)'.  You can
  1749. specify the buffer as the third argument if you wish.  To delete one,
  1750. use `delete-overlay'.
  1751.  
  1752.    Use `overlay-start', `overlay-end' and `overlay-buffer' to examine
  1753. the location and range of an overlay.  Use `move-overlay' to change
  1754. them; its arguments are OVERLAY, START, END and (optionally) the buffer.
  1755.  
  1756.    There are two functions to search for overlays: `overlays-at' and
  1757. `next-overlay-change'.  `overlays-at' returns a list of all the
  1758. overlays containing a particular position.  `(next-overlay-change POS)'
  1759. returns the position of the next overlay beginning or end following POS.
  1760.  
  1761. Faces
  1762. =====
  1763.  
  1764.    A "face" is a named collection of graphical attributes: font,
  1765. foreground color, background color and optional underlining.  Faces
  1766. control the display of text on the screen.
  1767.  
  1768.    Each face has its own "face id number" which distinguishes faces at
  1769. low levels within Emacs.  However, for most purposes, you can refer to
  1770. faces in Lisp programs by their names.
  1771.  
  1772.    Each face name is meaningful for all frames, and by default it has
  1773. the same meaning in all frames.  But you can arrange to give a
  1774. particular face name a special meaning in one frame if you wish.
  1775.  
  1776. Choosing a Face for Display
  1777. ---------------------------
  1778.  
  1779.    Here are all the ways to specify which face to use for display of
  1780. text:
  1781.  
  1782.    * With defaults.  Each frame has a "default face", whose id number is
  1783.      zero, which is used for all text that doesn't somehow specify
  1784.      another face.
  1785.  
  1786.    * With text properties.  A character may have a `face' property; if
  1787.      so, it's displayed with that face.  If the character has a
  1788.      `mouse-face' property, that is used instead of the `face' property
  1789.      when the mouse is "near enough" to the character.
  1790.  
  1791.    * With overlays.  An overlay may have `face' and `mouse-face'
  1792.      properties too; they apply to all the text covered by the overlay.
  1793.  
  1794.    * With special glyphs.  Each glyph can specify a particular face id
  1795.      number.
  1796.  
  1797.    If these various sources together specify more than one face for a
  1798. particular character, Emacs merges the attributes of the various faces
  1799. specified.  The attributes of the faces of special glyphs come first;
  1800. then come attributes of faces from overlays, followed by those from text
  1801. properties, and last the default face.
  1802.  
  1803.    When multiple overlays cover one character, an overlay with higher
  1804. priority overrides those with lower priority.
  1805.  
  1806.    If an attribute such as the font or a color is not specified in any
  1807. of the above ways, the frame's own font or color is used.
  1808.  
  1809.    *Note Face Functions: (elisp)Face Functions, for functions to create
  1810. and change faces.
  1811.  
  1812. New Input Event Formats
  1813. =======================
  1814.  
  1815.    Mouse clicks, mouse movements and function keys no longer appear in
  1816. the input stream as characters; instead, other kinds of Lisp objects
  1817. represent them as input.
  1818.  
  1819.    * An ordinary input character event consists of a "basic code"
  1820.      between 0 and 255, plus any or all of these "modifier bits":
  1821.  
  1822.     meta
  1823.           The 2**23 bit in the character code indicates a character
  1824.           typed with the meta key held down.
  1825.  
  1826.     control
  1827.           The 2**22 bit in the character code indicates a non-ASCII
  1828.           control character.
  1829.  
  1830.           ASCII control characters such as `C-a' have special basic
  1831.           codes of their own, so Emacs needs no special bit to indicate
  1832.           them.  Thus, the code for `C-a' is just 1.
  1833.  
  1834.           But if you type a control combination not in ASCII, such as
  1835.           `%' with the control key, the numeric value you get is the
  1836.           code for `%' plus 2**22 (assuming the terminal supports
  1837.           non-ASCII control characters).
  1838.  
  1839.     shift
  1840.           The 2**21 bit in the character code indicates an ASCII control
  1841.           character typed with the shift key held down.
  1842.  
  1843.           For letters, the basic code indicates upper versus lower
  1844.           case; for digits and punctuation, the shift key selects an
  1845.           entirely different character with a different basic code.  In
  1846.           order to keep within the ASCII character set whenever
  1847.           possible, Emacs avoids using the 2**21 bit for those
  1848.           characters.
  1849.  
  1850.           However, ASCII provides no way to distinguish `C-A' from
  1851.           `C-a', so Emacs uses the 2**21 bit in `C-A' and not in `C-a'.
  1852.  
  1853.     hyper
  1854.           The 2**20 bit in the character code indicates a character
  1855.           typed with the hyper key held down.
  1856.  
  1857.     super
  1858.           The 2**19 bit in the character code indicates a character
  1859.           typed with the super key held down.
  1860.  
  1861.     alt
  1862.           The 2**18 bit in the character code indicates a character
  1863.           typed with the alt key held down.  (On some terminals, the
  1864.           key labeled ALT is actually the meta key.)
  1865.  
  1866.      In the future, Emacs may support a larger range of basic codes.
  1867.      We may also move the modifier bits to larger bit numbers.
  1868.      Therefore, you should avoid mentioning specific bit numbers in
  1869.      your program.  Instead, the way to test the modifier bits of a
  1870.      character is with the function `event-modifiers' (see below).
  1871.  
  1872.    * Function keys are represented as symbols.  The symbol's name is
  1873.      the function key's label.  For example, pressing a key labeled F1
  1874.      places the symbol `f1' in the input stream.
  1875.  
  1876.      There are a few exceptions to the symbol naming convention:
  1877.  
  1878.     `kp-add', `kp-decimal', `kp-divide', ...
  1879.           Keypad keys (to the right of the regular keyboard).
  1880.  
  1881.     `kp-0', `kp-1', ...
  1882.           Keypad keys with digits.
  1883.  
  1884.     `kp-f1', `kp-f2', `kp-f3', `kp-f4'
  1885.           Keypad PF keys.
  1886.  
  1887.     `left', `up', `right', `down'
  1888.           Cursor arrow keys
  1889.  
  1890.      You can use the modifier keys CTRL, META, HYPER, SUPER, ALT and
  1891.      SHIFT with function keys.  The way to represent them is with
  1892.      prefixes in the symbol name:
  1893.  
  1894.     `A-'
  1895.           The alt modifier.
  1896.  
  1897.     `C-'
  1898.           The control modifier.
  1899.  
  1900.     `H-'
  1901.           The hyper modifier.
  1902.  
  1903.     `M-'
  1904.           The meta modifier.
  1905.  
  1906.     `s-'
  1907.           The super modifier.
  1908.  
  1909.     `S-'
  1910.           The shift modifier.
  1911.  
  1912.      Thus, the symbol for the key F3 with META held down is `M-F3'.
  1913.      When you use more than one prefix, we recommend you write them in
  1914.      alphabetical order (though the order does not matter in arguments
  1915.      to the key-binding lookup and modification functions).
  1916.  
  1917.    * Mouse events are represented as lists.
  1918.  
  1919.      If you press a mouse button and release it at the same location,
  1920.      this generates a "click" event.  Mouse click events have this form:
  1921.  
  1922.           (BUTTON-SYMBOL
  1923.            (WINDOW (COLUMN . ROW)
  1924.             BUFFER-POS TIMESTAMP))
  1925.  
  1926.      Here is what the elements normally mean:
  1927.  
  1928.     BUTTON-SYMBOL
  1929.           indicates which mouse button was used.  It is one of the
  1930.           symbols `mouse-1', `mouse-2', ..., where the buttons are
  1931.           normally numbered left to right.
  1932.  
  1933.           You can also use prefixes `A-', `C-', `H-', `M-', `S-' and
  1934.           `s-' for modifiers alt, control, hyper, meta, shift and
  1935.           super, just as you would with function keys.
  1936.  
  1937.     WINDOW
  1938.           is the window in which the click occurred.
  1939.  
  1940.     COLUMN
  1941.     ROW
  1942.           are the column and row of the click, relative to the top left
  1943.           corner of WINDOW, which is `(0 . 0)'.
  1944.  
  1945.     BUFFER-POS
  1946.           is the buffer position of the character clicked on.
  1947.  
  1948.     TIMESTAMP
  1949.           is the time at which the event occurred, in milliseconds.
  1950.           (Since this value wraps around the entire range of Emacs Lisp
  1951.           integers in about five hours, it is useful only for relating
  1952.           the times of nearby events.)
  1953.  
  1954.      The meanings of BUFFER-POS, ROW and COLUMN are somewhat different
  1955.      when the event location is in a special part of the screen, such
  1956.      as the mode line or a scroll bar.
  1957.  
  1958.      If the position is in the window's scroll bar, then BUFFER-POS is
  1959.      the symbol `vertical-scroll-bar', and the pair `(COLUMN . ROW)' is
  1960.      replaced with a pair `(PORTION . WHOLE)', where PORTION is the
  1961.      distance of the click from the top or left end of the scroll bar,
  1962.      and WHOLE is the length of the entire scroll bar.
  1963.  
  1964.      If the position is on a mode line or the vertical line separating
  1965.      WINDOW from its neighbor to the right, then BUFFER-POS is the
  1966.      symbol `mode-line' or `vertical-line'.  In this case ROW and
  1967.      COLUMN do not have meaningful data.
  1968.  
  1969.    * Releasing a mouse button above a different character position
  1970.      generates a "drag" event, which looks like this:
  1971.  
  1972.           (BUTTON-SYMBOL
  1973.            (WINDOW1 (COLUMN1 . ROW1)
  1974.             BUFFER-POS1 TIMESTAMP1)
  1975.            (WINDOW2 (COLUMN2 . ROW2)
  1976.             BUFFER-POS2 TIMESTAMP2))
  1977.  
  1978.      The name of BUTTON-SYMBOL contains the prefix `drag-'.  The second
  1979.      and third elements of the event give the starting and ending
  1980.      position of the drag.
  1981.  
  1982.      The `drag-' prefix follows the modifier key prefixes such as `C-'
  1983.      and `M-'.
  1984.  
  1985.      If `read-key-sequence' receives a drag event which has no key
  1986.      binding, and the corresponding click event does have a binding, it
  1987.      changes the drag event into a click event at the drag's starting
  1988.      position.  This means that you don't have to distinguish between
  1989.      click and drag events unless you want to.
  1990.  
  1991.    * Click and drag events happen when you release a mouse button.
  1992.      Another kind of event happens when you press a button.  It looks
  1993.      just like a click event, except that the name of BUTTON-SYMBOL
  1994.      contains the prefix `down-'.  The `down-' prefix follows the
  1995.      modifier key prefixes such as `C-' and `M-'.
  1996.  
  1997.      The function `read-key-sequence', and the Emacs command loop,
  1998.      ignore any down events that don't have command bindings.  This
  1999.      means that you need not worry about defining down events unless
  2000.      you want them to do something.  The usual reason to define a down
  2001.      event is so that you can track mouse motion until the button is
  2002.      released.
  2003.  
  2004.    * For example, if the user presses and releases the left mouse
  2005.      button over the same location, Emacs generates a sequence of
  2006.      events like this:
  2007.  
  2008.           (down-mouse-1 (#<window 18 on NEWS> 2613 (0 . 38) -864320))
  2009.           (mouse-1      (#<window 18 on NEWS> 2613 (0 . 38) -864180))
  2010.  
  2011.      Or, while holding the control key down, the user might hold down
  2012.      the second mouse button, and drag the mouse from one line to the
  2013.      next.  That produces two events, as shown here:
  2014.  
  2015.           (C-down-mouse-2 (#<window 18 on NEWS> 3440 (0 . 27) -731219))
  2016.           (C-drag-mouse-2 (#<window 18 on NEWS> 3440 (0 . 27) -731219)
  2017.                           (#<window 18 on NEWS> 3510 (0 . 28) -729648))
  2018.  
  2019.      Or, while holding down the meta and shift keys, the user might
  2020.      press the second mouse button on the window's mode line, and then
  2021.      drag the mouse into another window.  That produces an event like
  2022.      this:
  2023.  
  2024.           (M-S-down-mouse-2 (#<window 18 on NEWS> mode-line (33 . 31) -457844))
  2025.           (M-S-drag-mouse-2 (#<window 18 on NEWS> mode-line (33 . 31) -457844)
  2026.                             (#<window 20 on carlton-sanskrit.tex> 161 (33 . 3)
  2027.                              -453816))
  2028.  
  2029.    * A key sequence that starts with a mouse click is read using the
  2030.      keymaps of the buffer in the window clicked on, not the current
  2031.      buffer.
  2032.  
  2033.      This does not imply that clicking in a window selects that window
  2034.      or its buffer.  The execution of the command begins with no change
  2035.      in the selected window or current buffer.  However, the command
  2036.      can switch windows or buffers if programmed to do so.
  2037.  
  2038.    * Mouse motion events are represented by lists.  During the
  2039.      execution of the body of a `track-mouse' form, moving the mouse
  2040.      generates events that look like this:
  2041.  
  2042.           (mouse-movement (WINDOW (COLUMN . ROW)
  2043.                            BUFFER-POS TIMESTAMP))
  2044.  
  2045.      The second element of the list describes the current position of
  2046.      the mouse, just as in a mouse click event.
  2047.  
  2048.      Outside of `track-mouse' forms, Emacs does not generate events for
  2049.      mere motion of the mouse, and these events do not appear.
  2050.  
  2051.    * Focus shifts between frames are represented by lists.
  2052.  
  2053.      When the mouse shifts temporary input focus from one frame to
  2054.      another, Emacs generates an event like this:
  2055.  
  2056.           (switch-frame NEW-FRAME)
  2057.  
  2058.      where NEW-FRAME is the frame switched to.
  2059.  
  2060.      In X windows, most window managers are set up so that just moving
  2061.      the mouse into a window is enough to set the focus there.  As far
  2062.      as the user is concerned, Emacs behaves consistently with this.
  2063.      However, there is no need for the Lisp program to know about the
  2064.      focus change until some other kind of input arrives.  So Emacs
  2065.      generates the focus event only when the user actually types a
  2066.      keyboard key or presses a mouse button in the new frame; just
  2067.      moving the mouse between frames does not generate a focus event.
  2068.  
  2069.      The global key map usually binds this event to the
  2070.      `internal-select-frame' function, so that characters typed at a
  2071.      frame apply to that frame's selected window.
  2072.  
  2073.      If the user switches frames in the middle of a key sequence, then
  2074.      Emacs delays the `switch-frame' event until the key sequence is
  2075.      over.  For example, suppose `C-c C-a' is a key sequence in the
  2076.      current buffer's keymaps.  If the user types `C-c', moves the
  2077.      mouse to another frame, and then types `C-a', `read-key-sequence'
  2078.      returns the sequence `"\C-c\C-a"', and the next call to
  2079.      `read-event' or `read-key-sequence' will return the `switch-frame'
  2080.      event.
  2081.  
  2082. Working with Input Events
  2083. =========================
  2084.  
  2085.    * Functions which work with key sequences now handle non-character
  2086.      events.  Functions like `define-key', `global-set-key', and
  2087.      `local-set-key' used to accept strings representing key sequences;
  2088.      now, since events may be arbitrary lisp objects, they also accept
  2089.      vectors.  The function `read-key-sequence' may return a string or a
  2090.      vector, depending on whether or not the sequence read contains only
  2091.      characters.
  2092.  
  2093.      List events may be represented by the symbols at their head; to
  2094.      bind clicks of the left mouse button, you need only present the
  2095.      symbol `mouse-1', not an entire mouse click event.  If you do put
  2096.      an event which is a list in a key sequence, only the event's head
  2097.      symbol is used in key lookups.
  2098.  
  2099.      For example, to globally bind the left mouse button to the function
  2100.      `mouse-set-point', you could evaluate this:
  2101.  
  2102.           (global-set-key [mouse-1] 'mouse-set-point)
  2103.  
  2104.      To bind the sequence `C-c F1' to the command `tex-view' in
  2105.      `tex-mode-map', you could evaluate this:
  2106.  
  2107.           (define-key tex-mode-map [?\C-c f1] 'tex-view)
  2108.  
  2109.      To find the binding for the function key labeled NEXT in
  2110.      `minibuffer-local-map', you could evaluate this:
  2111.  
  2112.           (lookup-key minibuffer-local-map [next])
  2113.                => next-history-element
  2114.  
  2115.      If you call the function `read-key-sequence' and then press `C-x
  2116.      C-F5', here is how it behaves:
  2117.  
  2118.           (read-key-sequence "Press `C-x C-F5': ")
  2119.                => [24 C-f5]
  2120.  
  2121.      Note that `24' is the character `C-x'.
  2122.  
  2123.    * The documentation functions (`single-key-description',
  2124.      `key-description', etc.) now handle the new event types.  Wherever
  2125.      a string of keyboard input characters was acceptable in previous
  2126.      versions of Emacs, a vector of events should now work.
  2127.  
  2128.    * Special parts of a window can have their own bindings for mouse
  2129.      events.
  2130.  
  2131.      When mouse events occur in special parts of a window, such as a
  2132.      mode line or a scroll bar, the event itself shows nothing
  2133.      special--only the symbol that would normally represent that mouse
  2134.      button and modifier keys.  The information about the screen region
  2135.      is kept in other parts of the event list.  But `read-key-sequence'
  2136.      translates this information into imaginary prefix keys, all of
  2137.      which are symbols: `mode-line', `vertical-line', and
  2138.      `vertical-scroll-bar'.
  2139.  
  2140.      For example, if you call `read-key-sequence' and then click the
  2141.      mouse on the window's mode line, this is what happens:
  2142.  
  2143.           (read-key-sequence "Click on the mode line: ")
  2144.                => [mode-line (mouse-1 (#<window 6 on NEWS> mode-line
  2145.                                         (40 . 63) 5959987))]
  2146.  
  2147.      You can define meanings for mouse clicks in special window regions
  2148.      by defining key sequences using these imaginary prefix keys.  For
  2149.      example, here is how to bind the third mouse button on a window's
  2150.      mode line delete the window:
  2151.  
  2152.           (global-set-key [mode-line mouse-3] 'mouse-delete-window)
  2153.  
  2154.      Here's how to bind the middle button (modified by META) on the
  2155.      vertical line at the right of a window to scroll the window to the
  2156.      left.
  2157.  
  2158.           (global-set-key [vertical-line M-mouse-2] 'scroll-left)
  2159.  
  2160.    * Decomposing an event symbol.
  2161.  
  2162.      Each symbol used to identify a function key or mouse button has a
  2163.      property named `event-symbol-elements', which is a list containing
  2164.      an unmodified version of the symbol, followed by modifiers the
  2165.      symbol name contains.  The modifiers are symbols; they include
  2166.      `shift', `control', and `meta'.  In addition, a mouse event symbol
  2167.      has one of `click', `drag', and `down'.  For example:
  2168.  
  2169.           (get 'f5 'event-symbol-elements)
  2170.                => (f5)
  2171.           (get 'C-f5 'event-symbol-elements)
  2172.                => (f5 control)
  2173.           (get 'M-S-f5 'event-symbol-elements)
  2174.                => (f5 meta shift)
  2175.           (get 'mouse-1 'event-symbol-elements)
  2176.                => (mouse-1 click)
  2177.           (get 'down-mouse-1 'event-symbol-elements)
  2178.                => (mouse-1 down)
  2179.  
  2180.      Note that the `event-symbol-elements' property for a mouse click
  2181.      explicitly contains `click', but the event symbol name itself does
  2182.      not contain `click'.
  2183.  
  2184.    * Use `read-event' to read input if you want to accept any kind of
  2185.      event.  The old function `read-char' now discards events other than
  2186.      keyboard characters.
  2187.  
  2188.    * `last-command-char' and `last-input-char' can now hold any kind of
  2189.      event.
  2190.  
  2191.    * The new variable `unread-command-events' is much like
  2192.      `unread-command-char'.  Its value is a list of events of any type,
  2193.      to be processed as command input in order of appearance in the
  2194.      list.
  2195.  
  2196.    * The function `this-command-keys' may return a string or a vector,
  2197.      depending on whether or not the sequence read contains only
  2198.      characters.  You may need to upgrade code which uses this function.
  2199.  
  2200.      The function `recent-keys' now returns a vector of events.  You
  2201.      may need to upgrade code which uses this function.
  2202.  
  2203.    * A keyboard macro's definition can now be either a string or a
  2204.      vector.  All that really matters is what elements it has.  If the
  2205.      elements are all characters, then the macro can be a string;
  2206.      otherwise, it has to be a vector.
  2207.  
  2208.    * The variable `last-event-frame' records which frame the last input
  2209.      event was directed to.  Usually this is the frame that was
  2210.      selected when the event was generated, but if that frame has
  2211.      redirected input focus to another frame, `last-event-frame' is the
  2212.      frame to which the event was redirected.
  2213.  
  2214.    * The interactive specification now allows a new code letter `e' to
  2215.      simplify commands bound to events which are lists.  This code
  2216.      supplies as an argument the complete event object.
  2217.  
  2218.      You can use `e' more than once in a single command's interactive
  2219.      specification.  If the key sequence which invoked the command has
  2220.      N events with parameters, the Nth `e' provides the Nth
  2221.      parameterized event.  Events which are not lists, such as function
  2222.      keys and ASCII keystrokes, do not count where `e' is concerned.
  2223.  
  2224.    * You can extract the starting and ending position values from a
  2225.      mouse button or motion event using the two functions `event-start'
  2226.      and `event-end'.  These two functions return different values for
  2227.      drag and motion events; for click and button-down events, they
  2228.      both return the position of the event.
  2229.  
  2230.    * The position, a returned by `event-start' and `event-end', is a
  2231.      list of this form:
  2232.  
  2233.           (WINDOW BUFFER-POSITION (COL . ROW) TIMESTAMP)
  2234.  
  2235.      You can extract parts of this list with the functions
  2236.      `posn-window', `posn-point', `posn-col-row', and `posn-timestamp'.
  2237.  
  2238.    * The function `scroll-bar-scale' is useful for computing where to
  2239.      scroll to in response to a mouse button event from a scroll bar.
  2240.      It takes two arguments, RATIO and TOTAL, and in effect multiplies
  2241.      them.  We say "in effect" because RATIO is not a number; rather a
  2242.      pair `(NUM . DENOM)'.
  2243.  
  2244.      Here's the usual way to use `scroll-bar-scale':
  2245.  
  2246.           (scroll-bar-scale (posn-col-row (event-start event))
  2247.                             (buffer-size))
  2248.  
  2249. Putting Keyboard Events in Strings
  2250. ==================================
  2251.  
  2252.    In most of the places where strings are used, we conceptualize the
  2253. string as containing text characters--the same kind of characters found
  2254. in buffers or files.  Occasionally Lisp programs use strings which
  2255. conceptually contain keyboard characters; for example, they may be key
  2256. sequences or keyboard macro definitions.  There are special rules for
  2257. how to put keyboard characters into a string, because they are not
  2258. limited to the range of 0 to 255 as text characters are.
  2259.  
  2260.    A keyboard character typed using the META key is called a "meta
  2261. character".  The numeric code for such an event includes the 2**23 bit;
  2262. it does not even come close to fitting in a string.  However, earlier
  2263. Emacs versions used a different representation for these characters,
  2264. which gave them codes in the range of 128 to 255.  That did fit in a
  2265. string, and many Lisp programs contain string constants that use `\M-'
  2266. to express meta characters, especially as the argument to `define-key'
  2267. and similar functions.
  2268.  
  2269.    We provide backward compatibility to run those programs with special
  2270. rules for how to put a keyboard character event in a string.  Here are
  2271. the rules:
  2272.  
  2273.    * If the keyboard event value is in the range of 0 to 127, it can go
  2274.      in the string unchanged.
  2275.  
  2276.    * The meta variants of those events, with codes in the range of
  2277.      2**23 to 2**23+127, can also go in the string, but you must change
  2278.      their numeric values.  You must set the 2**7 bit instead of the
  2279.      2**23 bit, resulting in a value between 128 and 255.
  2280.  
  2281.    * Other keyboard character events cannot fit in a string.  This
  2282.      includes keyboard events in the range of 128 to 255.
  2283.  
  2284.    Functions such as `read-key-sequence' that can construct strings
  2285. containing events follow these rules.
  2286.  
  2287.    When you use the read syntax `\M-' in a string, it produces a code
  2288. in the range of 128 to 255--the same code that you get if you modify
  2289. the corresponding keyboard event to put it in the string.  Thus, meta
  2290. events in strings work consistently regardless of how they get into the
  2291. strings.
  2292.  
  2293.    New programs can avoid dealing with these rules by using vectors
  2294. instead of strings for key sequences when there is any possibility that
  2295. these issues might arise.
  2296.  
  2297.    The reason we changed the representation of meta characters as
  2298. keyboard events is to make room for basic character codes beyond 127,
  2299. and support meta variants of such larger character codes.
  2300.  
  2301. Menus
  2302. =====
  2303.  
  2304.    You can now define menus conveniently as keymaps.  Menus are normally
  2305. used with the mouse, but they can work with the keyboard also.
  2306.  
  2307. Defining Menus
  2308. --------------
  2309.  
  2310.    A keymap is suitable for menu use if it has an "overall prompt
  2311. string", which is a string that appears as an element of the keymap.  It
  2312. should describes the purpose of the menu.  The easiest way to construct
  2313. a keymap with a prompt string is to specify the string as an argument
  2314. when you run `make-keymap' or `make-sparse-keymap'.
  2315.  
  2316.    The individual bindings in the menu keymap should also have prompt
  2317. strings; these strings are the items in the menu.  A binding with a
  2318. prompt string looks like this:
  2319.  
  2320.      (CHAR STRING . REAL-BINDING)
  2321.  
  2322.    As far as `define-key' is concerned, the string is part of the
  2323. character's binding--the binding looks like this:
  2324.  
  2325.      (STRING . REAL-BINDING).
  2326.  
  2327.    However, only REAL-BINDING is used for executing the key.
  2328.  
  2329.    You can also supply a second string, called the help string, as
  2330. follows:
  2331.  
  2332.      (CHAR STRING HELP-STRING . REAL-BINDING)
  2333.  
  2334.    Currently Emacs does not actually use HELP-STRING; it knows only how
  2335. to ignore HELP-STRING in order to extract REAL-BINDING.  In the future
  2336. we hope to make HELP-STRING serve as longer documentation for the menu
  2337. item, available on request.
  2338.  
  2339.    The prompt string for a binding should be short--one or two words.
  2340. Its meaning should describe the command it corresponds to.
  2341.  
  2342.    If REAL-BINDING is `nil', then STRING appears in the menu but cannot
  2343. be selected.
  2344.  
  2345.    If REAL-BINDING is a symbol, and has a non-`nil' `menu-enable'
  2346. property, that property is an expression which controls whether the
  2347. menu item is enabled.  Every time the keymap is used to display a menu,
  2348. Emacs evaluates the expression, and it enables the menu item only if
  2349. the expression's value is non-`nil'.  When a menu item is disabled, it
  2350. is displayed in a "fuzzy" fashion, and cannot be selected with the
  2351. mouse.
  2352.  
  2353. Menus and the Mouse
  2354. -------------------
  2355.  
  2356.    The way to make a menu keymap produce a menu is to make it the
  2357. definition of a prefix key.
  2358.  
  2359.    When the prefix key ends with a mouse event, Emacs handles the menu
  2360. keymap by popping up a visible menu that you can select from with the
  2361. mouse.  When you click on a menu item, the event generated is whatever
  2362. character or symbol has the binding which brought about that menu item.
  2363.  
  2364.    A single keymap can appear as multiple panes, if you explicitly
  2365. arrange for this.  The way to do this is to make a keymap for each
  2366. pane, then create a binding for each of those maps in the main keymap
  2367. of the menu.  Give each of these bindings a prompt string that starts
  2368. with `@'.  The rest of the prompt string becomes the name of the pane.
  2369. See the file `lisp/mouse.el' for an example of this.  Any ordinary
  2370. bindings with prompt strings are grouped into one pane, which appears
  2371. along with the other panes explicitly created for the submaps.
  2372.  
  2373.    You can also get multiple panes from separate keymaps.  The full
  2374. definition of a prefix key always comes from merging the definitions
  2375. supplied by the various active keymaps (minor modes, local, and
  2376. global).  When more than one of these keymaps is a menu, each of them
  2377. makes a separate pane or panes.
  2378.  
  2379. Menus and the Keyboard
  2380. ----------------------
  2381.  
  2382.    When a prefix key ending with a keyboard event (a character or
  2383. function key) has a definition that is a menu keymap, you can use the
  2384. keyboard to choose a menu item.
  2385.  
  2386.    Emacs displays the menu alternatives in the echo area.  If they don't
  2387. all fit at once, type SPC to see the next line of alternatives.  If you
  2388. keep typing SPC, you eventually get to the end of the menu and then
  2389. cycle around to the beginning again.
  2390.  
  2391.    When you have found the alternative you want, type the corresponding
  2392. character--the one whose binding is that alternative.
  2393.  
  2394.    In a menu intended for keyboard use, each menu item must clearly
  2395. indicate what character to type.  The best convention to use is to make
  2396. the character the first letter of the menu item prompt string.  That is
  2397. something users will understand without being told.
  2398.  
  2399. The Menu Bar
  2400. ------------
  2401.  
  2402.    Under X Windows, each frame can have a "menu bar"--a permanently
  2403. displayed menu stretching horizontally across the top of the frame.  The
  2404. items of the menu bar are the subcommands of the fake "function key"
  2405. `menu-bar', as defined by all the active keymaps.
  2406.  
  2407.    To add an item to the menu bar, invent a fake "function key" of your
  2408. own (let's call it KEY), and make a binding for the key sequence
  2409. `[menu-bar KEY]'.  Most often, the binding is a menu keymap, so that
  2410. pressing a button on the menu bar item leads to another menu.
  2411.  
  2412.    In order for a frame to display a menu bar, its `menu-bar-lines'
  2413. property must be greater than zero.  Emacs uses just one line for the
  2414. menu bar itself; if you specify more than one line, the other lines
  2415. serve to separate the menu bar from the windows in the frame.  We
  2416. recommend you try one or two as the `menu-bar-lines' value.
  2417.  
  2418. Keymaps
  2419. =======
  2420.  
  2421.    * The representation of keymaps has changed to support the new event
  2422.      types.  All keymaps now have the form `(keymap ELEMENT ELEMENT
  2423.      ...)'.  Each ELEMENT takes one of the following forms:
  2424.  
  2425.     PROMPT-STRING
  2426.           A string as an element of the keymap marks the keymap as a
  2427.           menu, and serves as the overall prompt string for it.
  2428.  
  2429.     `(KEY . BINDING)'
  2430.           A cons cell binds KEY to DEFINITION.  Here KEY may be any
  2431.           sort of event head--a character, a function key symbol, or a
  2432.           mouse button symbol.
  2433.  
  2434.     VECTOR
  2435.           A vector of 128 elements binds all the ASCII characters; the
  2436.           Nth element holds the binding for character number N.
  2437.  
  2438.     `(t . BINDING)'
  2439.           A cons cell whose CAR is `t' is a default binding; anything
  2440.           not bound by previous keymap elements is given BINDING as its
  2441.           binding.
  2442.  
  2443.           Default bindings are important because they allow a keymap to
  2444.           bind all possible events without having to enumerate all the
  2445.           possible function keys and mouse clicks, with all possible
  2446.           modifier prefixes.
  2447.  
  2448.           The function `lookup-key' (and likewise other functions for
  2449.           examining a key binding) normally report only explicit
  2450.           bindings of the specified key sequence; if there is none,
  2451.           they return `nil', even if there is a default binding that
  2452.           would apply to that key sequence if it were actually typed
  2453.           in.  However, these functions now take an optional argument
  2454.           ACCEPT-DEFAULTS which, if non-`nil', says to consider default
  2455.           bindings.
  2456.  
  2457.           Note that if a vector in the keymap binds an ASCII character
  2458.           to `nil' (thus making it "unbound"), the default binding does
  2459.           not apply to the character.  Think of the vector element as
  2460.           an explicit binding of `nil'.
  2461.  
  2462.           Note also that if the keymap for a minor or major mode
  2463.           contains a default binding, it completely masks out any
  2464.           lower-priority keymaps.
  2465.  
  2466.    * A keymap can now inherit from another keymap.  To do this, make the
  2467.      latter keymap the "tail" of the new one.  Such a keymap looks like
  2468.      this:
  2469.  
  2470.           (keymap BINDINGS... . OTHER-KEYMAP)
  2471.  
  2472.      The effect is that this keymap inherits all the bindings of
  2473.      OTHER-KEYMAP, but can add to them or override them with BINDINGS.
  2474.      Subsequent changes in the bindings of OTHER-KEYMAP *do* affect
  2475.      this keymap.
  2476.  
  2477.      For example,
  2478.  
  2479.           (setq my-mode-map (cons 'keymap text-mode-map))
  2480.  
  2481.      makes a keymap that by default inherits all the bindings of Text
  2482.      mode--whatever they may be at the time a key is looked up.  Any
  2483.      bindings made explicitly in `my-mode-map' override the bindings
  2484.      inherited from Text mode, however.
  2485.  
  2486.    * Minor modes can now have local keymaps.  Thus, a key can act a
  2487.      special way when a minor mode is in effect, and then revert to the
  2488.      major mode or global definition when the minor mode is no longer
  2489.      in effect.  The precedence of keymaps is now: minor modes (in no
  2490.      particular order), then major mode, and lastly the global map.
  2491.  
  2492.      The new `current-minor-mode-maps' function returns a list of all
  2493.      the keymaps of currently enabled minor modes, in the other that
  2494.      they apply.
  2495.  
  2496.      To set up a keymap for a minor mode, add an element to the alist
  2497.      `minor-mode-map-alist'.  Its elements look like this:
  2498.  
  2499.           (SYMBOL . KEYMAP)
  2500.  
  2501.      The keymap KEYMAP is active whenever SYMBOL has a non-`nil' value.
  2502.      Use for SYMBOL the variable which indicates whether the minor
  2503.      mode is enabled.
  2504.  
  2505.      When more than one minor mode keymap is active, their order of
  2506.      precedence is the order of `minor-mode-map-alist'.  But you should
  2507.      design minor modes so that they don't interfere with each other,
  2508.      and if you do this properly, the order will not matter.
  2509.  
  2510.      The function `minor-mode-key-binding' returns a list of all the
  2511.      active minor mode bindings of KEY.  More precisely, it returns an
  2512.      alist of pairs `(MODENAME . BINDING)', where MODENAME is the the
  2513.      variable which enables the minor mode, and BINDING is KEY's
  2514.      definition in that mode.  If KEY has no minor-mode bindings, the
  2515.      value is `nil'.
  2516.  
  2517.      If the first binding is a non-prefix, all subsequent bindings from
  2518.      other minor modes are omitted, since they would be completely
  2519.      shadowed.  Similarly, the list omits non-prefix bindings that
  2520.      follow prefix bindings.
  2521.  
  2522.    * The new function `copy-keymap' copies a keymap, producing a new
  2523.      keymap with the same key bindings in it.  If the keymap contains
  2524.      other keymaps directly, these subkeymaps are copied recursively.
  2525.  
  2526.      If you want to, you can define a prefix key with a binding that is
  2527.      a symbol whose function definition is another keymap.  In this
  2528.      case, `copy-keymap' does not look past the symbol; it doesn't copy
  2529.      the keymap inside the symbol.
  2530.  
  2531.    * `substitute-key-definition' now accepts an optional fourth
  2532.      argument, which is a keymap to use as a template.
  2533.  
  2534.           (substitute-key-definition olddef newdef keymap oldmap)
  2535.  
  2536.      finds all characters defined in OLDMAP as OLDDEF, and defines them
  2537.      in KEYMAP as NEWDEF.
  2538.  
  2539.      In addition, this function now operates recursively on the keymaps
  2540.      that define prefix keys within KEYMAP and OLDMAP.
  2541.  
  2542. Minibuffer Features
  2543. ===================
  2544.  
  2545.    The minibuffer input functions `read-from-minibuffer' and
  2546. `completing-read' have new features.
  2547.  
  2548. Minibuffer History
  2549. ------------------
  2550.  
  2551.    A new optional argument HIST specifies which history list to use.
  2552. If you specify a variable (a symbol), that variable is the history
  2553. list.  If you specify a cons cell `(VARIABLE . STARTPOS)', then
  2554. VARIABLE is the history list variable, and STARTPOS specifies the
  2555. initial history position (an integer, counting from zero which
  2556. specifies the most recent element of the history).
  2557.  
  2558.    If you specify STARTPOS, then you should also specify that element
  2559. of the history as INITIAL-INPUT, for consistency.
  2560.  
  2561.    If you don't specify HIST, then the default history list
  2562. `minibuffer-history' is used.  Other standard history lists that you
  2563. can use when appropriate include `query-replace-history',
  2564. `command-history', and `file-name-history'.
  2565.  
  2566.    The value of the history list variable is a list of strings, most
  2567. recent first.  You should set a history list variable to `nil' before
  2568. using it for the first time.
  2569.  
  2570.    `read-from-minibuffer' and `completing-read' add new elements to the
  2571. history list automatically, and provide commands to allow the user to
  2572. reuse items on the list.  The only thing your program needs to do to
  2573. use a history list is to initialize it and to pass its name to the
  2574. input functions when you wish.  But it is safe to modify the list by
  2575. hand when the minibuffer input functions are not using it.
  2576.  
  2577. Other Minibuffer Features
  2578. -------------------------
  2579.  
  2580.    The INITIAL argument to `read-from-minibuffer' and other minibuffer
  2581. input functions can now be a cons cell `(STRING . POSITION)'.  This
  2582. means to start off with STRING in the minibuffer, but put the cursor
  2583. POSITION characters from the beginning, rather than at the end.
  2584.  
  2585.    In `read-no-blanks-input', the INITIAL argument is now optional; if
  2586. it is omitted, the initial input string is the empty string.
  2587.  
  2588. New Features for Defining Commands
  2589. ==================================
  2590.  
  2591.    * If the interactive specification begins with `@', this means to
  2592.      select the window under the mouse.  This selection takes place
  2593.      before doing anything else with the command.
  2594.  
  2595.      You can use both `@' and `*' together in one command; they are
  2596.      processed in order of appearance.
  2597.  
  2598.    * Prompts in an interactive specification can incorporate the values
  2599.      of the preceding arguments.  Emacs replaces `%'-sequences (as used
  2600.      with the `format' function) in the prompt with the interactive
  2601.      arguments that have been read so far.  For example, a command with
  2602.      this interactive specification
  2603.  
  2604.           (interactive "sReplace: \nsReplace %s with: ")
  2605.  
  2606.      prompts for the first argument with `Replace: ', and then prompts
  2607.      for the second argument with `Replace FOO with: ', where FOO is
  2608.      the string read as the first argument.
  2609.  
  2610.    * If a command name has a property `enable-recursive-minibuffers'
  2611.      which is non-`nil', then the command can use the minibuffer to read
  2612.      arguments even if it is invoked from the minibuffer.  The
  2613.      minibuffer command `next-matching-history-element' (normally bound
  2614.      to `M-s' in the minibuffer) uses this feature.
  2615.  
  2616. New Features for Reading Input
  2617. ==============================
  2618.  
  2619.    * The function `set-input-mode' now takes four arguments.  The last
  2620.      argument is optional.  Their names are INTERRUPT, FLOW, META and
  2621.      QUIT.
  2622.  
  2623.      The argument INTERRUPT says whether to use interrupt-driven input.
  2624.      Non-`nil' means yes, and `nil' means no (use CBREAK mode).
  2625.  
  2626.      The argument FLOW says whether to enable terminal flow control.
  2627.      Non-`nil' means yes.
  2628.  
  2629.      The argument META controls support for input character codes above
  2630.      127.  If META is `t', Emacs converts characters with the 8th bit
  2631.      set into Meta characters.  If META is `nil', Emacs disregards the
  2632.      8th bit; this is necessary when the terminal uses it as a parity
  2633.      bit.  If META is neither `t' nor `nil', Emacs uses all 8 bits of
  2634.      input unchanged.  This is good for terminals using European 8-bit
  2635.      character sets.
  2636.  
  2637.      If QUIT non-`nil', it is the character to use for quitting.
  2638.      (Normally this is `C-g'.)
  2639.  
  2640.    * The variable `meta-flag' has been deleted; use `set-input-mode' to
  2641.      enable or disable support for a META key.  This change was made
  2642.      because `set-input-mode' can send the terminal the appropriate
  2643.      commands to enable or disable operation of the META key.
  2644.  
  2645.    * The new variable `extra-keyboard-modifiers' lets Lisp programs
  2646.      "press" the modifier keys on the keyboard.  The value is a bit
  2647.      mask:
  2648.  
  2649.     1
  2650.           The SHIFT key.
  2651.  
  2652.     2
  2653.           The LOCK key.
  2654.  
  2655.     4
  2656.           The CTL key.
  2657.  
  2658.     8
  2659.           The META key.
  2660.  
  2661.      When you use X windows, the program can press any of the modifier
  2662.      keys in this way.  Otherwise, only the CTL and META keys can be
  2663.      virtually pressed.
  2664.  
  2665.    * You can use the new function `keyboard-translate' to set up
  2666.      `keyboard-translate-table' conveniently.
  2667.  
  2668.    * Y-or-n questions using the `y-or-n-p' function now accept `C-]'
  2669.      (usually mapped to `abort-recursive-edit') as well as `C-g' to
  2670.      quit.
  2671.  
  2672.    * The variable `num-input-keys' is the total number of key sequences
  2673.      that the user has typed during this Emacs session.
  2674.  
  2675.    * A new Lisp variable, `function-key-map', holds a keymap which
  2676.      describes the character sequences sent by function keys on an
  2677.      ordinary character terminal.  This uses the same keymap data
  2678.      structure that is used to hold bindings of key sequences, but it
  2679.      has a different meaning: it specifies translations to make while
  2680.      reading a key sequence.
  2681.  
  2682.      If `function-key-map' "binds" a key sequence K to a vector V, then
  2683.      when K appears as a subsequence *anywhere* in a key sequence, it
  2684.      is replaced with V.
  2685.  
  2686.      For example, VT100 terminals send `ESC O P' when the "keypad" PF1
  2687.      key is pressed.  Thus, on a VT100, `function-key-map' should
  2688.      "bind" that sequence to `[pf1]'.  This specifies translation of
  2689.      `ESC O P' into PF1 anywhere in a key sequence.
  2690.  
  2691.      Thus, typing `C-c PF1' sends the character sequence `C-c ESC O P',
  2692.      but `read-key-sequence' translates this back into `C-c PF1', which
  2693.      it returns as the vector `[?\C-c PF1]'.
  2694.  
  2695.      Entries in `function-key-map' are ignored if they conflict with
  2696.      bindings made in the minor mode, local, or global keymaps.
  2697.  
  2698.      The value of `function-key-map' is usually set up automatically
  2699.      according to the terminal's Terminfo or Termcap entry, and the
  2700.      terminal-specific Lisp files.  Emacs comes with a number of
  2701.      terminal-specific files for many common terminals; their main
  2702.      purpose is to make entries in `function-key-map' beyond those that
  2703.      can be deduced from Termcap and Terminfo.
  2704.  
  2705.    * The variable `key-translation-map' works like `function-key-map'
  2706.      except for two things:
  2707.  
  2708.         * `key-translation-map' goes to work after `function-key-map' is
  2709.           finished; it receives the results of translation by
  2710.           `function-key-map'.
  2711.  
  2712.         * `key-translation-map' overrides actual key bindings.
  2713.  
  2714.      The intent of `key-translation-map' is for users to map one
  2715.      character set to another, including ordinary characters normally
  2716.      bound to `self-insert-command'.
  2717.  
  2718. New Syntax Table Features
  2719. =========================
  2720.  
  2721.    * You can use two new functions to move across characters in certain
  2722.      syntax classes.
  2723.  
  2724.      `skip-syntax-forward' moves point forward across characters whose
  2725.      syntax classes are mentioned in its first argument, a string.  It
  2726.      stops when it encounters the end of the buffer, or position LIM
  2727.      (the optional second argument), or a character it is not supposed
  2728.      to skip.  The function `skip-syntax-backward' is similar but moves
  2729.      backward.
  2730.  
  2731.    * The new function `forward-comment' moves point by comments.  It
  2732.      takes one argument, COUNT; it moves point forward across COUNT
  2733.      comments (backward, if COUNT is negative).  If it finds anything
  2734.      other than a comment or whitespace, it stops, leaving point at the
  2735.      far side of the last comment found.  It also stops after
  2736.      satisfying COUNT.
  2737.  
  2738.    * The new variable `words-include-escapes' affects the behavior of
  2739.      `forward-word' and everything that uses it.  If it is non-`nil',
  2740.      then characters in the "escape" and "character quote" syntax
  2741.      classes count as part of words.
  2742.  
  2743.    * There are two new syntax flags for use in syntax tables.
  2744.  
  2745.         - The prefix flag.
  2746.  
  2747.           The `p' flag identifies additional "prefix characters" in Lisp
  2748.           syntax.  You can set this flag with `modify-syntax-entry' by
  2749.           including the letter `p' in the syntax specification.
  2750.  
  2751.           These characters are treated as whitespace when they appear
  2752.           between expressions.  When they appear withing an expression,
  2753.           they are handled according to their usual syntax codes.
  2754.  
  2755.           The function `backward-prefix-chars' moves back over these
  2756.           characters, as well as over characters whose primary syntax
  2757.           class is prefix (`'').
  2758.  
  2759.         - The `b' comment style flag.
  2760.  
  2761.           Emacs can now supports two comment styles simultaneously.
  2762.           (This is for the sake of C++.)  More specifically, it can
  2763.           recognize two different comment-start sequences.  Both must
  2764.           share the same first character; only the second character may
  2765.           differ.  Mark the second character of the `b'-style comment
  2766.           start sequence with the `b' flag.  You can set this flag with
  2767.           `modify-syntax-entry' by including the letter `b' in the
  2768.           syntax specification.
  2769.  
  2770.           The two styles of comment can have different comment-end
  2771.           sequences.  A comment-end sequence (one or two characters)
  2772.           applies to the `b' style if its first character has the `b'
  2773.           flag set; otherwise, it applies to the `a' style.
  2774.  
  2775.           The appropriate comment syntax settings for C++ are as
  2776.           follows:
  2777.  
  2778.          `/'
  2779.                `124b'
  2780.  
  2781.          `*'
  2782.                `23'
  2783.  
  2784.          newline
  2785.                `>b'
  2786.  
  2787.           Thus `/*' is a comment-start sequence for `a' style, `//' is
  2788.           a comment-start sequence for `b' style, `*/' is a comment-end
  2789.           sequence for `a' style, and newline is a comment-end sequence
  2790.           for `b' style.
  2791.  
  2792. The Case Table
  2793. ==============
  2794.  
  2795.    You can customize case conversion using the new case table feature.
  2796. A case table is a collection of strings that specifies the mapping
  2797. between upper case and lower case letters.  Each buffer has its own
  2798. case table.  You need a case table if you are using a language which
  2799. has letters that are not standard ASCII letters.
  2800.  
  2801.    A case table is a list of this form:
  2802.  
  2803.      (DOWNCASE UPCASE CANONICALIZE EQUIVALENCES)
  2804.  
  2805. where each element is either `nil' or a string of length 256.  The
  2806. element DOWNCASE says how to map each character to its lower-case
  2807. equivalent.  The element UPCASE maps each character to its upper-case
  2808. equivalent.  If lower and upper case characters are in 1-1
  2809. correspondence, use `nil' for UPCASE; then Emacs deduces the upcase
  2810. table from DOWNCASE.
  2811.  
  2812.    For some languages, upper and lower case letters are not in 1-1
  2813. correspondence.  There may be two different lower case letters with the
  2814. same upper case equivalent.  In these cases, you need to specify the
  2815. maps for both directions.
  2816.  
  2817.    The element CANONICALIZE maps each character to a canonical
  2818. equivalent; any two characters that are related by case-conversion have
  2819. the same canonical equivalent character.
  2820.  
  2821.    The element EQUIVALENCES is a map that cyclicly permutes each
  2822. equivalence class (of characters with the same canonical equivalent).
  2823.  
  2824.    You can provide `nil' for both CANONICALIZE and EQUIVALENCES, in
  2825. which case both are deduced from DOWNCASE and UPCASE.
  2826.  
  2827.    Here are the functions for working with case tables:
  2828.  
  2829.    `case-table-p' is a predicate that says whether a Lisp object is a
  2830. valid case table.
  2831.  
  2832.    `set-standard-case-table' takes one argument and makes that argument
  2833. the case table for new buffers created subsequently.
  2834. `standard-case-table' returns the current value of the new buffer case
  2835. table.
  2836.  
  2837.    `current-case-table' returns the case table of the current buffer.
  2838. `set-case-table' sets the current buffer's case table to the argument.
  2839.  
  2840.    `set-case-syntax-pair' is a convenient function for specifying a
  2841. pair of letters, upper case and lower case.  Call it with two arguments,
  2842. the upper case letter and the lower case letter.  It modifies the
  2843. standard case table and a few syntax tables that are predefined in
  2844. Emacs.  This function is intended as a subroutine for packages that
  2845. define non-ASCII character sets.
  2846.  
  2847.    Load the library `iso-syntax' to set up the syntax and case table for
  2848. the 256 bit ISO Latin 1 character set.
  2849.  
  2850. New Features for Dealing with Buffers
  2851. =====================================
  2852.  
  2853.    * The new function `buffer-modified-tick' returns a buffer's
  2854.      modification-count that ticks every time the buffer is modified.
  2855.      It takes one optional argument, which is the buffer you want to
  2856.      examine.  If the argument is `nil' (or omitted), the current
  2857.      buffer is used.
  2858.  
  2859.    * `buffer-disable-undo' is a new name for the function formerly
  2860.      known as `buffer-flush-undo'.  This turns off recording of undo
  2861.      information in the buffer given as argument.
  2862.  
  2863.    * The new function `generate-new-buffer-name' chooses a name that
  2864.      would be unique for a new buffer--but does not create the buffer.
  2865.      Give it one argument, a starting name.  It produces a name not in
  2866.      use for a buffer by appending a number inside of `<...>'.
  2867.  
  2868.    * The function `rename-buffer' now takes an optional second argument
  2869.      which tells it that if the specified new name corresponds to an
  2870.      existing buffer, it should use `generate-new-buffer-name' to
  2871.      modify the name to be unique, rather than signaling an error.
  2872.  
  2873.      `rename-buffer' now returns the name to which the buffer was
  2874.      renamed.
  2875.  
  2876.    * The function `list-buffers' now looks at the local variable
  2877.      `list-buffers-directory' in each non-file-visiting buffer, and
  2878.      shows its value where the file would normally go.  Dired sets this
  2879.      variable in each Dired buffer, so the buffer list now shows which
  2880.      directory each Dired buffer is editing.
  2881.  
  2882.    * The function `other-buffer' now takes an optional second argument
  2883.      VISIBLE-OK which, if non-`nil', indicates that buffers currently
  2884.      being displayed in windows may be returned even if there are other
  2885.      buffers not visible.  Normally, `other-buffer' returns a currently
  2886.      visible buffer only as a last resort, if there are no suitable
  2887.      nonvisible buffers.
  2888.  
  2889.    * The hook `kill-buffer-hook' now runs whenever a buffer is killed.
  2890.  
  2891. Local Variables Features
  2892. ========================
  2893.  
  2894.    * If a local variable name has a non-`nil' `permanent-local'
  2895.      property, then `kill-all-local-variables' does not kill it.  Such
  2896.      local variables are "permanent"--they remain unchanged even if you
  2897.      select a different major mode.
  2898.  
  2899.      Permanent locals are useful when they have to do with where the
  2900.      file came from or how to save it, rather than with how to edit the
  2901.      contents.
  2902.  
  2903.    * The function `make-local-variable' now never changes the value of
  2904.      the variable that it makes local.  If the variable had no value
  2905.      before, it still has no value after becoming local.
  2906.  
  2907.    * The new function `default-boundp' tells you whether a variable has
  2908.      a default value (as opposed to being unbound in its default
  2909.      value).  If `(default-boundp 'foo)' returns `nil', then
  2910.      `(default-value 'foo)' would get an error.
  2911.  
  2912.      `default-boundp' is to `default-value' as `boundp' is to
  2913.      `symbol-value'.
  2914.  
  2915.    * The special forms `defconst' and `defvar', when the variable is
  2916.      local in the current buffer, now set the variable's default value
  2917.      rather than its local value.
  2918.  
  2919. New Features for Subprocesses
  2920. =============================
  2921.  
  2922.    * `call-process' and `call-process-region' now return a value that
  2923.      indicates how the synchronous subprocess terminated.  It is either
  2924.      a number, which is the exit status of a process, or a signal name
  2925.      represented as a string.
  2926.  
  2927.    * `process-status' now returns `open' and `closed' as the status
  2928.      values for network connections.
  2929.  
  2930.    * The standard asynchronous subprocess features work on VMS now, and
  2931.      the special VMS asynchronous subprocess functions have been
  2932.      deleted.
  2933.  
  2934.    * You can use the transaction queue feature for more convenient
  2935.      communication with subprocesses using transactions.
  2936.  
  2937.      Call `tq-create' to create a transaction queue communicating with a
  2938.      specified process.  Then you can call `tq-enqueue' to send a
  2939.      transaction.  `tq-enqueue' takes these five arguments:
  2940.  
  2941.           (tq-enqueue TQ QUESTION REGEXP CLOSURE FN)
  2942.  
  2943.      TQ is the queue to use.  (Specifying the queue has the effect of
  2944.      specifying the process to talk to.)  The argument QUESTION is the
  2945.      outgoing message which starts the transaction.  The argument FN is
  2946.      the function to call when the corresponding answer comes back; it
  2947.      is called with two arguments: CLOSURE, and the answer received.
  2948.  
  2949.      The argument REGEXP is a regular expression to match the entire
  2950.      answer; that's how `tq-enqueue' tells where the answer ends.
  2951.  
  2952.      Call `tq-close' to shut down a transaction queue and terminate its
  2953.      subprocess.
  2954.  
  2955.    * The function `signal-process' sends a signal to process PID, which
  2956.      need not be a child of Emacs.  The second argument SIGNAL
  2957.      specifies which signal to send; it should be an integer.
  2958.  
  2959. New Features for Dealing with Times And Time Delays
  2960. ===================================================
  2961.  
  2962.    * The new function `current-time' returns the system's time value as
  2963.      a list of three integers: `(HIGH LOW MICROSEC)'.  The integers
  2964.      HIGH and LOW combine to give the number of seconds since 0:00
  2965.      January 1, 1970, which is HIGH * 2**16 + LOW.
  2966.  
  2967.      MICROSEC gives the microseconds since the start of the current
  2968.      second (or 0 for systems that return time only on the resolution
  2969.      of a second).
  2970.  
  2971.    * The function `current-time-string' accepts an optional argument
  2972.      TIME-VALUE.  If given, this specifies a time to format instead of
  2973.      the current time.  The argument should be a cons cell containing
  2974.      two integers, or a list whose first two elements are integers.
  2975.      Thus, you can use times obtained from `current-time' (see above)
  2976.      and from `file-attributes'.
  2977.  
  2978.    * You can now find out the user's time zone using
  2979.      `current-time-zone'.
  2980.  
  2981.      The value has the form `(OFFSET NAME)'.  Here OFFSET is an integer
  2982.      giving the number of seconds ahead of UTC (east of Greenwich).  A
  2983.      negative value means west of Greenwich.  The second element, NAME
  2984.      is a string giving the name of the time zone.  Both elements
  2985.      change when daylight savings time begins or ends; if the user has
  2986.      specified a time zone that does not use a seasonal time
  2987.      adjustment, then the value is constant through time.
  2988.  
  2989.      If the operating system doesn't supply all the information
  2990.      necessary to compute the value, both elements of the list are
  2991.      `nil'.
  2992.  
  2993.      The optional argument TIME-VALUE, if given, specifies a time to
  2994.      analyze instead of the current time.  The argument should be a
  2995.      cons cell containing two integers, or a list whose first two
  2996.      elements are integers.  Thus, you can use times obtained from
  2997.      `current-time' and from `file-attributes'.
  2998.  
  2999.    * `sit-for', `sleep-for' now let you specify the time period in
  3000.      milliseconds as well as in seconds.  The first argument gives the
  3001.      number of seconds, as before, and the optional second argument
  3002.      gives additional milliseconds.  The time periods specified by
  3003.      these two arguments are added together.
  3004.  
  3005.      Not all systems support this; you get an error if you specify
  3006.      nonzero milliseconds and it isn't supported.
  3007.  
  3008.      `sit-for' also accepts an optional third argument NODISP.  If this
  3009.      is non-`nil', `sit-for' does not redisplay.  It still waits for
  3010.      the specified time or until input is available.
  3011.  
  3012.    * `accept-process-output' now accepts a timeout specified by optional
  3013.      second and third arguments.  The second argument specifies the
  3014.      number of seconds, while the third specifies the number of
  3015.      milliseconds.  The time periods specified by these two arguments
  3016.      are added together.
  3017.  
  3018.      Not all systems support this; you get an error if you specify
  3019.      nonzero milliseconds and it isn't supported.
  3020.  
  3021.      The function returns `nil' if the timeout expired before output
  3022.      arrived, or non-`nil' if it did get some output.
  3023.  
  3024.    * You can set up a timer to call a function at a specified future
  3025.      time.  To do so, call `run-at-time', like this:
  3026.  
  3027.           (run-at-time TIME REPEAT FUNCTION ARGS...)
  3028.  
  3029.      Here, TIME is a string saying when to call the function.  The
  3030.      argument FUNCTION is the function to call later, and ARGS are the
  3031.      arguments to give it when it is called.
  3032.  
  3033.      The argument REPEAT specifies how often to repeat the call.  If
  3034.      REPEAT is `nil', there are no repetitions; FUNCTION is called just
  3035.      once, at TIME.  If REPEAT is an integer, it specifies a repetition
  3036.      period measured in seconds.
  3037.  
  3038.      Absolute times may be specified in a wide variety of formats; The
  3039.      form `HOUR:MIN:SEC TIMEZONE MONTH/DAY/YEAR', where all fields are
  3040.      numbers, works; the format that `current-time-string' returns is
  3041.      also allowed.
  3042.  
  3043.      To specify a relative time, use numbers followed by units.  For
  3044.      example:
  3045.  
  3046.     `1 min'
  3047.           denotes 1 minute from now.
  3048.  
  3049.     `1 min 5 sec'
  3050.           denotes 65 seconds from now.
  3051.  
  3052.     `1 min 2 sec 3 hour 4 day 5 week 6 fortnight 7 month 8 year'
  3053.           denotes exactly 103 months, 123 days, and 10862 seconds from
  3054.           now.
  3055.  
  3056.      If TIME is an integer, that specifies a relative time measured in
  3057.      seconds.
  3058.  
  3059.    To cancel the requested future action, pass the value that
  3060. `run-at-time' returned to the function `cancel-timer'.
  3061.  
  3062. Profiling Lisp Programs
  3063. =======================
  3064.  
  3065.    You can now make execution-time profiles of Emacs Lisp programs using
  3066. the `profile' library.  See the file `profile.el' for instructions; if
  3067. you have written a Lisp program big enough to be worth profiling, you
  3068. can surely understand them.
  3069.  
  3070. New Features for Lisp Debuggers
  3071. ===============================
  3072.  
  3073.    * You can now specify which kinds of errors should invoke the Lisp
  3074.      debugger by setting the variable `debug-on-error' to a list of
  3075.      error conditions.  For example, if you set it to the list
  3076.      `(void-variable)', then only errors about a variable that has no
  3077.      value invoke the debugger.
  3078.  
  3079.    * The variable `command-debug-status' is used by Lisp debuggers.  It
  3080.      records the debugging status of current interactive command.  Each
  3081.      time a command is called interactively, this variable is bound to
  3082.      `nil'.  The debugger can set this variable to leave information for
  3083.      future debugger invocations during the same command.
  3084.  
  3085.      The advantage of this variable over some other variable in the
  3086.      debugger itself is that the data will not be visible for any other
  3087.      command invocation.
  3088.  
  3089.    * The function `backtrace-frame' is intended for use in Lisp
  3090.      debuggers.  It returns information about what a frame on the Lisp
  3091.      call stack is doing.  You specify one argument, which is the
  3092.      number of stack frames to count up from the current execution
  3093.      point.
  3094.  
  3095.      If that stack frame has not evaluated the arguments yet (or is a
  3096.      special form), the value is `(nil FUNCTION ARG-FORMS...)'.
  3097.  
  3098.      If that stack frame has evaluated its arguments and called its
  3099.      function already, the value is `(t FUNCTION ARG-VALUES...)'.
  3100.  
  3101.      In the return value, FUNCTION is whatever was supplied as CAR of
  3102.      evaluated list, or a `lambda' expression in the case of a macro
  3103.      call.  If the function has a `&rest' argument, that is represented
  3104.      as the tail of the list ARG-VALUES.
  3105.  
  3106.      If the argument is out of range, `backtrace-frame' returns `nil'.
  3107.  
  3108. Memory Allocation Changes
  3109. =========================
  3110.  
  3111.    The list that `garbage-collect' returns now has one additional
  3112. element.  This is a cons cell containing two numbers.  It gives
  3113. information about the number of used and free floating point numbers,
  3114. much as the first element gives such information about the number of
  3115. used and free cons cells.
  3116.  
  3117.    The new function `memory-limit' returns an indication of the last
  3118. address allocated by Emacs.  More precisely, it returns that address
  3119. divided by 1024.  You can use this to get a general idea of how your
  3120. actions affect the memory usage.
  3121.  
  3122. Hook Changes
  3123. ============
  3124.  
  3125.    * Expanding an abbrev first runs the new hook
  3126.      `pre-abbrev-expand-hook'.
  3127.  
  3128.    * The editor command loop runs the normal hook `pre-command-hook'
  3129.      before each command, and runs `post-command-hook' after each
  3130.      command.
  3131.  
  3132.    * Auto-saving runs the new hook `auto-save-hook' before actually
  3133.      starting to save any files.
  3134.  
  3135.    * The new variable `revert-buffer-insert-file-contents-function'
  3136.      holds a function that `revert-buffer' now uses to read in the
  3137.      contents of the reverted buffer--instead of calling
  3138.      `insert-file-contents'.
  3139.  
  3140.    * The variable `lisp-indent-hook' has been renamed to
  3141.      `lisp-indent-function'.
  3142.  
  3143.    * The variable `auto-fill-hook' has been renamed to
  3144.      `auto-fill-function'.
  3145.  
  3146.    * The variable `blink-paren-hook' has been renamed to
  3147.      `blink-paren-function'.
  3148.  
  3149.    * The variable `temp-buffer-show-hook' has been renamed to
  3150.      `temp-buffer-show-function'.
  3151.  
  3152.    * The variable `suspend-hook' is now a normal hook.  It used to be a
  3153.      special kind of hook; its value had to be a single function, and
  3154.      if the function returned a non-`nil' value, then suspension was
  3155.      inhibited.
  3156.  
  3157.    * The new function `add-hook' provides a handy way to add a function
  3158.      to a hook variable.  For example,
  3159.  
  3160.           (add-hook 'text-mode-hook 'my-text-hook-function)
  3161.  
  3162.      arranges to call `my-text-hook-function' when entering Text mode
  3163.      or related modes.
  3164.  
  3165.      `add-hook' takes an optional third argument which says to add the
  3166.      new hook function at the end of the list (normally, it goes at the
  3167.      beginning).
  3168.  
  3169.