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

  1. This is Info file elisp, produced by Makeinfo-1.47 from the input file
  2. elisp.texi.
  3.  
  4.    This file documents GNU Emacs Lisp.
  5.  
  6.    This is edition 1.03 of the GNU Emacs Lisp Reference Manual, for
  7. Emacs Version 18.
  8.  
  9.    Published by the Free Software Foundation, 675 Massachusetts Avenue,
  10. Cambridge, MA 02139 USA
  11.  
  12.    Copyright (C) 1990 Free Software Foundation, Inc.
  13.  
  14.    Permission is granted to make and distribute verbatim copies of this
  15. manual provided the copyright notice and this permission notice are
  16. preserved on all copies.
  17.  
  18.    Permission is granted to copy and distribute modified versions of
  19. this manual under the conditions for verbatim copying, provided that
  20. the entire resulting derived work is distributed under the terms of a
  21. permission notice identical to this one.
  22.  
  23.    Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that this permission notice may be stated in a
  26. translation approved by the Foundation.
  27.  
  28. 
  29. File: elisp,  Node: Text Lines,  Next: Screen Lines,  Prev: Buffer End Motion,  Up: Motion
  30.  
  31. Motion by Text Lines
  32. --------------------
  33.  
  34.    Text lines are portions of the buffer delimited by newline
  35. characters, which are regarded as part of the previous line.  The first
  36. text line begins at the beginning of the buffer, and the last text line
  37. ends at the end of the buffer whether or not the last character is a
  38. newline. The division of the buffer into text lines is not affected by
  39. the width of the window, or by how tabs and control characters are
  40. displayed.
  41.  
  42.  -- Command: goto-line LINE
  43.      This function moves point to the front of the LINEth line,
  44.      counting from line 1 at beginning of buffer.  If LINE is less than
  45.      1, then point is set to the beginning of the buffer.  If LINE is
  46.      greater than the number of lines in the buffer, then point is set
  47.      to the *end of the last line* of the buffer.
  48.  
  49.      If narrowing is in effect, then LINE still counts from the
  50.      beginning of the buffer, but point cannot go outside the accessible
  51.      portion.  So point is set at the beginning or end of the accessible
  52.      portion of the text if the line number specifies a position that is
  53.      inaccessible.
  54.  
  55.      The return value of `goto-line' is the difference between LINE and
  56.      the line number of the line to which point actually was able move
  57.      (before taking account of any narrowing).  Thus, the value is
  58.      positive if the scan encounters the end of the buffer.
  59.  
  60.      In an interactive call, LINE is the numeric prefix argument if one
  61.      has been provided.  Otherwise LINE is read in the minibuffer.
  62.  
  63.  -- Command: beginning-of-line &optional COUNT
  64.      This function moves point to the beginning of the current line. 
  65.      With an argument COUNT not `nil' or 1, it moves forward COUNT-1
  66.      lines and then to the beginning of the line.
  67.  
  68.      If this function reaches the end of the buffer (or of the
  69.      accessible portion, if narrowing is in effect), it positions point
  70.      at the beginning of the last line.  No error is signaled.
  71.  
  72.  -- Command: end-of-line &optional COUNT
  73.      This function moves point to the end of the current line.  With an
  74.      argument COUNT not `nil' or 1, it moves forward COUNT-1 lines and
  75.      then to the end of the line.
  76.  
  77.      If this function reaches the end of the buffer (or of the
  78.      accessible portion, if narrowing is in effect), it positions point
  79.      at the end of the last line.  No error is signaled.
  80.  
  81.  -- Command: forward-line &optional COUNT
  82.      This function moves point forward COUNT lines, to the beginning of
  83.      the line.  If COUNT is negative, it moves point -COUNT lines
  84.      backward, to the beginning of the line.
  85.  
  86.      If the beginning or end of the buffer (or of the accessible
  87.      portion) is encountered before that many lines are found, then
  88.      point stops at the beginning or end.  No error is signaled.
  89.  
  90.      `forward-line' returns the difference between COUNT and the number
  91.      of lines actually moved.  If you attempt to move down five lines
  92.      from the beginning of a buffer that has only three lines, point
  93.      will positioned at the end of the last line, and the value will be
  94.      2.
  95.  
  96.      In an interactive call, COUNT is the numeric prefix argument.
  97.  
  98.  -- Function: count-lines START END
  99.      This function returns the number of lines between the positions
  100.      START and END in the current buffer.  If START and END are equal,
  101.      then it returns 0.  Otherwise it returns at least 1, even if START
  102.      and END are on the same line.  This is because the text between
  103.      them, considered in isolation, must contain at least one line
  104.      unless it is empty.
  105.  
  106.      Here is an example of using `count-lines':
  107.  
  108.           (defun current-line ()
  109.             "Return the vertical position of point in the selected window.
  110.           Top line is 0.  Counts each text line only once, even if it wraps."
  111.             (+ (count-lines (window-start) (point))
  112.                (if (= (current-column) 0) 1 0)
  113.                -1))
  114.  
  115.    Also see the functions `bolp' and `eolp' in *Note Near Point::.
  116. These functions do not move point, but test whether it is already at the
  117. beginning or end of a line.
  118.  
  119. 
  120. File: elisp,  Node: Screen Lines,  Next: Vertical Motion,  Prev: Text Lines,  Up: Motion
  121.  
  122. Motion by Screen Lines
  123. ----------------------
  124.  
  125.    The line functions in the previous section count text lines,
  126. delimited only by newline characters.  By contrast, these functions
  127. count screen lines, which are defined by the way the text appears on
  128. the screen.  A text line is a single screen line if it is short enough
  129. to fit the width of the selected window, but otherwise it may occupy
  130. several screen lines.
  131.  
  132.    In some cases, text lines are truncated on the screen rather than
  133. continued onto additional screen lines.  Then `vertical-motion' moves
  134. point just like `forward-line'.  *Note Truncation::.
  135.  
  136.    Because the width of a given string depends on the flags which
  137. control the appearance of certain characters, `vertical-motion' will
  138. behave differently on a given piece of text found in different buffers.
  139.  It will even act differently in different windows showing the same
  140. buffer, because the width may differ and so may the truncation flag.
  141. *Note Control Char Display::.
  142.  
  143.  -- Function: vertical-motion COUNT
  144.      This function moves point to the start of the screen line COUNT
  145.      screen lines down from the screen line containing point.  If COUNT
  146.      is negative, it moves up instead.
  147.  
  148.      This function returns the number of lines moved.  The value may be
  149.      less in absolute value than COUNT if the beginning or end of the
  150.      buffer was reached.
  151.  
  152.  -- Command: move-to-window-line COUNT
  153.      This function moves point with respect to the text currently
  154.      displayed in the selected window.  Point is moved to the beginning
  155.      of the screen line COUNT screen lines from the top of the window. 
  156.      If COUNT is negative, point moves either to the beginning of the
  157.      line -COUNT lines from the bottom or else to the last line of the
  158.      buffer if the buffer ends above the specified screen position.
  159.  
  160.      If COUNT is `nil', then point moves to the beginning of the line
  161.      in the middle of the window.  If the absolute value of COUNT is
  162.      greater than the size of the window, then point moves to the place
  163.      which would appear on that screen line if the window were tall
  164.      enough. This will probably cause the next redisplay to scroll to
  165.      bring that location onto the screen.
  166.  
  167.      In an interactive call, COUNT is the numeric prefix argument.
  168.  
  169.      The value returned is the window line number, with the top line in
  170.      the window numbered 0.
  171.  
  172. 
  173. File: elisp,  Node: Vertical Motion,  Next: List Motion,  Prev: Screen Lines,  Up: Motion
  174.  
  175. The User-Level Vertical Motion Commands
  176. ---------------------------------------
  177.  
  178.    A goal column is useful if you want to edit text such as a table in
  179. which you want to move point to a certain column on each line.  The goal
  180. column affects the vertical text line motion commands, `next-line' and
  181. `previous-line'.  *Note Basic Editing Commands: (emacs)Basic.
  182.  
  183.  -- User Option: goal-column
  184.      This variable holds an explicitly specified goal column for
  185.      vertical line motion commands.  If it is an integer, it specifies
  186.      a column, and these commands try to move to that column on each
  187.      line.  If it is `nil', then the commands set their own goal
  188.      columns.  Any other value is invalid.
  189.  
  190.  -- Variable: temporary-goal-column
  191.      This variable holds the temporary goal column during a sequence of
  192.      consecutive vertical line motion commands.  It is overridden by
  193.      `goal-column' if that is non-`nil'.  It is set each time a
  194.      vertical motion command is invoked, unless the previous command
  195.      was also a vertical motion command.
  196.  
  197.  -- User Option: track-eol
  198.      This variable controls how the vertical line motion commands
  199.      operate when starting at the end of a line.  If `track-eol' is
  200.      non-`nil', then vertical motion starting at the end of a line will
  201.      keep to the ends of lines.  This means moving to the end of each
  202.      line moved onto.  The value of `track-eol' has no effect if point
  203.      is not at the end of a line when the first vertical motion command
  204.      is given.
  205.  
  206.      `track-eol' has its effect by causing `temporary-goal-column' to
  207.      be set to 9999 instead of to the current column.
  208.  
  209.  -- Command: set-goal-column UNSET
  210.      This command sets the variable `goal-column' to specify a permanent
  211.      goal column for the vertical line motion commands.  If UNSET is
  212.      `nil', then `goal-column' is set to the current column of point. 
  213.      If UNSET is non-`nil', then `goal-column' is set to `nil'.
  214.  
  215.      This function is intended for interactive use; and in an
  216.      interactive call, UNSET is the raw prefix argument.
  217.  
  218. 
  219. File: elisp,  Node: List Motion,  Next: Skipping Characters,  Prev: Vertical Motion,  Up: Motion
  220.  
  221. Moving over Lists and Other Balanced Expressions
  222. ------------------------------------------------
  223.  
  224.    Here are several functions concerned with balanced-parenthesis
  225. expressions (also called "sexps" in connection with moving across them
  226. in Emacs).  The syntax table controls how these functions interpret
  227. various characters; see *Note Syntax Tables::.  *Note Parsing
  228. Expressions::, for lower-level primitives for scanning sexps or parts of
  229. sexps.  For user-level commands, see *Note Lists and Sexps:
  230. (emacs)Lists and Sexps.
  231.  
  232.  -- Command: forward-list ARG
  233.      Move forward across ARG balanced groups of parentheses. (Other
  234.      syntatic entities such as words or paired string quotes are
  235.      ignored.)
  236.  
  237.  -- Command: backward-list ARG
  238.      Move backward across ARG balanced groups of parentheses. (Other
  239.      syntatic entities such as words or paired string quotes are
  240.      ignored.)
  241.  
  242.  -- Command: up-list ARG
  243.      Move forward out of ARG levels of parentheses. A negative argument
  244.      means move backward but still to a less deep spot.
  245.  
  246.  -- Command: down-list ARG
  247.      Move forward down ARG levels of parentheses.  A negative argument
  248.      means move backward but still go down ARG level.
  249.  
  250.  -- Command: forward-sexp ARG
  251.      Move forward across ARG balanced expressions. Balanced expressions
  252.      include both those delimited by parentheses and other kinds, such
  253.      as words and string constants.  For example,
  254.  
  255.           ---------- Buffer: foo ----------
  256.           (concat-!- "foo " (car x) y z)
  257.           ---------- Buffer: foo ----------
  258.           
  259.           (forward-sexp 3)
  260.                => nil
  261.           
  262.           ---------- Buffer: foo ----------
  263.           (concat "foo " (car x) y-!- z)
  264.           ---------- Buffer: foo ----------
  265.  
  266.  -- Command: backward-sexp ARG
  267.      Move backward across ARG balanced expressions.
  268.  
  269. 
  270. File: elisp,  Node: Skipping Characters,  Prev: List Motion,  Up: Motion
  271.  
  272. Skipping Characters
  273. -------------------
  274.  
  275.    The following two functions move point over a specified set of
  276. characters.  For example, they are often used to skip whitespace.
  277.  
  278.  -- Function: skip-chars-forward CHARACTER-SET &optional LIMIT
  279.      This function moves point in the current buffer forward, skipping
  280.      over a given set of characters.  Emacs first examines the
  281.      character following point; if it matches CHARACTER-SET, then point
  282.      is advanced and the next character is examined.  This continues
  283.      until a character is found that does not match.  The function
  284.      returns `nil'.
  285.  
  286.      The argument CHARACTER-SET is like the inside of a `[...]' in a
  287.      regular expression except that `]' is never special and `\' quotes
  288.      `^', `-' or `\'.  Thus, `"a-zA-Z"' skips over all letters,
  289.      stopping before the first nonletter, and `"^a-zA-Z'" skips
  290.      nonletters stopping before the first letter.  *Note Regular
  291.      Expressions::.
  292.  
  293.      If LIMIT is supplied (it must be a number or a marker), it
  294.      specifies the maximum position in the buffer that point can be
  295.      skipped to.  Point will stop at or before LIMIT.
  296.  
  297.      In the following example, point is initially located directly
  298.      before the `T'.  After the form is evaluated, point is located at
  299.      the end of that line (between the `t' of `hat' and the newline). 
  300.      The function skips all letters and spaces, but not newlines.
  301.  
  302.           ---------- Buffer: foo ----------
  303.           I read "-!-The cat in the hat
  304.           comes back" twice.
  305.           ---------- Buffer: foo ----------
  306.           
  307.           (skip-chars-forward "a-zA-Z ")
  308.                => nil
  309.           
  310.           ---------- Buffer: foo ----------
  311.           I read "The cat in the hat-!-
  312.           comes back" twice.
  313.           ---------- Buffer: foo ----------
  314.  
  315.  -- Function: skip-chars-backward CHARACTER-SET &optional LIMIT
  316.      This function moves point backward, skipping characters that match
  317.      CHARACTER-SET.  It just like `skip-chars-forward' except for the
  318.      direction of motion.
  319.  
  320. 
  321. File: elisp,  Node: Excursions,  Next: Narrowing,  Prev: Motion,  Up: Positions
  322.  
  323. Excursions
  324. ==========
  325.  
  326.    It is often useful to move point "temporarily" within a localized
  327. portion of the program, or to switch buffers temporarily.  This is
  328. called an "excursion", and it is done with the `save-excursion' special
  329. form.  This construct saves the current buffer and its values of point
  330. and the mark so they can be restored after the completion of the
  331. excursion.
  332.  
  333.    The forms for saving and restoring the configuration of windows are
  334. described elsewhere (*note Window Configurations::.).
  335.  
  336.  -- Special Form: save-excursion FORMS...
  337.      The `save-excursion' special form saves the identity of the current
  338.      buffer and the values of point and the mark in it, evaluates FORMS,
  339.      and finally restores the buffer and its saved values of point and
  340.      the mark. All three saved values are restored even in case of an
  341.      abnormal exit via throw or error (*note Nonlocal Exits::.).
  342.  
  343.      The `save-excursion' special form is the standard way to switch
  344.      buffers or move point within one part of a program and avoid
  345.      affecting the rest of the program.  It is used more than 500 times
  346.      in the Lisp sources of Emacs.
  347.  
  348.      The values of point and the mark for other buffers are not saved by
  349.      `save-excursion', so any changes made to point and the mark in the
  350.      other buffers will remain in effect after `save-excursion' exits.
  351.  
  352.      Likewise, `save-excursion' does not restore window-buffer
  353.      correspondences altered by functions such as `switch-to-buffer'.
  354.      One way to restore these correspondences, and the selected window,
  355.      is to use `save-window-excursion' inside `save-excursion' (*note
  356.      Window Configurations::.).
  357.  
  358.      The value returned by `save-excursion' is the result of the last of
  359.      FORMS, or `nil' if no FORMS are given.
  360.  
  361.           (save-excursion
  362.             FORMS)
  363.           ==
  364.           (let ((old-buf (current-buffer))
  365.                 (old-pnt (point-marker))
  366.                 (old-mark (copy-marker (mark-marker))))
  367.             (unwind-protect
  368.                 (progn FORMS)
  369.               (set-buffer old-buf)
  370.               (goto-char old-pnt)
  371.               (set-marker (mark-marker) old-mark)))
  372.  
  373. 
  374. File: elisp,  Node: Narrowing,  Prev: Excursions,  Up: Positions
  375.  
  376. Narrowing
  377. =========
  378.  
  379.    "Narrowing" means limiting the text addressable by Emacs editing
  380. commands to a limited range of characters in a buffer.  The text that
  381. remains addressable is called the "accessible portion" of the buffer.
  382.  
  383.    Narrowing is specified with two buffer positions which become the
  384. beginning and end of the accessible portion.  For most editing commands
  385. these positions replace the values of the beginning and end of the
  386. buffer.  While narrowing is in effect, no text outside the accessible
  387. portion is displayed, and point cannot move outside the accessible
  388. portion.
  389.  
  390.    Values such as positions or line numbers which usually count from the
  391. beginning of the buffer continue to do so, but the functions which use
  392. them will refuse to operate on text that is inaccessible.
  393.  
  394.    The commands for saving buffers are unaffected by narrowing; the
  395. entire buffer is saved regardless of the any narrowing.
  396.  
  397.  -- Command: narrow-to-region START END
  398.      This function sets the accessible portion of the current buffer to
  399.      start at START and end at END.  Both arguments should be character
  400.      positions.
  401.  
  402.      In an interactive call, START and END are set to the bounds of the
  403.      current region (point and the mark, with the smallest first).
  404.  
  405.  -- Command: narrow-to-page MOVE-COUNT
  406.      This function sets the accessible portion of the current buffer to
  407.      include just the current page.  An optional first argument
  408.      MOVE-COUNT non-`nil' means to move forward or backward by
  409.      MOVE-COUNT pages and then narrow.
  410.  
  411.      In an interactive call, MOVE-COUNT is set to the numeric prefix
  412.      argument.
  413.  
  414.  -- Command: widen
  415.      This function cancels any narrowing in the current buffer, so that
  416.      the entire contents are accessible.  This is called "widening". It
  417.      is equivalent to the following expression:
  418.  
  419.           (narrow-to-region 1 (1+ (buffer-size)))
  420.  
  421.  -- Special Form: save-restriction FORMS...
  422.      This special form saves the current bounds of the accessible
  423.      portion, evaluates FORMS, and finally restores the saved bounds,
  424.      thus restoring the same state of narrowing (or absence thereof)
  425.      formerly in effect.  The state of narrowing is restored even in
  426.      the event of an abnormal exit via throw or error (*note Nonlocal
  427.      Exits::.).  Therefore, this construct is a clean way to narrow a
  428.      buffer temporarily.
  429.  
  430.      The value returned by `save-restriction' is that returned by the
  431.      last of FORMS, or `nil' if no forms were given.
  432.  
  433.      *Note:* it is easy to make a mistake when using
  434.      `save-restriction'.  Read the entire description here before you
  435.      try it.
  436.  
  437.      Point and the mark are *not* restored by this special form; use
  438.      `save-excursion' for that.  If you use both `save-restriction' and
  439.      `save-excursion' together, `save-excursion' should come first (on
  440.      the outside).  Otherwise, the old point value would be restored
  441.      with temporary narrowing still in effect.  If the old point value
  442.      were outside the limits of the temporary narrowing, this would
  443.      fail to restore it accurately.
  444.  
  445.      The `save-restriction' special form records the values of the
  446.      beginning and end of the accessible portion as distances from the
  447.      beginning and end of the buffer.  In other words, it records the
  448.      amount of inaccessible text before and after the accessible
  449.      portion.
  450.  
  451.      This technique yields correct results if the body of the form does
  452.      further narrowing.  However, `save-restriction' can become confused
  453.      if the body widens and then makes changes outside the area of the
  454.      saved narrowing.  When this is what you want to do,
  455.      `save-restriction' is not the right tool for the job.  Here is
  456.      what you must do instead:
  457.  
  458.           (let ((beg (point-min-marker))
  459.                 (end (point-max-marker)))
  460.             (unwind-protect
  461.                 (progn BODY)
  462.               (narrow-to-region beg end)))
  463.  
  464.      Here is a simple example of correct use of `save-restriction':
  465.  
  466.           ---------- Buffer: foo ----------
  467.           This is the contents of foo
  468.           This is the contents of foo
  469.           This is the contents of foo-!-
  470.           ---------- Buffer: foo ----------
  471.           
  472.           (save-excursion
  473.             (save-restriction
  474.               (goto-char 1)
  475.               (forward-line 2)
  476.               (narrow-to-region 1 (point))
  477.               (goto-char (point-min))
  478.               (replace-string "foo" "bar")))
  479.           
  480.           ---------- Buffer: foo ----------
  481.           This is the contents of bar
  482.           This is the contents of bar
  483.           This is the contents of foo-!-
  484.           ---------- Buffer: foo ----------
  485.  
  486. 
  487. File: elisp,  Node: Markers,  Next: Text,  Prev: Positions,  Up: Top
  488.  
  489. Markers
  490. *******
  491.  
  492.    A "marker" is a Lisp object used to specify a position in a buffer
  493. relative to the surrounding text.  A marker changes its offset from the
  494. beginning of the buffer automatically whenever text is inserted or
  495. deleted, so that it stays with the two characters on either side of it.
  496.  
  497. * Menu:
  498.  
  499. * Overview of Markers::      The components of a marker, and how it relocates.
  500. * Predicates on Markers::    Testing whether an object is a marker.
  501. * Creating Markers::         Making empty markers or markers at certain places.
  502. * Information from Markers:: Finding the marker's buffer or character position.
  503. * Changing Markers::         Moving the marker to a new buffer or position.
  504. * The Mark::                 How "the mark" is implemented with a marker.
  505. * The Region::               How to access "the region".
  506.  
  507. 
  508. File: elisp,  Node: Overview of Markers,  Next: Predicates on Markers,  Prev: Markers,  Up: Markers
  509.  
  510. Overview of Markers
  511. ===================
  512.  
  513.    A marker specifies a buffer and a position in that buffer.  The
  514. marker can be used to represent a position in the functions that
  515. require one, just as an integer could be used.  *Note Positions::, for
  516. a complete description of positions.
  517.  
  518.    A marker has two attributes: the marker position, and the marker
  519. buffer.  The marker position is an integer which is equivalent (at the
  520. moment) to the marker as a position in that buffer; however, as text is
  521. inserted or deleted in the buffer, the marker is relocated, so that its
  522. integer equivalent changes.  The idea is that a marker positioned
  523. between two characters in a buffer will remain between those two
  524. characters despite any changes made to the contents of the buffer; thus,
  525. a marker's offset from the beginning of a buffer may change often during
  526. the life of the marker.
  527.  
  528.    If the text around a marker is deleted, the marker is repositioned
  529. between the characters immediately before and after the deleted text. 
  530. If text is inserted at the position of a marker, the marker remains in
  531. front of the new text unless it is inserted with `insert-before-markers'
  532. (*note Insertion::.).  When text is inserted or deleted somewhere
  533. before the marker position (not next to the marker), the marker moves
  534. back and forth with the two neighboring characters.
  535.  
  536.    When a buffer is modified, all of its markers must be checked so that
  537. they can be relocated if necessary.  This slows processing in a buffer
  538. with a large number of markers.  For this reason, it is a good idea to
  539. make a marker point nowhere if you are sure you don't need it any more.
  540. Unreferenced markers will eventually be garbage collected, but until
  541. then will continue to be updated if they do point somewhere.
  542.  
  543.    Because it is quite common to perform arithmetic operations on a
  544. marker position, most of the arithmetic operations (including `+' and
  545. `-') accept markers as arguments.  In such cases, the current position
  546. of the marker is used.
  547.  
  548.    Here are examples of creating markers, setting markers, and moving
  549. point to markers:
  550.  
  551.      ;; Make a new marker that initially does not point anywhere:
  552.      (setq m1 (make-marker))
  553.           => #<marker in no buffer>
  554.      
  555.      ;; Set `m1' to point between the 100th and 101st characters.
  556.      ;; in the current buffer:
  557.      (set-marker m1 100)
  558.           => #<marker at 100 in markers.texi>
  559.      
  560.      ;; Now insert one character at the beginning of the buffer:
  561.      (goto-char (point-min))
  562.           => 1
  563.      (insert "Q")
  564.           => nil
  565.      
  566.      ;; `m1' is updated appropriately.
  567.      m1
  568.           => #<marker at 101 in markers.texi>
  569.      
  570.      ;; Two markers that point to the same position
  571.      ;; are not `eq', but they are `equal'.
  572.      (setq m2 (copy-marker m1))
  573.           => #<marker at 101 in markers.texi>
  574.      (eq m1 m2)
  575.           => nil
  576.      (equal m1 m2)
  577.           => t
  578.      
  579.      ;; When you are finished using a marker, make it point nowhere.
  580.      (set-marker m1 nil)
  581.           => #<marker in no buffer>
  582.  
  583. 
  584. File: elisp,  Node: Predicates on Markers,  Next: Creating Markers,  Prev: Overview of Markers,  Up: Markers
  585.  
  586. Predicates on Markers
  587. =====================
  588.  
  589.    You can test an object to see whether it is a marker, or whether it
  590. is either an integer or a marker.  The latter test is useful when you
  591. are using the arithmetic functions that work with both markers and
  592. integers.
  593.  
  594.  -- Function: markerp OBJECT
  595.      This function returns `t' if OBJECT is a marker, `nil' otherwise. 
  596.      In particular, integers are not markers, even though many
  597.      functions will accept either a marker or an integer.
  598.  
  599.  -- Function: integer-or-marker-p OBJECT
  600.      This function returns `t' if OBJECT is an integer or a marker,
  601.      `nil' otherwise.
  602.  
  603. 
  604. File: elisp,  Node: Creating Markers,  Next: Information from Markers,  Prev: Predicates on Markers,  Up: Markers
  605.  
  606. Functions That Create Markers
  607. =============================
  608.  
  609.    When you create a new marker, you can make it point nowhere, or point
  610. to the present position of point, or to the beginning or end of the
  611. accessible portion of the buffer, or to the same place as another given
  612. marker.
  613.  
  614.  -- Function: make-marker
  615.      This functions returns a newly allocated marker that does not point
  616.      anywhere.
  617.  
  618.           (make-marker)
  619.                => #<marker in no buffer>
  620.  
  621.  -- Function: point-marker
  622.      This function returns a new marker that points to the present
  623.      position of point in the current buffer.  *Note Point::.  For an
  624.      example, see `copy-marker', below.
  625.  
  626.  -- Function: point-min-marker
  627.      This function returns a new marker that points to the beginning of
  628.      the accessible portion of the buffer.  This will be the beginning
  629.      of the buffer unless narrowing is in effect.  *Note Narrowing::.
  630.  
  631.  -- Function: point-max-marker
  632.      This function returns a new marker that points to the end of the
  633.      accessible portion of the buffer.  This will be the end of the
  634.      buffer unless narrowing is in effect.  *Note Narrowing::.
  635.  
  636.      Here are examples of this function and `point-min-marker', shown in
  637.      a buffer containing a version of the source file for the text of
  638.      this chapter.
  639.  
  640.           (point-min-marker)
  641.                => #<marker at 1 in markers.texi>
  642.           (point-max-marker)
  643.                => #<marker at 15573 in markers.texi>
  644.           
  645.           (narrow-to-region 100 200)
  646.                => nil
  647.           (point-min-marker)
  648.                => #<marker at 100 in markers.texi>
  649.           (point-max-marker)
  650.                => #<marker at 200 in markers.texi>
  651.  
  652.  -- Function: copy-marker MARKER-OR-INTEGER
  653.      If passed a marker as its argument, `copy-marker' returns a new
  654.      marker that points to the same place and the same buffer as does
  655.      MARKER-OR-INTEGER.  If passed an integer as its argument,
  656.      `copy-marker' returns a new marker that points to position
  657.      MARKER-OR-INTEGER in the current buffer.
  658.  
  659.      If passed an argument that is an integer whose value is less than
  660.      1, `copy-marker' returns a new marker that points to the beginning
  661.      of the current buffer.  If passed an argument that is an integer
  662.      whose value is greater than the length of the buffer, then
  663.      `copy-marker' returns a new marker that points to the end of the
  664.      buffer.
  665.  
  666.      An error is signaled if MARKER is neither a marker nor an integer.
  667.  
  668.           (setq p (point-marker))
  669.                => #<marker at 2139 in markers.texi>
  670.           
  671.           (setq q (copy-marker p))
  672.                => #<marker at 2139 in markers.texi>
  673.           
  674.           (eq p q)
  675.                => nil
  676.           
  677.           (equal p q)
  678.                => t
  679.           
  680.           (copy-marker 0)
  681.                => #<marker at 1 in markers.texi>
  682.           
  683.           (copy-marker 20000)
  684.                => #<marker at 7572 in markers.texi>
  685.  
  686. 
  687. File: elisp,  Node: Information from Markers,  Next: Changing Markers,  Prev: Creating Markers,  Up: Markers
  688.  
  689. Information from Markers
  690. ========================
  691.  
  692.    This section describes the functions for accessing the components of
  693. a marker object.
  694.  
  695.  -- Function: marker-position MARKER
  696.      This function returns the position that MARKER points to, or `nil'
  697.      if it points nowhere.
  698.  
  699.  -- Function: marker-buffer MARKER
  700.      This function returns the buffer that MARKER points into, or `nil'
  701.      if it points nowhere.
  702.  
  703.           (setq m (make-marker))
  704.                => #<marker in no buffer>
  705.           (marker-position m)
  706.                => nil
  707.           (marker-buffer m)
  708.                => nil
  709.           
  710.           (set-marker m 3770 (current-buffer))
  711.                => #<marker at 3770 in markers.texi>
  712.           (marker-buffer m)
  713.                => #<buffer markers.texi>
  714.           (marker-position m)
  715.                => 3770
  716.  
  717.    Two distinct markers will be found `equal' (even though not `eq') to
  718. each other if they have the same position and buffer, or if they both
  719. point nowhere.
  720.  
  721. 
  722. File: elisp,  Node: Changing Markers,  Next: The Mark,  Prev: Information from Markers,  Up: Markers
  723.  
  724. Changing Markers
  725. ================
  726.  
  727.    This section describes how to change the position of an existing
  728. marker.  When you do this, be sure you know whether the marker is used
  729. outside of your program, and, if so, what effects will result from
  730. moving it--otherwise, confusing things may happen in other parts of
  731. Emacs.
  732.  
  733.  -- Function: set-marker MARKER POSITION &optional BUFFER
  734.      This function moves MARKER to POSITION in BUFFER.  If BUFFER is
  735.      not provided, it defaults to the current buffer.
  736.  
  737.      If POSITION is less than 1, `set-marker' moves marker to the
  738.      beginning of the buffer.  If the value of POSITION is greater than
  739.      the size of the buffer, `set-marker' moves marker to the end of
  740.      the buffer.  If POSITION is `nil' or a marker that points nowhere,
  741.      then MARKER is set to point nowhere.
  742.  
  743.      The value returned is MARKER.
  744.  
  745.           (setq m (point-marker))
  746.                => #<marker at 4714 in markers.texi>
  747.           (set-marker m 55)
  748.                => #<marker at 55 in markers.texi>
  749.           (setq b (get-buffer "foo"))
  750.                => #<buffer foo>
  751.           (set-marker m 0 b)
  752.                => #<marker at 1 in foo>
  753.  
  754.  -- Function: move-marker MARKER POSITION &optional BUFFER
  755.      This is another name for `set-marker'.
  756.  
  757. 
  758. File: elisp,  Node: The Mark,  Next: The Region,  Prev: Changing Markers,  Up: Markers
  759.  
  760. The Mark
  761. ========
  762.  
  763.    A special marker in each buffer is designated "the mark".  It
  764. records a position for the user for the sake of commands such as `C-w'
  765. and `C-x TAB'.  Lisp programs should set the mark only to values that
  766. have a potential use to the user, and never for their own internal
  767. purposes.  For example, the `replace-regexp' command sets the mark to
  768. the value of point before doing any replacements, because this enables
  769. the user to move back there conveniently after the replace is finished.
  770.  
  771.    Many commands are designed so that when called interactively they
  772. operate on the text between point and the mark.  If you are writing such
  773. a command, don't examine the mark directly; instead, use `interactive'
  774. with the `r' specification.  This will provide the values of point and
  775. the mark as arguments to the command in an interactive call, but will
  776. permit other Lisp programs to specify arguments explicitly.  *Note
  777. Interactive Codes::.
  778.  
  779.    Each buffer has its own value of the mark that is independent of the
  780. value of the mark in other buffers.  When a buffer is created, the mark
  781. exists but does not point anywhere.  We consider this state as "the
  782. absence of a mark in that buffer".
  783.  
  784.    In addition to the mark, each buffer has a "mark ring" which is a
  785. list of markers that are the previous values of the mark.  When editing
  786. commands change the mark, they should normally save the old value of the
  787. mark on the mark ring.  The mark ring may contain no more than the
  788. maximum number of entries specified by the variable `mark-ring-max';
  789. excess entries are discarded on a first-in-first-out basis.
  790.  
  791.  -- Function: mark
  792.      This function returns the position of the current buffer's mark as
  793.      an integer.  `nil' is returned if the mark is not yet set for this
  794.      buffer.
  795.  
  796.  -- Function: mark-marker
  797.      This function returns the current buffer's mark.  This the very
  798.      marker which records the mark location inside Emacs, not a copy. 
  799.      Therefore, changing this marker's position will directly affect
  800.      the position of the mark. Don't do it unless that is the effect
  801.      you want.
  802.  
  803.           (setq m (mark-marker))
  804.                => #<marker at 3420 in markers.texi>
  805.           (set-marker m 100)
  806.                => #<marker at 100 in markers.texi>
  807.           (mark-marker)
  808.                => #<marker at 100 in markers.texi>
  809.  
  810.      Like any marker, this marker can be set to point at any buffer you
  811.      like. We don't recommend that you make it point at any buffer
  812.      other than the one of which it is the mark.  If you do, it will
  813.      yield perfectly consistent, if rather odd, results.
  814.  
  815.  -- Command: set-mark-command JUMP
  816.      If JUMP is `nil', this command sets the mark to the value of point
  817.      and pushes the previous value of the mark on the mark ring.  The
  818.      message `Mark set' is also displayed in the echo area.
  819.  
  820.      If JUMP is not `nil', this command sets point to the value of the
  821.      mark, and sets the mark to the previous saved mark value, which is
  822.      popped off the mark ring.
  823.  
  824.      This function is *only* intended for interactive use.
  825.  
  826.  -- Function: set-mark POSITION
  827.      This function sets the mark to POSITION. The old value of the mark
  828.      is *not* pushed onto the mark ring.
  829.  
  830.      *Note:* use this function only if you want the user to see that
  831.      the mark has moved, and you want the previous mark position to be
  832.      lost. Normally, when a new mark is set, the old one should go on
  833.      the `mark-ring', which is why most applications should use
  834.      `push-mark' and `pop-mark', not `set-mark'.
  835.  
  836.      Novice Emacs Lisp programmers often try to use the mark for the
  837.      wrong purposes.  The mark saves a location for the user's
  838.      convenience.  An editing command should not alter the mark unless
  839.      altering the mark is part of the user-level functionality of the
  840.      command.  (And, in that case, this effect should be documented.) 
  841.      To remember a location for internal use in the Lisp program, store
  842.      it in a Lisp variable.  For example:
  843.  
  844.              (let ((beg (point)))
  845.                 (forward-line 1)
  846.                 (delete-region beg (point))).
  847.  
  848.  -- Variable: mark-ring
  849.      The value of this buffer-local variable is the list of saved former
  850.      marks of the current buffer, most recent first.
  851.  
  852.           mark-ring
  853.           => (#<marker at 11050 in markers.texi>
  854.               #<marker at 10832 in markers.texi>
  855.               ...)
  856.  
  857.  -- User Option: mark-ring-max
  858.      The value of this variable is the maximum size of `mark-ring'. If
  859.      more marks than this are pushed onto the `mark-ring', it discards
  860.      marks on a first-in, first-out basis.
  861.  
  862.  -- Function: push-mark &optional POSITION NOMSG
  863.      This function sets the current buffer's mark to POSITION, and
  864.      pushes a copy of the previous mark onto `mark-ring'.  If POSITION
  865.      is `nil', then the value of point is used. `push-mark' returns
  866.      `nil'.
  867.  
  868.      A `Mark set' message is displayed unless NOMSG is non-`nil'.
  869.  
  870.  -- Function: pop-mark
  871.      This function pops off the top element of `mark-ring' and makes
  872.      that mark become the buffer's actual mark.  This does not change
  873.      the buffer's point and does nothing if `mark-ring' is empty.
  874.  
  875.      The return value is not useful.
  876.  
  877. 
  878. File: elisp,  Node: The Region,  Prev: The Mark,  Up: Markers
  879.  
  880. The Region
  881. ==========
  882.  
  883.    The text between point and the mark is known as "the region".
  884. Various functions operate on text delimited by point and the mark, but
  885. only those functions specifically related to the region itself are
  886. described here.
  887.  
  888.  -- Function: region-beginning
  889.      This function returns the position of the beginning of the region
  890.      (as an integer).  This is the position of either point or the mark,
  891.      whichever is smaller.
  892.  
  893.      If the mark does not point anywhere, an error is signaled.
  894.  
  895.  -- Function: region-end
  896.      This function returns the position of the end of the region (as an
  897.      integer).  This is the position of either point or the mark,
  898.      whichever is larger.
  899.  
  900.      If the mark does not point anywhere, an error is signaled.
  901.  
  902.    Few programs need to use the `region-beginning' and `region-end'
  903. functions.  A command designed to operate on a region should instead
  904. use `interactive' with the `r' specification, so that the same function
  905. can be called with explicit bounds arguments from programs.  (*Note
  906. Interactive Codes::.)
  907.  
  908. 
  909. File: elisp,  Node: Text,  Next: Searching and Matching,  Prev: Markers,  Up: Top
  910.  
  911. Text
  912. ****
  913.  
  914.    This chapter describes the functions that deal with the text in a
  915. buffer.  Most examine, insert or delete text in the current buffer,
  916. often in the vicinity of point.  Many are interactive.  All the
  917. functions that change the text provide for undoing the changes (*note
  918. Undo::.).
  919.  
  920.    Many text-related functions operate on a region of text defined by
  921. two buffer positions passed in arguments named START and END. These
  922. arguments should be either markers (*note Markers::.) or or numeric
  923. character positions (*note Positions::.).  The order of these arguments
  924. does not matter; it is all right for START to be the end of the region
  925. and END the beginning.  For example, `(delete-region 1 10)' and
  926. `(delete-region 10 1)' perform identically.  An `args-out-of-range'
  927. error is signaled if either START or END is outside the accessible
  928. portion of the buffer.  In an interactive call, point and the mark are
  929. used for these arguments.
  930.  
  931.    Throughout this chapter, "text" refers to the characters in the
  932. buffer.
  933.  
  934. * Menu:
  935.  
  936. * Near Point::       Examining text in the vicinity of point.
  937. * Buffer Contents::  Examining text in a general fashion.
  938. * Insertion::        Adding new text to a buffer.
  939. * Commands for Insertion::  User-level commands to insert text.
  940. * Deletion::         Removing text from a buffer.
  941. * User-Level Deletion::     User-level commands to delete text.
  942. * The Kill Ring::    Where removed text sometimes is saved for later use.
  943. * Undo::             Undoing changes to the text of a buffer.
  944. * Auto Filling::     How auto-fill mode is implemented to break lines.
  945. * Filling::          Functions for explicit filling.
  946. * Sorting::          Functions for sorting parts of the buffer.
  947. * Indentation::      Functions to insert or adjust indentation.
  948. * Columns::          Computing horizontal positions, and using them.
  949. * Case Changes::     Case conversion of parts of the buffer.
  950. * Substitution::     Replacing a given character wherever it appears.
  951. * Underlining::      Inserting or deleting underlining-by-overstrike.
  952. * Registers::        How registers are implemented.  Accessing the text or
  953.                        position stored in a register.
  954.  
  955. 
  956. File: elisp,  Node: Near Point,  Next: Buffer Contents,  Prev: Text,  Up: Text
  957.  
  958. Examining Text Near Point
  959. =========================
  960.  
  961.    Many functions are provided to look at the characters around point.
  962. Several simple functions are described here.  See also `looking-at' in
  963. *Note Searching and Matching::.
  964.  
  965.  -- Function: char-after POSITION
  966.      This function returns the character in the current buffer at (i.e.,
  967.      immediately after) position POSITION.  If POSITION is out of range
  968.      for this purpose, either before the beginning of the buffer, or at
  969.      or beyond the end, than the value is `nil'.
  970.  
  971.      Remember that point is always between characters, and the terminal
  972.      cursor normally appears over the character following point. 
  973.      Therefore, the character returned by `char-after' is the character
  974.      the cursor is over.
  975.  
  976.      In the following example, assume that the first character in the
  977.      buffer is `@':
  978.  
  979.           (char-to-string (char-after 1))
  980.                => "@"
  981.  
  982.  -- Function: following-char
  983.      This function returns the character following point in the current
  984.      buffer.  This is similar to `(char-after (point))'.  However, point
  985.      is at the end of the buffer, then the result of `following-char' is
  986.      0.
  987.  
  988.      In this example, point is between the `a' and the `c'.
  989.  
  990.           ---------- Buffer: foo ----------
  991.           Gentlemen may cry ``Pea-!-ce! Peace!,'' but there is no peace.
  992.           ---------- Buffer: foo ----------
  993.           
  994.           (char-to-string (preceding-char))
  995.                => "a"
  996.           (char-to-string (following-char))
  997.                => "c"
  998.  
  999.  -- Function: preceding-char
  1000.      This function returns the character preceding point in the current
  1001.      buffer.  See above, under `following-char', for an example.  If
  1002.      point is at the beginning of the buffer, then the result of
  1003.      `preceding-char' is 0.
  1004.  
  1005.  -- Function: bobp
  1006.      This function returns `t' if point is at the beginning of the
  1007.      buffer.  If narrowing is in effect, this means the beginning of the
  1008.      accessible portion of the text.  See also `point-min' in *Note
  1009.      Point::.
  1010.  
  1011.  -- Function: eobp
  1012.      This function returns `t' if point is at the end of the buffer. If
  1013.      narrowing is in effect, this means the end of accessible portion of
  1014.      the text.  See also `point-max' in *Note Point::.
  1015.  
  1016.  -- Function: bolp
  1017.      This function returns `t' if point is at the beginning of a line.
  1018.      *Note Text Lines::.
  1019.  
  1020.  -- Function: eolp
  1021.      This function returns `t' if point is at the end of a line. The
  1022.      end of the buffer is always considered the end of a line.
  1023.  
  1024. 
  1025. File: elisp,  Node: Buffer Contents,  Next: Insertion,  Prev: Near Point,  Up: Text
  1026.  
  1027. Examining Buffer Contents
  1028. =========================
  1029.  
  1030.    This section describes two functions that allow a Lisp program to
  1031. convert any portion of the text in the buffer into a string.
  1032.  
  1033.  -- Function: buffer-substring START END
  1034.      This function returns a string containing a copy of the text of the
  1035.      region defined by positions START and END in the current buffer. 
  1036.      If the arguments are not positions in the accessible portion of
  1037.      the buffer, Emacs signals an `args-out-of-range' error.
  1038.  
  1039.      It is not necessary for START to be less than END; the arguments
  1040.      can be given in either order.  But most often the smaller argument
  1041.      is written first.
  1042.  
  1043.           ---------- Buffer: foo ----------
  1044.           This is the contents of buffer foo
  1045.           
  1046.           ---------- Buffer: foo ----------
  1047.           
  1048.           (buffer-substring 1 10)
  1049.           => "This is t"
  1050.           (buffer-substring (point-max) 10)
  1051.           => "he contents of buffer foo
  1052.           "
  1053.  
  1054.  -- Function: buffer-string
  1055.      This function returns the contents of the accessible portion of the
  1056.      current buffer as a string.  This is the portion between
  1057.      `(point-min)' and `(point-max)' (*note Narrowing::.).
  1058.  
  1059.           ---------- Buffer: foo ----------
  1060.           This is the contents of buffer foo
  1061.           
  1062.           ---------- Buffer: foo ----------
  1063.           
  1064.           (buffer-string)
  1065.                => "This is the contents of buffer foo
  1066.           "
  1067.  
  1068. 
  1069. File: elisp,  Node: Insertion,  Next: Commands for Insertion,  Prev: Buffer Contents,  Up: Text
  1070.  
  1071. Insertion
  1072. =========
  1073.  
  1074.    Insertion takes place at point.  Markers pointing at positions after
  1075. the insertion point are relocated with the surrounding text (*note
  1076. Markers::.).  When a marker points at the place of insertion, it is
  1077. normally not relocated, so that it points to the beginning of the
  1078. inserted text; however, when `insert-before-markers' is used, all such
  1079. markers are relocated to point after the inserted text.
  1080.  
  1081.    Point may end up either before or after inserted text, depending on
  1082. the function used.  If point is left after the inserted text, we speak
  1083. of insertion "before point".
  1084.  
  1085.    Each of these functions signals an error if the current buffer is
  1086. read-only.
  1087.  
  1088.  -- Function: insert &rest ARGS
  1089.      This function inserts the strings and/or characters ARGS into the
  1090.      current buffer, at point, moving point forward.  An error is
  1091.      signaled unless all ARGS are either strings or characters.  The
  1092.      value is `nil'.
  1093.  
  1094.  -- Function: insert-before-markers &rest ARGS
  1095.      This function inserts the strings and/or characters ARGS into the
  1096.      current buffer, at point, moving point forward.  An error is
  1097.      signaled unless all ARGS are either strings or characters.  The
  1098.      value is `nil'.
  1099.  
  1100.      This function is unlike the other insertion functions in that a
  1101.      marker whose position initially equals point is relocated to come
  1102.      after the newly inserted text.
  1103.  
  1104.  -- Function: insert-char CHARACTER COUNT
  1105.      This function inserts COUNT instances of CHARACTER into the
  1106.      current buffer before point.  COUNT must be a number, and
  1107.      CHARACTER must be a character.  The value is `nil'.
  1108.  
  1109.  -- Function: insert-buffer-substring FROM-BUFFER-OR-NAME START END
  1110.      This function inserts a substring of the contents of buffer
  1111.      FROM-BUFFER-OR-NAME (which must already exist) into the current
  1112.      buffer before point.  The text inserted consists of the characters
  1113.      in the region defined by START and END.  The value is `nil'.
  1114.  
  1115.      In this example, the form is executed with buffer `bar' as the
  1116.      current buffer.  We assume that buffer `bar' is initially empty.
  1117.  
  1118.           ---------- Buffer: foo ----------
  1119.           We hold these truths to be self-evident, that all
  1120.           ---------- Buffer: foo ----------
  1121.           
  1122.           (insert-buffer-substring "foo" 1 20)
  1123.                => nil
  1124.           
  1125.           ---------- Buffer: bar ----------
  1126.           We hold these truth
  1127.           ---------- Buffer: bar ----------
  1128.  
  1129. 
  1130. File: elisp,  Node: Commands for Insertion,  Next: Deletion,  Prev: Insertion,  Up: Text
  1131.  
  1132. User-Level Insertion Commands
  1133. =============================
  1134.  
  1135.    This section describes higher-level commands for inserting text,
  1136. commands intended primarily for the user but useful also in Lisp
  1137. programs.
  1138.  
  1139.  -- Command: insert-buffer FROM-BUFFER-OR-NAME
  1140.      This function inserts the entire contents of FROM-BUFFER-OR-NAME
  1141.      (which must exist) into the current buffer after point.  It leaves
  1142.      the mark after the inserted text.  The value is unpredictable.
  1143.  
  1144.  -- Command: quoted-insert COUNT
  1145.      This function reads the next input character verbatim and inserts
  1146.      it. It is primarily useful for inserting control characters.  You
  1147.      may also type up to 3 octal digits, to insert a character with
  1148.      that code.
  1149.  
  1150.      The argument COUNT is the number of these characters to insert. An
  1151.      error is signaled if COUNT is not a number.
  1152.  
  1153.      This function is primarily for interactive use; there is no reason
  1154.      to use it in a program except for installing it on a keymap.  It
  1155.      returns `nil'.
  1156.  
  1157.  -- Command: self-insert-command COUNT
  1158.      This function inserts the last character typed COUNT times and
  1159.      returns `nil'.  This is the function that most printing characters
  1160.      are bound to.  In routine use, `self-insert-command' is the most
  1161.      frequently called function in Emacs, but programs rarely use it
  1162.      except to install it on a keymap.
  1163.  
  1164.      In an interactive call, COUNT is the numeric prefix argument.
  1165.  
  1166.      This function calls `auto-fill-hook' if the current column number
  1167.      is greater than the value of `fill-column' and the character
  1168.      inserted is a space (*note Auto Filling::.).
  1169.  
  1170.      This function performs abbrev expansion if Abbrev mode (*note
  1171.      Abbrevs::.) is enabled and the inserted character does not have
  1172.      word-constituent syntax (*note Syntax Class Table::.).
  1173.  
  1174.      This function is also responsible for calling the
  1175.      `blink-paren-hook' when the inserted character has close
  1176.      parenthesis syntax (*note Blinking::.).
  1177.  
  1178.  -- Command: newline &optional NUMBER-OF-NEWLINES
  1179.      This function inserts newlines into the current buffer before
  1180.      point. If NUMBER-OF-NEWLINES is supplied, that many newline
  1181.      characters are inserted.
  1182.  
  1183.      In Auto Fill mode, `newline' can break the preceding line if
  1184.      NUMBER-OF-NEWLINES is not supplied.  When this happens, it
  1185.      actually inserts two newlines at different places: one at point,
  1186.      and another earlier in the line.  `newline' does not auto-fill if
  1187.      NUMBER-OF-NEWLINES is non-`nil'.
  1188.  
  1189.      The value returned is `nil'.  In an interactive call, COUNT is the
  1190.      numeric prefix argument.
  1191.  
  1192.  -- Command: split-line
  1193.      This function splits the current line, moving the portion of the
  1194.      line after point down vertically, so that it is on the next line
  1195.      directly below where it was before.  Whitespace is inserted as
  1196.      needed at the beginning of the lower line, using the `indent-to'
  1197.      function. `split-line' returns the position of point.
  1198.  
  1199.      Programs hardly ever use this function.
  1200.  
  1201.  -- Command: open-line COUNT
  1202.      This function inserts COUNT newlines into the current buffer after
  1203.      point, leaving point where it was.
  1204.  
  1205.      In an interactive call, COUNT is the numeric prefix argument.
  1206.      Programs hardly ever use this function.  The value is
  1207.      unpredictable.
  1208.  
  1209.  -- Command: overwrite-mode ARGUMENT
  1210.      This function turns Overwrite mode on or off.  If ARGUMENT is
  1211.      `nil' then the mode is toggled.  Otherwise, if ARGUMENT is a
  1212.      positive number (greater than zero), then the mode is turned on;
  1213.      any other argument turns it off.
  1214.  
  1215.      When Overwrite mode is on, self-inserting graphic characters
  1216.      replace existing text character for character, and do not push the
  1217.      existing text to the right.
  1218.  
  1219.      This function affects primarily `self-insert-command'.
  1220.  
  1221.      In an interactive call, ARGUMENT is set to the raw prefix
  1222.      argument.  The return value of `overwrite-mode' is unpredictable.
  1223.  
  1224.  -- Variable: overwrite-mode
  1225.      Overwrite mode is in effect when this variable is non-`nil'.  It is
  1226.      automatically made buffer-local when set in any fashion.
  1227.  
  1228.