]> code.delx.au - gnu-emacs/blobdiff - doc/lispref/searching.texi
(Standard Keymaps): Rename function-key-map to local-function-key-map.
[gnu-emacs] / doc / lispref / searching.texi
index e5846028cfd72d61d95da3289f64b87d31d1cd0f..eea165d1c1f1a11c20b5682056fccc98a37de46a 100644 (file)
@@ -1,7 +1,7 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
 @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001,
-@c   2002, 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+@c   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @setfilename ../../info/searching
 @node Searching and Matching, Syntax Tables, Non-ASCII Characters, Top
@@ -1062,8 +1062,8 @@ the match is available as @code{(match-end 0)}.  @xref{Match Data}.
 @end defun
 
 @defun string-match-p regexp string &optional start
-This predicate function does what @code{string-match} does, but it has
-no side effect of modifying the match data.
+This predicate function does what @code{string-match} does, but it
+avoids modifying the match data.
 @end defun
 
 @defun looking-at regexp
@@ -1094,7 +1094,7 @@ comes back" twice.
 @end example
 @end defun
 
-@defun looking-back regexp &optional limit
+@defun looking-back regexp &optional limit greedy
 This function returns @code{t} if @var{regexp} matches text before
 point, ending at point, and @code{nil} otherwise.
 
@@ -1105,6 +1105,12 @@ You can bound the time required by specifying @var{limit}, which says
 not to search before @var{limit}.  In this case, the match that is
 found must begin at or after @var{limit}.
 
+If @var{greedy} is non-@code{nil}, this function extends the match
+backwards as far as possible, stopping when a single additional
+previous character cannot be part of a match for regexp.  When the
+match is extended, its starting position is allowed to occur before
+@var{limit}.
+
 @example
 @group
 ---------- Buffer: foo ----------
@@ -1408,7 +1414,7 @@ subexpression is at the 13th character (@samp{c}).
   (re-search-forward "The \\(cat \\)")
   (match-beginning 0)
   (match-beginning 1))
-    @result{} (9 9 13)
+    @result{} (17 9 13)
 @end group
 
 @group