www.delorie.com/gnu/docs/elisp-manual-21/elisp_492.html   search  
 
Buy the book!


GNU Emacs Lisp Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

31.8 The Region

The text between point and the mark is known as the region. Various functions operate on text delimited by point and the mark, but only those functions specifically related to the region itself are described here.

Function: region-beginning
This function returns the position of the beginning of the region (as an integer). This is the position of either point or the mark, whichever is smaller.

If the mark does not point anywhere, an error is signaled.

Function: region-end
This function returns the position of the end of the region (as an integer). This is the position of either point or the mark, whichever is larger.

If the mark does not point anywhere, an error is signaled.

Few programs need to use the region-beginning and region-end functions. A command designed to operate on a region should normally use interactive with the `r' specification to find the beginning and end of the region. This lets other Lisp programs specify the bounds explicitly as arguments. (See section 21.2.2 Code Characters for interactive.)

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003