2.3 Regions

  • 2.3.1 Region Functions
  • A region is simply a pair of marks: a starting mark and an ending mark. The text in a region consists of the characters following the starting mark and preceding the ending mark (keep in mind that a mark points between characters on a line, not at them). [annotate]

    By modifying the starting or ending mark in a region it is possible to produce regions with a start and end which are out of order or even in different buffers. The use of such regions is undefined and may result in arbitrarily bad behavior. [annotate]

    2.3.1 Region Functions

    region  start end [Function]
              

    This function returns a region constructed from the marks start and end. It is an error for the marks to point to non-contiguous lines or for start to come after end. [annotate]

    [annotate]

    regionp  region [Function]
              

    This function returns t if region is a region object, otherwise nil. [annotate]

    [annotate]

    make-empty-region   [Function]
              

    This function returns a region with start and end marks pointing to the start of one empty line. The start mark is a :right-inserting mark, and the end is a :left-inserting mark. [annotate]

    [annotate]

    copy-region  region [Function]
              

    This function returns a region containing a copy of the text in the specified region. The resulting region is completely disjoint from region with respect to data references -- marks, lines, text, etc. [annotate]

    [annotate]

    region-to-string  region [Function]
    string-to-region  string [Function]
              

    These functions coerce regions to Lisp strings and vice versa. Within the string, lines are delimited by newline characters. [annotate]

    [annotate]

    line-to-region  line [Function]
              

    This function returns a region containing all the characters on line. The first mark is :right-inserting and the last is :left-inserting. [annotate]

    [annotate]

    region-start  region [Function]
    region-end  region [Function]
              

    This function returns the start or end mark of region. [annotate]

    [annotate]

    region-bounds  region [Function]
              

    This function returns as multiple-values the starting and ending marks of region. [annotate]

    [annotate]

    set-region-bounds  region start end [Function]
              

    This function sets the start and end of region to start and end. It is an error for start to be after or in a different buffer from end. [annotate]

    [annotate]

    count-lines  region [Function]
              

    This function returns the number of lines in the region, first and last lines inclusive. A newline is associated with the line it follows, thus a region containing some number of non-newline characters followed by one newline is one line, but if a newline were added at the beginning, it would be two lines. [annotate]

    [annotate]

    count-characters  region [Function]
              

    This function returns the number of characters in a given region. This counts line breaks as one character. [annotate]

    [annotate]

    check-region-query-size  region [Function]
    Region Query Size  (initial value 30) [Variable]
              

    check-region-query-size counts the lines in region, and if their number exceeds the Region Query Size threshold, it prompts the user for confirmation. This should be used in commands that perform destructive operations and are not undoable. If the user responds negatively, then this signals an editor-error, aborting whatever command was in progress. [annotate]

    [annotate]