home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / GNU / emacs.inst / emacs19.idb / usr / gnu / info / elisp-23.z / elisp-23
Encoding:
GNU Info File  |  1994-08-02  |  50.3 KB  |  1,181 lines

  1. This is Info file elisp, produced by Makeinfo-1.55 from the input file
  2. elisp.texi.
  3.  
  4.    This version is newer than the second printed edition of the GNU
  5. Emacs Lisp Reference Manual.  It corresponds to Emacs Version 19.19.
  6.  
  7.    Published by the Free Software Foundation 675 Massachusetts Avenue
  8. Cambridge, MA 02139 USA
  9.  
  10.    Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
  11.  
  12.    Permission is granted to make and distribute verbatim copies of this
  13. manual provided the copyright notice and this permission notice are
  14. preserved on all copies.
  15.  
  16.    Permission is granted to copy and distribute modified versions of
  17. this manual under the conditions for verbatim copying, provided that
  18. the entire resulting derived work is distributed under the terms of a
  19. permission notice identical to this one.
  20.  
  21.    Permission is granted to copy and distribute translations of this
  22. manual into another language, under the above conditions for modified
  23. versions, except that this permission notice may be stated in a
  24. translation approved by the Foundation.
  25.  
  26.    Permission is granted to copy and distribute modified versions of
  27. this manual under the conditions for verbatim copying, provided also
  28. that the section entitled "GNU Emacs General Public License" is included
  29. exactly as in the original, and provided that the entire resulting
  30. derived work is distributed under the terms of a permission notice
  31. identical to this one.
  32.  
  33.    Permission is granted to copy and distribute translations of this
  34. manual into another language, under the above conditions for modified
  35. versions, except that the section entitled "GNU Emacs General Public
  36. License" may be included in a translation approved by the Free Software
  37. Foundation instead of in the original English.
  38.  
  39. 
  40. File: elisp,  Node: Kill Functions,  Next: Yank Commands,  Prev: Kill Ring Concepts,  Up: The Kill Ring
  41.  
  42. Functions for Killing
  43. ---------------------
  44.  
  45.    `kill-region' is the usual subroutine for killing text.  Any command
  46. that calls this function is a "kill command" (and should probably have
  47. `kill' in its name).  `kill-region' puts the newly killed text in a new
  48. element at the beginning of the kill ring or adds it to the most recent
  49. element.  It uses the `last-command' variable to keep track of whether
  50. the previous was a kill command, and in such cases appends the killed
  51. text to the most recent entry.
  52.  
  53.  - Command: kill-region START END
  54.      This function kills the text in the region defined by START and
  55.      END.  The text is deleted but saved in the kill ring.  The value
  56.      is always `nil'.
  57.  
  58.      In an interactive call, START and END are point and the mark.
  59.  
  60.      If the buffer is read-only, `kill-region' modifies the kill ring
  61.      just the same, then signals an error without modifying the buffer.
  62.      This is convenient because it lets the user use all the kill
  63.      commands to copy text into the kill ring from a read-only buffer.
  64.  
  65.  - Command: copy-region-as-kill START END
  66.      This function saves the region defined by START and END on the
  67.      kill ring, but does not delete the text from the buffer.  It
  68.      returns `nil'.  It also indicates the extent of the text copied by
  69.      moving the cursor momentarily, or by displaying a message in the
  70.      echo area.
  71.  
  72.      Don't use this command in Lisp programs; use `kill-new' or
  73.      `kill-append' instead.  *Note Low Level Kill Ring::.
  74.  
  75.      In an interactive call, START and END are point and the mark.
  76.  
  77. 
  78. File: elisp,  Node: Yank Commands,  Next: Low Level Kill Ring,  Prev: Kill Functions,  Up: The Kill Ring
  79.  
  80. Functions for Yanking
  81. ---------------------
  82.  
  83.  - Command: yank &optional ARG
  84.      This function inserts the text in the first entry in the kill ring
  85.      directly before point.  After the yank, the mark is positioned at
  86.      the beginning and point is positioned after the end of the
  87.      inserted text.
  88.  
  89.      If ARG is a list (which occurs interactively when the user types
  90.      `C-u' with no digits), then `yank' inserts the text as described
  91.      above, but puts point before the yanked text and puts the mark
  92.      after it.  If ARG is a number, then `yank' inserts the ARGth most
  93.      recently killed text.
  94.  
  95.      `yank' does not alter the contents of the kill ring or rotate it.
  96.      It returns `nil'.
  97.  
  98.  - Command: yank-pop ARG
  99.      This function replaces the just-yanked text with another batch of
  100.      killed text--another element of the kill ring.
  101.  
  102.      This command is allowed only immediately after a `yank' or a
  103.      `yank-pop'.  At such a time, the region contains text that was just
  104.      inserted by the previous `yank'.  `yank-pop' deletes that text and
  105.      inserts in its place a different stretch of killed text.  The text
  106.      that is deleted is not inserted into the kill ring, since it is
  107.      already in the kill ring somewhere.
  108.  
  109.      If ARG is `nil', then the existing region contents are replaced
  110.      with the previous element of the kill ring.  If ARG is numeric,
  111.      then the ARGth previous kill is the replacement.  If ARG is
  112.      negative, a more recent kill is the replacement.
  113.  
  114.      The sequence of kills in the kill ring wraps around, so that after
  115.      the oldest one comes the newest one, and before the newest one
  116.      goes the oldest.
  117.  
  118.      The value is always `nil'.
  119.  
  120. 
  121. File: elisp,  Node: Low Level Kill Ring,  Next: Internals of Kill Ring,  Prev: Yank Commands,  Up: The Kill Ring
  122.  
  123. Low Level Kill Ring
  124. -------------------
  125.  
  126.    These functions and variables provide access to the kill ring at a
  127. lower level, but still convenient for use in Lisp programs.  They take
  128. care of interaction with X Window selections.  They do not exist in
  129. Emacs version 18.
  130.  
  131.  - Function: current-kill N &optional DO-NOT-MOVE
  132.      The function `current-kill' rotates the yanking pointer in the
  133.      kill ring by N places, and returns the text at that place in the
  134.      ring.
  135.  
  136.      If the optional second argument DO-NOT-MOVE is non-`nil', then
  137.      `current-kill' doesn't alter the yanking pointer; it just returns
  138.      the Nth kill forward from the current yanking pointer.
  139.  
  140.      If N is zero, indicating a request for the latest kill,
  141.      `current-kill' calls the value of `interprogram-paste-function'
  142.      (documented below) before consulting the kill ring.
  143.  
  144.  - Function: kill-new STRING
  145.      This function puts the text STRING into the kill ring as a new
  146.      entry at the front of the ring.  It also discards the oldest entry
  147.      if appropriate.  It also invokes the value of
  148.      `interprogram-cut-function' (see below).
  149.  
  150.  - Function: kill-append STRING BEFORE-P
  151.      This function appends the text STRING to the first entry in the
  152.      kill ring.  Normally STRING goes at the end of the entry, but if
  153.      BEFORE-P is non-`nil', it goes at the beginning.  This function
  154.      also invokes the value of `interprogram-cut-function' (see below).
  155.  
  156.  - Variable: interprogram-paste-function
  157.      This variable provides a way of transferring killed text from other
  158.      programs, when you are using a window system.  Its value should be
  159.      `nil' or a function of no arguments.
  160.  
  161.      If the value is a function, it is called when the "most recent
  162.      kill" value is called for.  If the function returns a non-`nil'
  163.      values, then that value is used as the "most recent kill".  If it
  164.      returns `nil', then the first element of the kill ring is used.
  165.  
  166.  - Variable: interprogram-cut-function
  167.      This variable provides a way of communicating killed text to and
  168.      from other programs, when you are using a window system.  Its
  169.      value should be `nil' or a function of one argument.
  170.  
  171.      If the value is a function, it is called whenever the "most recent
  172.      kill" is changed, with the new string of killed text as an
  173.      argument.
  174.  
  175. 
  176. File: elisp,  Node: Internals of Kill Ring,  Prev: Low Level Kill Ring,  Up: The Kill Ring
  177.  
  178. Internals of the Kill Ring
  179. --------------------------
  180.  
  181.    The variable `kill-ring' holds the kill ring contents, in the form
  182. of a list of strings.  The most recent kill is always at the front of
  183. the list.
  184.  
  185.    The `kill-ring-yank-pointer' variable points to a link in the kill
  186. ring list, whose CAR is the text that "yank" functions should copy.
  187. Moving `kill-ring-yank-pointer' to a different link is called "rotating
  188. the kill ring".  We call the kill ring a "ring" because the functions
  189. that move the yank pointer wrap around from the end of the list to the
  190. beginning, or vice-versa.  Rotating the ring does not change the value
  191. of `kill-ring'.
  192.  
  193.    Both `kill-ring' and `kill-ring-yank-pointer' are Lisp variables
  194. whose values are normally lists.  The word "pointer" in the name of the
  195. `kill-ring-yank-pointer' indicates that the variable's purpose is to
  196. identify one element of the list for use by the next yank command.
  197.  
  198.    The value of `kill-ring-yank-pointer' is always `eq' to one of the
  199. links in the kill ring list.  The element it identifies is the CAR of
  200. that link.  Commands which change the text in the kill ring also set
  201. this variable from `kill-ring'.  The effect is to rotate the ring so
  202. that the newly killed text is at front.
  203.  
  204.    Here is a diagram that shows the variable `kill-ring-yank-pointer'
  205. pointing to the second entry in the kill ring `("some text" "a
  206. different piece of text" "yet more text")'.
  207.  
  208.      kill-ring       kill-ring-yank-pointer
  209.        |               |
  210.        |     ___ ___    --->  ___ ___      ___ ___
  211.         --> |___|___|------> |___|___|--> |___|___|--> nil
  212.               |                |            |
  213.               |                |            |
  214.               |                |             -->"yet more text"
  215.               |                |
  216.               |                 --> "a different piece of text"
  217.               |
  218.                --> "some text"
  219.  
  220. This circumstance might occur after `C-y' (`yank') immediately followed
  221. by `M-y' (`yank-pop').
  222.  
  223.  - Variable: kill-ring
  224.      List of killed text sequences, most recently killed first.
  225.  
  226.  - Variable: kill-ring-yank-pointer
  227.      This variable's value indicates which element of the kill ring is
  228.      at the "front" of the ring for yanking.  More precisely, the value
  229.      is a sublist of the value of `kill-ring', and its CAR is the kill
  230.      string that `C-y' should yank.
  231.  
  232.  - User Option: kill-ring-max
  233.      The value of this variable is the maximum length to which the kill
  234.      ring can grow, before elements are thrown away at the end.  The
  235.      default value for `kill-ring-max' is 30.
  236.  
  237. 
  238. File: elisp,  Node: Undo,  Next: Maintaining Undo,  Prev: The Kill Ring,  Up: Text
  239.  
  240. Undo
  241. ====
  242.  
  243.    Most buffers have an "undo list" which records all changes made to
  244. the buffer's text so that they can be undone.  (The buffers which don't
  245. have one are usually special-purpose buffers for which Emacs assumes
  246. that undoing is not useful.)  All the primitives which modify the text
  247. in the buffer automatically add elements to the front of the undo list,
  248. which you can find in the variable `buffer-undo-list'.
  249.  
  250.  - Variable: buffer-undo-list
  251.      This variable's value is the undo list of the current buffer.  A
  252.      value of `t' disables the recording of undo information.
  253.  
  254.    Here are the kinds of elements an undo list can have:
  255.  
  256. `INTEGER'
  257.      This kind of element records a previous value of point.  Ordinary
  258.      cursor motion does not get any sort of undo record, but these
  259.      entries are used to record where point was before a deletion.
  260.  
  261. `(BEG . END)'
  262.      This kind of element indicates how to delete text that was
  263.      inserted.  Upon insertion, the text occupied the range BEG-END in
  264.      the buffer.
  265.  
  266. `(POS . DELETED)'
  267.      This kind of element indicates how to reinsert text that was
  268.      deleted.  The deleted text itself is the string DELETED.  The
  269.      place to reinsert it is POS.
  270.  
  271. `(t HIGH . LOW)'
  272.      This kind of element indicates that an unmodified buffer became
  273.      modified.  The elements HIGH and LOW are two integers, each
  274.      recording 16 bits of the visited file's modification time as of
  275.      when it was previously visited or saved.  `primitive-undo' uses
  276.      those values to determine whether to mark the buffer as unmodified
  277.      once again; it does so only if the file's modification time
  278.      matches those numbers.
  279.  
  280. `(nil PROPERTY VALUE BEG . END)'
  281.      This kind of element records a change in a text property.  Here's
  282.      how you might undo the change:
  283.  
  284.           (put-text-property BEG END
  285.                              PROPERTY VALUE)
  286.  
  287. `nil'
  288.      This element is a boundary.  The function `undo-boundary' adds
  289.      these elements.  The elements between two boundaries are called a
  290.      "change group"; normally, each change group corresponds to one
  291.      keyboard command, and undo commands normally undo an entire group
  292.      as a unit.
  293.  
  294.  - Function: undo-boundary
  295.      This function places a boundary element in the undo list.  The undo
  296.      command stops at such a boundary, and successive undo commands undo
  297.      to earlier and earlier boundaries.  This function returns `nil'.
  298.  
  299.      The editor command loop automatically creates an undo boundary
  300.      between keystroke commands.  Thus, each undo normally undoes the
  301.      effects of one command.  Calling this function explicitly is
  302.      useful for splitting the effects of a command into more than one
  303.      unit.  For example, `query-replace' calls this function after each
  304.      replacement so that the user can undo individual replacements one
  305.      by one.
  306.  
  307.  - Function: primitive-undo COUNT LIST
  308.      This is the basic function for undoing elements of an undo list.
  309.      It undoes the first COUNT elements of LIST, returning the rest of
  310.      LIST.  You could write this function in Lisp, but it is convenient
  311.      to have it in C.
  312.  
  313.      `primitive-undo' adds elements to the buffer's undo list.  Undo
  314.      commands avoid confusion by saving the undo list value at the
  315.      beginning of a sequence of undo operations.  Then the undo
  316.      operations use and update the saved value.  The new elements added
  317.      by undoing never get into the saved value, so they don't cause any
  318.      trouble.
  319.  
  320. 
  321. File: elisp,  Node: Maintaining Undo,  Next: Auto Filling,  Prev: Undo,  Up: Text
  322.  
  323. Maintaining Undo Lists
  324. ======================
  325.  
  326.    This section describes how to enable and disable undo information for
  327. a given buffer.  It also explains how data from the undo list is
  328. discarded automatically so it doesn't get too big.
  329.  
  330.    Recording of undo information in a newly created buffer is normally
  331. enabled to start with; but if the buffer name starts with a space, the
  332. undo recording is initially disabled.  You can explicitly enable or
  333. disable undo recording with the following two functions, or by setting
  334. `buffer-undo-list' yourself.
  335.  
  336.  - Command: buffer-enable-undo &optional BUFFER-OR-NAME
  337.      This function enables recording undo information for buffer
  338.      BUFFER-OR-NAME, so that subsequent changes can be undone.  If no
  339.      argument is supplied, then the current buffer is used.  This
  340.      function does nothing if undo recording is already enabled in the
  341.      buffer.  It returns `nil'.
  342.  
  343.      In an interactive call, BUFFER-OR-NAME is the current buffer.  You
  344.      cannot specify any other buffer.
  345.  
  346.  - Function: buffer-disable-undo BUFFER
  347.  - Function: buffer-flush-undo BUFFER
  348.      This function discards the undo list of BUFFER, and disables
  349.      further recording of undo information.  As a result, it is no
  350.      longer possible to undo either previous changes or any subsequent
  351.      changes.  If the undo list of BUFFER is already disabled, this
  352.      function has no effect.
  353.  
  354.      This function returns `nil'.  It cannot be called interactively.
  355.  
  356.      The name `buffer-flush-undo' is not considered obsolete, but the
  357.      preferred name `buffer-disable-undo' was not provided in Emacs
  358.      versions 18 and earlier.
  359.  
  360.    As editing continues, undo lists get longer and longer.  To prevent
  361. them from using up all available memory space, garbage collection trims
  362. them back to size limits you can set.  (For this purpose, the "size" of
  363. an undo list measures the cons cells that make up the list, plus the
  364. strings of deleted text.)  Two variables control the range of acceptable
  365. sizes: `undo-limit' and `undo-strong-limit'.
  366.  
  367.  - Variable: undo-limit
  368.      This is the soft limit for the acceptable size of an undo list.
  369.      The change group at which this size is exceeded is the last one
  370.      kept.
  371.  
  372.  - Variable: undo-strong-limit
  373.      The upper limit for the acceptable size of an undo list.  The
  374.      change group at which this size is exceeded is discarded itself
  375.      (along with all subsequent changes).  There is one exception:
  376.      garbage collection always keeps the very last change group no
  377.      matter how big it is.
  378.  
  379. 
  380. File: elisp,  Node: Filling,  Next: Sorting,  Prev: Auto Filling,  Up: Text
  381.  
  382. Filling
  383. =======
  384.  
  385.    "Filling" means adjusting the lengths of lines (by moving words
  386. between them) so that they are nearly (but no greater than) a specified
  387. maximum width.  Additionally, lines can be "justified", which means
  388. that spaces are inserted between words to make the line exactly the
  389. specified width.  The width is controlled by the variable
  390. `fill-column'.  For ease of reading, lines should be no longer than 70
  391. or so columns.
  392.  
  393.    You can use Auto Fill mode (*note Auto Filling::.) to fill text
  394. automatically as you insert it, but changes to existing text may leave
  395. it improperly filled.  Then you must fill the text explicitly.
  396.  
  397.    Most of the functions in this section return values that are not
  398. meaningful.
  399.  
  400.  - Command: fill-paragraph JUSTIFY-FLAG
  401.      This function fills the paragraph at or after point.  If
  402.      JUSTIFY-FLAG is non-`nil', each line is justified as well.  It
  403.      uses the ordinary paragraph motion commands to find paragraph
  404.      boundaries.
  405.  
  406.  - Command: fill-region START END &optional JUSTIFY-FLAG
  407.      This function fills each of the paragraphs in the region from
  408.      START to END.  It justifies as well if JUSTIFY-FLAG is non-`nil'.
  409.      (In an interactive call, this is true if there is a prefix
  410.      argument.)
  411.  
  412.      The variable `paragraph-separate' controls how to distinguish
  413.      paragraphs.
  414.  
  415.  - Command: fill-individual-paragraphs START END &optional JUSTIFY-FLAG
  416.           MAIL-FLAG
  417.      This function fills each paragraph in the region according to its
  418.      individual fill prefix.  Thus, if the lines of a paragraph are
  419.      indented with spaces, the filled paragraph will continue to be
  420.      indented in the same fashion.
  421.  
  422.      The first two arguments, START and END, are the beginning and end
  423.      of the region that will be filled.  The third and fourth
  424.      arguments, JUSTIFY-FLAG and MAIL-FLAG, are optional.  If
  425.      JUSTIFY-FLAG is non-`nil', the paragraphs are justified as well as
  426.      filled.  If MAIL-FLAG is non-`nil', the function is told that it
  427.      is operating on a mail message and therefore should not fill the
  428.      header lines.
  429.  
  430.      Ordinarily, `fill-individual-paragraphs' regards each change in
  431.      indentation as starting a new paragraph.  If
  432.      `fill-individual-varying-indent' is non-`nil', then only separator
  433.      lines separate paragraphs.  That mode can handle paragraphs with
  434.      extra indentation on the first line.
  435.  
  436.  - User Option: fill-individual-varying-indent
  437.      This variable alters the action of `fill-individual-paragraphs' as
  438.      described above.
  439.  
  440.  - Command: fill-region-as-paragraph START END &optional JUSTIFY-FLAG
  441.      This function considers a region of text as a paragraph and fills
  442.      it.  If the region was made up of many paragraphs, the blank lines
  443.      between paragraphs are removed.  This function justifies as well
  444.      as filling when JUSTIFY-FLAG is non-`nil'.  In an interactive
  445.      call, any prefix argument requests justification.
  446.  
  447.      In Adaptive Fill mode, which is enabled by default,
  448.      `fill-region-as-paragraph' on an indented paragraph when there is
  449.      no fill prefix uses the indentation of the second line of the
  450.      paragraph as the fill prefix.
  451.  
  452.  - Command: justify-current-line
  453.      This function inserts spaces between the words of the current line
  454.      so that the line ends exactly at `fill-column'.  It returns `nil'.
  455.  
  456.  - User Option: fill-column
  457.      This buffer-local variable specifies the maximum width of filled
  458.      lines.  Its value should be an integer, which is a number of
  459.      columns.  All the filling, justification and centering commands
  460.      are affected by this variable, including Auto Fill mode (*note
  461.      Auto Filling::.).
  462.  
  463.      As a practical matter, if you are writing text for other people to
  464.      read, you should set `fill-column' to no more than 70.  Otherwise
  465.      the line will be too long for people to read comfortably, and this
  466.      can make the text seem clumsy.
  467.  
  468.  - Variable: default-fill-column
  469.      The value of this variable is the default value for `fill-column'
  470.      in buffers that do not override it.  This is the same as
  471.      `(default-value 'fill-column)'.
  472.  
  473.      The default value for `default-fill-column' is 70.
  474.  
  475. 
  476. File: elisp,  Node: Auto Filling,  Next: Filling,  Prev: Maintaining Undo,  Up: Text
  477.  
  478. Auto Filling
  479. ============
  480.  
  481.    "Filling" breaks text into lines that are no more than a specified
  482. number of columns wide.  Filled lines end between words, and therefore
  483. may have to be shorter than the maximum width.
  484.  
  485.    Auto Fill mode is a minor mode in which Emacs fills lines
  486. automatically as text as inserted.  This section describes the hook and
  487. the two variables used by Auto Fill mode.  For a description of
  488. functions that you can call manually to fill and justify text, see
  489. *Note Filling::.
  490.  
  491.  - Variable: auto-fill-function
  492.      The value of this variable should be a function (of no arguments)
  493.      to be called after self-inserting a space at a column beyond
  494.      `fill-column'.  It may be `nil', in which case nothing special is
  495.      done.
  496.  
  497.      The default value for `auto-fill-function' is `do-auto-fill', a
  498.      function whose sole purpose is to implement the usual strategy for
  499.      breaking a line.
  500.  
  501.           In older Emacs versions, this variable was named
  502.           `auto-fill-hook', but since it is not called with the
  503.           standard convention for hooks, it was renamed to
  504.           `auto-fill-function' in version 19.
  505.  
  506. 
  507. File: elisp,  Node: Sorting,  Next: Indentation,  Prev: Filling,  Up: Text
  508.  
  509. Sorting Text
  510. ============
  511.  
  512.    The sorting commands described in this section all rearrange text in
  513. a buffer.  This is in contrast to the function `sort', which rearranges
  514. the order of the elements of a list (*note Rearrangement::.).  The
  515. values returned by these commands are not meaningful.
  516.  
  517.  - Command: sort-regexp-fields REVERSE RECORD-REGEXP KEY-REGEXP START
  518.           END
  519.      This command sorts the region between START and END alphabetically
  520.      as specified by RECORD-REGEXP and KEY-REGEXP.  If REVERSE is a
  521.      negative integer, then sorting is in reverse order.
  522.  
  523.      Alphabetical sorting means that two sort keys are compared by
  524.      comparing the first characters of each, the second characters of
  525.      each, and so on.  If a mismatch is found, it means that the sort
  526.      keys are unequal; the sort key whose character is less at the
  527.      point of first mismatch is the lesser sort key.  The individual
  528.      characters are compared according to their numerical values.
  529.      Since Emacs uses the ASCII character set, the ordering in that set
  530.      determines alphabetical order.
  531.  
  532.      The value of the RECORD-REGEXP argument specifies the textual
  533.      units or "records" that should be sorted.  At the end of each
  534.      record, a search is done for this regular expression, and the text
  535.      that matches it is the next record.  For example, the regular
  536.      expression `^.+$', which matches lines with at least one character
  537.      besides a newline, would make each such line into a sort record.
  538.      *Note Regular Expressions::, for a description of the syntax and
  539.      meaning of regular expressions.
  540.  
  541.      The value of the KEY-REGEXP argument specifies what part of each
  542.      record is to be compared against the other records.  The
  543.      KEY-REGEXP could match the whole record, or only a part.  In the
  544.      latter case, the rest of the record has no effect on the sorted
  545.      order of records, but it is carried along when the record moves to
  546.      its new position.
  547.  
  548.      The KEY-REGEXP argument can refer to the text matched by a
  549.      subexpression of RECORD-REGEXP, or it can be a regular expression
  550.      on its own.
  551.  
  552.      If KEY-REGEXP is:
  553.  
  554.     `\DIGIT'
  555.           then the text matched by the DIGITth `\(...\)' parenthesis
  556.           grouping in RECORD-REGEXP is used for sorting.
  557.  
  558.     `\&'
  559.           then the whole record is used for sorting.
  560.  
  561.     a regular expression
  562.           then the function searches for a match for the regular
  563.           expression within the record.  If such a match is found, it
  564.           is used for sorting.  If a match for KEY-REGEXP is not found
  565.           within a record then that record is ignored, which means its
  566.           position in the buffer is not changed.  (The other records
  567.           may move around it.)
  568.  
  569.      For example, if you plan to sort all the lines in the region by the
  570.      first word on each line starting with the letter `f', you should
  571.      set RECORD-REGEXP to `^.*$' and set KEY-REGEXP to `\<f\w*\>'.  The
  572.      resulting expression looks like this:
  573.  
  574.           (sort-regexp-fields nil "^.*$" "\\<f\\w*\\>"
  575.                               (region-beginning)
  576.                               (region-end))
  577.  
  578.      If you call `sort-regexp-fields' interactively, you are prompted
  579.      for RECORD-REGEXP and KEY-REGEXP in the minibuffer.
  580.  
  581.  - Command: sort-subr REVERSE NEXTRECFUN ENDRECFUN &optional
  582.           STARTKEYFUN ENDKEYFUN
  583.      This command is the general text sorting routine that divides a
  584.      buffer into records and sorts them.  The functions `sort-lines',
  585.      `sort-paragraphs', `sort-pages', `sort-fields',
  586.      `sort-regexp-fields' and `sort-numeric-fields' all use `sort-subr'.
  587.  
  588.      To understand how `sort-subr' works, consider the whole accessible
  589.      portion of the buffer as being divided into disjoint pieces called
  590.      "sort records".  A portion of each sort record (perhaps all of it)
  591.      is designated as the sort key.  The records are rearranged in the
  592.      buffer in order by their sort keys.  The records may or may not be
  593.      contiguous.
  594.  
  595.      Usually, the records are rearranged in order of ascending sort key.
  596.      If the first argument to the `sort-subr' function, REVERSE, is
  597.      non-`nil', the sort records are rearranged in order of descending
  598.      sort key.
  599.  
  600.      The next four arguments to `sort-subr' are functions that are
  601.      called to move point across a sort record.  They are called many
  602.      times from within `sort-subr'.
  603.  
  604.        1. NEXTRECFUN is called with point at the end of a record.  This
  605.           function moves point to the start of the next record.  The
  606.           first record is assumed to start at the position of point
  607.           when `sort-subr' is called.  (Therefore, you should usually
  608.           move point to the beginning of the buffer before calling
  609.           `sort-subr'.)
  610.  
  611.           This function can indicate there are no more sort records by
  612.           leaving point at the end of the buffer.
  613.  
  614.        2. ENDRECFUN is called with point within a record.  It moves
  615.           point to the end of the record.
  616.  
  617.        3. STARTKEYFUN is called to move point from the start of a
  618.           record to the start of the sort key.  This argument is
  619.           optional.  If supplied, the function should either return a
  620.           non-`nil' value to be used as the sort key, or return `nil'
  621.           to indicate that the sort key is in the buffer starting at
  622.           point.  In the latter case, ENDKEYFUN is called to find the
  623.           end of the sort key.
  624.  
  625.        4. ENDKEYFUN is called to move point from the start of the sort
  626.           key to the end of the sort key.  This argument is optional.
  627.           If STARTKEYFUN returns `nil' and this argument is omitted (or
  628.           `nil'), then the sort key extends to the end of the record.
  629.           There is no need for ENDKEYFUN if STARTKEYFUN returns a
  630.           non-`nil' value.
  631.  
  632.      As an example of `sort-subr', here is the complete function
  633.      definition for `sort-lines':
  634.  
  635.           ;; Note that the first two lines of doc string
  636.           ;; are effectively one line when viewed by a user.
  637.           (defun sort-lines (reverse beg end)
  638.             "Sort lines in region alphabetically;\
  639.            argument means descending order.
  640.           Called from a program, there are three arguments:
  641.           REVERSE (non-nil means reverse order),
  642.           and BEG and END (the region to sort)."
  643.             (interactive "P\nr")
  644.             (save-restriction
  645.               (narrow-to-region beg end)
  646.               (goto-char (point-min))
  647.               (sort-subr reverse
  648.                          'forward-line
  649.                          'end-of-line)))
  650.  
  651.      Here `forward-line' moves point to the start of the next record,
  652.      and `end-of-line' moves point to the end of record.  We do not pass
  653.      the arguments STARTKEYFUN and ENDKEYFUN, because the entire record
  654.      is used as the sort key.
  655.  
  656.      The `sort-paragraphs' function is very much the same, except that
  657.      its `sort-subr' call looks like this:
  658.  
  659.           (sort-subr reverse
  660.                      (function
  661.                       (lambda ()
  662.                         (skip-chars-forward "\n \t\f")))
  663.                      'forward-paragraph)
  664.  
  665.  - Command: sort-lines REVERSE START END
  666.      This command sorts lines in the region between START and END
  667.      alphabetically.  If REVERSE is non-`nil', the sort is in reverse
  668.      order.
  669.  
  670.  - Command: sort-paragraphs REVERSE START END
  671.      This command sorts paragraphs in the region between START and END
  672.      alphabetically.  If REVERSE is non-`nil', the sort is in reverse
  673.      order.
  674.  
  675.  - Command: sort-pages REVERSE START END
  676.      This command sorts pages in the region between START and END
  677.      alphabetically.  If REVERSE is non-`nil', the sort is in reverse
  678.      order.
  679.  
  680.  - Command: sort-fields FIELD START END
  681.      This command sorts lines in the region between START and END,
  682.      comparing them alphabetically by the FIELDth field of each line.
  683.      Fields are separated by whitespace and numbered starting from 1.
  684.      If FIELD is negative, sorting is by the -FIELDth field from the
  685.      end of the line.  This command is useful for sorting tables.
  686.  
  687.  - Command: sort-numeric-fields FIELD START END
  688.      This command sorts lines in the region between START and END,
  689.      comparing them numerically by the FIELDth field of each line.
  690.      Fields are separated by whitespace and numbered starting from 1.
  691.      The specified field must contain a number in each line of the
  692.      region.  If FIELD is negative, sorting is by the -FIELDth field
  693.      from the end of the line.  This command is useful for sorting
  694.      tables.
  695.  
  696.  - Command: sort-columns REVERSE &optional BEG END
  697.      This command sorts the lines in the region between BEG and END,
  698.      comparing them alphabetically by a certain range of columns.  The
  699.      column positions of BEG and END bound the range of columns to sort
  700.      on.
  701.  
  702.      If REVERSE is non-`nil', the sort is in reverse order.
  703.  
  704.      One unusual thing about this command is that the entire line
  705.      containing position BEG, and the entire line containing position
  706.      END, are included in the region sorted.
  707.  
  708.      Note that `sort-columns' uses the `sort' utility program, and so
  709.      cannot work properly on text containing tab characters.  Use `M-x
  710.      `untabify'' to convert tabs to spaces before sorting.
  711.  
  712.      The `sort-columns' function did not work on VMS prior to Emacs 19.
  713.  
  714. 
  715. File: elisp,  Node: Indentation,  Next: Columns,  Prev: Sorting,  Up: Text
  716.  
  717. Indentation
  718. ===========
  719.  
  720.    The indentation functions are used to examine, move to, and change
  721. whitespace that is at the beginning of a line.  Some of the functions
  722. can also change whitespace elsewhere on a line.  Indentation always
  723. counts from zero at the left margin.
  724.  
  725. * Menu:
  726.  
  727. * Primitive Indent::      Functions used to count and insert indentation.
  728. * Mode-Specific Indent::  Customize indentation for different modes.
  729. * Region Indent::         Indent all the lines in a region.
  730. * Relative Indent::       Indent the current line based on previous lines.
  731. * Indent Tabs::           Adjustable, typewriter-like tab stops.
  732. * Motion by Indent::      Move to first non-blank character.
  733.  
  734. 
  735. File: elisp,  Node: Primitive Indent,  Next: Mode-Specific Indent,  Up: Indentation
  736.  
  737. Indentation Primitives
  738. ----------------------
  739.  
  740.    This section describes the primitive functions used to count and
  741. insert indentation.  The functions in the following sections use these
  742. primitives.
  743.  
  744.  - Function: current-indentation
  745.      This function returns the indentation of the current line, which is
  746.      the horizontal position of the first nonblank character.  If the
  747.      contents are entirely blank, then this is the horizontal position
  748.      of the end of the line.
  749.  
  750.  - Command: indent-to COLUMN &optional MINIMUM
  751.      This function indents from point with tabs and spaces until COLUMN
  752.      is reached.  If MINIMUM is specified and non-`nil', then at least
  753.      that many spaces are inserted even if this requires going beyond
  754.      COLUMN.  The value is the column at which the inserted indentation
  755.      ends.
  756.  
  757.  - User Option: indent-tabs-mode
  758.      If this variable is non-`nil', indentation functions can insert
  759.      tabs as well as spaces.  Otherwise, they insert only spaces.
  760.      Setting this variable automatically makes it local to the current
  761.      buffer.
  762.  
  763. 
  764. File: elisp,  Node: Mode-Specific Indent,  Next: Region Indent,  Prev: Primitive Indent,  Up: Indentation
  765.  
  766. Indentation Controlled by Major Mode
  767. ------------------------------------
  768.  
  769.    An important function of each major mode is to customize the TAB key
  770. to indent properly for the language being edited.  This section
  771. describes the mechanism of the TAB key and how to control it.  The
  772. functions in this section return unpredictable values.
  773.  
  774.  - Variable: indent-line-function
  775.      This variable's value is the function to be used by TAB (and
  776.      various commands) to indent the current line.  The command
  777.      `indent-according-to-mode' does no more than call this function.
  778.  
  779.      In Lisp mode, the value is the symbol `lisp-indent-line'; in C
  780.      mode, `c-indent-line'; in Fortran mode, `fortran-indent-line'.  In
  781.      Fundamental mode, Text mode, and many other modes with no standard
  782.      for indentation, the value is `indent-to-left-margin' (which is the
  783.      default value).
  784.  
  785.  - Command: indent-according-to-mode
  786.      This command calls the function in `indent-line-function' to
  787.      indent the current line in a way appropriate for the current major
  788.      mode.
  789.  
  790.  - Command: indent-for-tab-command
  791.      This command calls the function in `indent-line-function' to
  792.      indent the current line, except that if that function is
  793.      `indent-to-left-margin', `insert-tab' is called instead.  (That is
  794.      a trivial command which inserts a tab character.)
  795.  
  796.  - Variable: left-margin
  797.      This variable is the column to which the default
  798.      `indent-line-function' will indent.  (That function is
  799.      `indent-to-left-margin'.)  In Fundamental mode, LFD indents to
  800.      this column.  This variable automatically becomes buffer-local when
  801.      set in any fashion.
  802.  
  803.  - Function: indent-to-left-margin
  804.      This is the default `indent-line-function', used in Fundamental
  805.      mode, Text mode, etc.  Its effect is to adjust the indentation at
  806.      the beginning of the current line to the value specified by the
  807.      variable `left-margin'.  This may involve either inserting or
  808.      deleting whitespace.
  809.  
  810.  - Command: newline-and-indent
  811.      This function inserts a newline, then indents the new line (the one
  812.      following the newline just inserted) according to the major mode.
  813.  
  814.      Indentation is done using the current `indent-line-function'.  In
  815.      programming language modes, this is the same thing TAB does, but
  816.      in some text modes, where TAB inserts a tab, `newline-and-indent'
  817.      indents to the column specified by `left-margin'.
  818.  
  819.  - Command: reindent-then-newline-and-indent
  820.      This command reindents the current line, inserts a newline at
  821.      point, and then reindents the new line (the one following the
  822.      newline just inserted).
  823.  
  824.      Indentation of both lines is done according to the current major
  825.      mode; this means that the current value of `indent-line-function'
  826.      is called.  In programming language modes, this is the same thing
  827.      TAB does, but in some text modes, where TAB inserts a tab,
  828.      `reindent-then-newline-and-indent' indents to the column specified
  829.      by `left-margin'.
  830.  
  831. 
  832. File: elisp,  Node: Region Indent,  Next: Relative Indent,  Prev: Mode-Specific Indent,  Up: Indentation
  833.  
  834. Indenting an Entire Region
  835. --------------------------
  836.  
  837.    This section describes commands which indent all the lines in the
  838. region.  They return unpredictable values.
  839.  
  840.  - Command: indent-region START END TO-COLUMN
  841.      This command indents each nonblank line starting between START
  842.      (inclusive) and END (exclusive).  If TO-COLUMN is `nil',
  843.      `indent-region' indents each nonblank line by calling the current
  844.      mode's indentation function, the value of `indent-line-function'.
  845.  
  846.      If TO-COLUMN is non-`nil', it should be an integer specifying the
  847.      number of columns of indentation; then this function gives each
  848.      line exactly that much indentation, by either adding or deleting
  849.      whitespace.
  850.  
  851.      If there is a fill prefix, `indent-region' indents each line by
  852.      making it start with the fill prefix.
  853.  
  854.  - Variable: indent-region-function
  855.      The value of this variable is a function that can be used by
  856.      `indent-region' as a short cut.  You should design the function so
  857.      that it will produce the same results as indenting the lines of the
  858.      region one by one (but presumably faster).
  859.  
  860.      If the value is `nil', there is no short cut, and `indent-region'
  861.      actually works line by line.
  862.  
  863.      A short cut function is useful in modes such as C mode and Lisp
  864.      mode, where the `indent-line-function' must scan from the
  865.      beginning of the function: applying it to each line would be
  866.      quadratic in time.  The short cut can update the scan information
  867.      as it moves through the lines indenting them; this takes linear
  868.      time.  If indenting a line individually is fast, there is no need
  869.      for a short cut.
  870.  
  871.      `indent-region' with a non-`nil' argument has a different
  872.      definition and does not use this variable.
  873.  
  874.  - Command: indent-rigidly START END COUNT
  875.      This command indents all lines starting between START (inclusive)
  876.      and END (exclusive) sideways by `count' columns.  This "preserves
  877.      the shape" of the affected region, moving it as a rigid unit.
  878.      Consequently, this command is useful not only for indenting
  879.      regions of unindented text, but also for indenting regions of
  880.      formatted code.
  881.  
  882.      For example, if COUNT is 3, this command adds 3 columns of
  883.      indentation to each of the lines beginning in the region specified.
  884.  
  885.      In Mail mode, `C-c C-y' (`mail-yank-original') uses
  886.      `indent-rigidly' to indent the text copied from the message being
  887.      replied to.
  888.  
  889.  - Function: indent-code-rigidly START END COLUMNS &optional
  890.           NOCHANGE-REGEXP
  891.      This is like `indent-rigidly', except that it doesn't alter lines
  892.      that start within strings or comments.
  893.  
  894.      In addition, it doesn't alter a line if NOCHANGE-REGEXP matches at
  895.      the beginning of the line (if NOCHANGE-REGEXP is non-`nil').
  896.  
  897. 
  898. File: elisp,  Node: Relative Indent,  Next: Indent Tabs,  Prev: Region Indent,  Up: Indentation
  899.  
  900. Indentation Relative to Previous Lines
  901. --------------------------------------
  902.  
  903.    This section describes two commands which indent the current line
  904. based on the contents of previous lines.
  905.  
  906.  - Command: indent-relative &optional UNINDENTED-OK
  907.      This function inserts whitespace at point, extending to the same
  908.      column as the next "indent point" of the previous nonblank line.
  909.      An indent point is a non-whitespace character following
  910.      whitespace.  The next indent point is the first one at a column
  911.      greater than the current column of point.  For example, if point
  912.      is underneath and to the left of the first non-blank character of
  913.      a line of text, it moves to that column by inserting whitespace.
  914.  
  915.      If the previous nonblank line has no next indent point (i.e., none
  916.      at a great enough column position), this function either does
  917.      nothing (if UNINDENTED-OK is non-`nil') or calls `tab-to-tab-stop'.
  918.      Thus, if point is underneath and to the right of the last column
  919.      of a short line of text, this function moves point to the next tab
  920.      stop by inserting whitespace.
  921.  
  922.      This command returns an unpredictable value.
  923.  
  924.      In the following example, point is at the beginning of the second
  925.      line:
  926.  
  927.                       This line is indented twelve spaces.
  928.           -!-The quick brown fox jumped.
  929.  
  930.      Evaluation of the expression `(indent-relative nil)' produces the
  931.      following:
  932.  
  933.                       This line is indented twelve spaces.
  934.                       -!-The quick brown fox jumped.
  935.  
  936.      In this example, point is between the `m' and `p' of `jumped':
  937.  
  938.                       This line is indented twelve spaces.
  939.           The quick brown fox jum-!-ped.
  940.  
  941.      Evaluation of the expression `(indent-relative nil)' produces the
  942.      following:
  943.  
  944.                       This line is indented twelve spaces.
  945.           The quick brown fox jum  -!-ped.
  946.  
  947.  - Command: indent-relative-maybe
  948.      This command indents the current line like the previous nonblank
  949.      line.  The function consists of a call to `indent-relative' with a
  950.      non-`nil' value passed to the UNINDENTED-OK optional argument.
  951.      The value is unpredictable.
  952.  
  953.      If the previous line has no indentation, the current line is given
  954.      no indentation (any existing indentation is deleted); if the
  955.      previous nonblank line has no indent points beyond the column at
  956.      which point starts, nothing is changed.
  957.  
  958. 
  959. File: elisp,  Node: Indent Tabs,  Next: Motion by Indent,  Prev: Relative Indent,  Up: Indentation
  960.  
  961. Adjustable "Tab Stops"
  962. ----------------------
  963.  
  964.    This section explains the mechanism for user-specified "tab stops"
  965. and the mechanisms which use and set them.  The name "tab stops" is
  966. used because the feature is similar to that of the tab stops on a
  967. typewriter.  The feature works by inserting an appropriate number of
  968. spaces and tab characters to reach the designated position, like the
  969. other indentation functions; it does not affect the display of tab
  970. characters in the buffer (*note Usual Display::.).  Note that the TAB
  971. character as input uses this tab stop feature only in a few major
  972. modes, such as Text mode.
  973.  
  974.  - Function: tab-to-tab-stop
  975.      This function inserts spaces or tabs up to the next tab stop column
  976.      defined by `tab-stop-list'.  It searches the list for an element
  977.      greater than the current column number, and uses that element as
  978.      the column to indent to.  If no such element is found, then
  979.      nothing is done.
  980.  
  981.  - User Option: tab-stop-list
  982.      This variable is the list of tab stop columns used by
  983.      `tab-to-tab-stops'.  The elements should be integers in increasing
  984.      order.  The tab stop columns need not be evenly spaced.
  985.  
  986.      Use `M-x edit-tab-stops' to edit the location of tab stops
  987.      interactively.
  988.  
  989. 
  990. File: elisp,  Node: Motion by Indent,  Prev: Indent Tabs,  Up: Indentation
  991.  
  992. Indentation-Based Motion Commands
  993. ---------------------------------
  994.  
  995.    These commands, primarily for interactive use, act based on the
  996. indentation in the text.
  997.  
  998.  - Command: back-to-indentation
  999.      This command moves point to the first non-whitespace character in
  1000.      the current line (which is the line in which point is located).
  1001.      It returns `nil'.
  1002.  
  1003.  - Command: backward-to-indentation ARG
  1004.      This command moves point backward ARG lines and then to the first
  1005.      nonblank character on that line.  It returns `nil'.
  1006.  
  1007.  - Command: forward-to-indentation ARG
  1008.      This command moves point forward ARG lines and then to the first
  1009.      nonblank character on that line.  It returns `nil'.
  1010.  
  1011. 
  1012. File: elisp,  Node: Columns,  Next: Case Changes,  Prev: Indentation,  Up: Text
  1013.  
  1014. Counting Columns
  1015. ================
  1016.  
  1017.    The column functions convert between a character position (counting
  1018. characters from the beginning of the buffer) and a column position
  1019. (counting screen characters from the beginning of a line).
  1020.  
  1021.    Column number computations ignore the width of the window and the
  1022. amount of horizontal scrolling.  Consequently, a column value can be
  1023. arbitrarily high.  The first (or leftmost) column is numbered 0.
  1024.  
  1025.    A character counts according to the number of columns it occupies on
  1026. the screen.  This means control characters count as occupying 2 or 4
  1027. columns, depending upon the value of `ctl-arrow', and tabs count as
  1028. occupying a number of columns that depends on the value of `tab-width'
  1029. and on the column where the tab begins.  *Note Usual Display::.
  1030.  
  1031.  - Function: current-column
  1032.      This function returns the horizontal position of point, measured in
  1033.      columns, counting from 0 at the left margin.  The column count is
  1034.      calculated by adding together the widths of all the displayed
  1035.      representations of the characters between the start of the current
  1036.      line and point.
  1037.  
  1038.      For a more complicated example of the use of `current-column', see
  1039.      the description of `count-lines' in *Note Text Lines::.
  1040.  
  1041.  - Function: move-to-column COLUMN &optional FORCE
  1042.      This function moves point to COLUMN in the current line.  The
  1043.      calculation of COLUMN takes into account the widths of all the
  1044.      displayed representations of the characters between the start of
  1045.      the line and point.
  1046.  
  1047.      If the argument COLUMN is greater than the column position of the
  1048.      end of the line, point moves to the end of the line.  If COLUMN is
  1049.      negative, point moves to the beginning of the line.
  1050.  
  1051.      If it is impossible to move to column COLUMN because that is in
  1052.      the middle of a multicolumn character such as a tab, point moves
  1053.      to the end of that character.  However, if FORCE is non-`nil', and
  1054.      COLUMN is in the middle of a tab, then `move-to-column' converts
  1055.      the tab into spaces so that it can move precisely to column COLUMN.
  1056.  
  1057.      The argument FORCE also has an effect if the line isn't long
  1058.      enough to reach column COLUMN; in that case, it says to indent at
  1059.      the end of the line to reach that column.
  1060.  
  1061.      If COLUMN is not an integer, an error is signaled.
  1062.  
  1063.      The return value is the column number actually moved to.
  1064.  
  1065. 
  1066. File: elisp,  Node: Case Changes,  Next: Text Properties,  Prev: Columns,  Up: Text
  1067.  
  1068. Case Changes
  1069. ============
  1070.  
  1071.    The case change commands described here work on text in the current
  1072. buffer.  *Note Character Case::, for case conversion commands that work
  1073. on strings and characters.  *Note Case Table::, for how to customize
  1074. which characters are upper or lower case and how to convert them.
  1075.  
  1076.  - Command: capitalize-region START END
  1077.      This function capitalizes all words in the region defined by START
  1078.      and END.  To capitalize means to convert each word's first
  1079.      character to upper case and convert the rest of each word to lower
  1080.      case.  The function returns `nil'.
  1081.  
  1082.      If one end of the region is in the middle of a word, the part of
  1083.      the word within the region is treated as an entire word.
  1084.  
  1085.      When `capitalize-region' is called interactively, START and END
  1086.      are point and the mark, with the smallest first.
  1087.  
  1088.           ---------- Buffer: foo ----------
  1089.           This is the contents of the 5th foo.
  1090.           ---------- Buffer: foo ----------
  1091.           
  1092.           (capitalize-region 1 44)
  1093.           => nil
  1094.           
  1095.           ---------- Buffer: foo ----------
  1096.           This Is The Contents Of The 5th Foo.
  1097.           ---------- Buffer: foo ----------
  1098.  
  1099.  - Command: downcase-region START END
  1100.      This function converts all of the letters in the region defined by
  1101.      START and END to lower case.  The function returns `nil'.
  1102.  
  1103.      When `downcase-region' is called interactively, START and END are
  1104.      point and the mark, with the smallest first.
  1105.  
  1106.  - Command: upcase-region START END
  1107.      This function converts all of the letters in the region defined by
  1108.      START and END to upper case.  The function returns `nil'.
  1109.  
  1110.      When `upcase-region' is called interactively, START and END are
  1111.      point and the mark, with the smallest first.
  1112.  
  1113.  - Command: capitalize-word COUNT
  1114.      This function capitalizes COUNT words after point, moving point
  1115.      over as it does.  To capitalize means to convert each word's first
  1116.      character to upper case and convert the rest of each word to lower
  1117.      case.  If COUNT is negative, the function capitalizes the -COUNT
  1118.      previous words but does not move point.  The value is `nil'.
  1119.  
  1120.      If point is in the middle of a word, the part of word the before
  1121.      point (if moving forward) or after point (if operating backward)
  1122.      is ignored.  The rest is treated as an entire word.
  1123.  
  1124.      When `capitalize-word' is called interactively, COUNT is set to
  1125.      the numeric prefix argument.
  1126.  
  1127.  - Command: downcase-word COUNT
  1128.      This function converts the COUNT words after point to all lower
  1129.      case, moving point over as it does.  If COUNT is negative, it
  1130.      converts the -COUNT previous words but does not move point.  The
  1131.      value is `nil'.
  1132.  
  1133.      When `downcase-word' is called interactively, COUNT is set to the
  1134.      numeric prefix argument.
  1135.  
  1136.  - Command: upcase-word COUNT
  1137.      This function converts the COUNT words after point to all upper
  1138.      case, moving point over as it does.  If COUNT is negative, it
  1139.      converts the -COUNT previous words but does not move point.  The
  1140.      value is `nil'.
  1141.  
  1142.      When `upcase-word' is called interactively, COUNT is set to the
  1143.      numeric prefix argument.
  1144.  
  1145. 
  1146. File: elisp,  Node: Text Properties,  Next: Substitution,  Prev: Case Changes,  Up: Text
  1147.  
  1148. Text Properties
  1149. ===============
  1150.  
  1151.    Each character position in a buffer or a string can have a "text
  1152. property list", much like the property list of a symbol.  The properties
  1153. belong to a particular character at a particular place, such as, the
  1154. letter `T' at the beginning of this sentence or the first `o' in
  1155. `foo'--if the same character occurs in two different places, the two
  1156. occurrences generally have different properties.
  1157.  
  1158.    Each property has a name, which is usually a symbol, and an
  1159. associated value, which can be any Lisp object--just as for properties
  1160. of symbols (*note Property Lists::.).
  1161.  
  1162.    If a character has a `category' property, we call it the "category"
  1163. of the character.  It should be a symbol.  The properties of the symbol
  1164. serve as defaults for the properties of the character.
  1165.  
  1166.    Copying text between strings and buffers preserves the properties
  1167. along with the characters; this includes such diverse functions as
  1168. `substring', `insert', and `buffer-substring'.
  1169.  
  1170. * Menu:
  1171.  
  1172. * Examining Properties::    Looking at the properties of one character.
  1173. * Changing Properties::        Setting the properties of a range of text.
  1174. * Property Search::        Searching for where a property changes value.
  1175. * Special Properties::        Particular properties with special meanings.
  1176. * Sticky Properties::           How inserted text gets properties from
  1177.                                   neighboring text.
  1178. * Not Intervals::        Why text properties do not use
  1179.                   Lisp-visible text intervals.
  1180.  
  1181.