comparison lispref/searching.texi @ 64115:23d3e1c615ee

(Regexp Search): Clarify what re-search-forward does when the search fails.
author Richard M. Stallman <rms@gnu.org>
date Wed, 06 Jul 2005 22:12:01 +0000
parents c4d74e911908
children e836425ee789 f9a65d7ebd29
comparison
equal deleted inserted replaced
64114:51f6009d047b 64115:23d3e1c615ee
848 buffer. It specifies the upper bound to the search. No match 848 buffer. It specifies the upper bound to the search. No match
849 extending after that position is accepted. 849 extending after that position is accepted.
850 850
851 If @var{repeat} is supplied, it must be a positive number; the search 851 If @var{repeat} is supplied, it must be a positive number; the search
852 is repeated that many times; each repetition starts at the end of the 852 is repeated that many times; each repetition starts at the end of the
853 previous match. If all these successive searches succeed, the 853 previous match. If all these successive searches succeed, the search
854 function succeeds, moving point and returning its new value. 854 succeeds, moving point and returning its new value. Otherwise the
855 Otherwise the function fails. 855 search fails. What @code{re-search-forward} does when the search
856 856 fails depends on the value of @var{noerror}:
857 What happens when the function fails depends on the value of 857
858 @var{noerror}. If @var{noerror} is @code{nil}, a @code{search-failed} 858 @table @asis
859 error is signaled. If @var{noerror} is @code{t}, 859 @item @code{nil}
860 @code{re-search-forward} does nothing and returns @code{nil}. If 860 Signal a @code{search-failed} error.
861 @var{noerror} is neither @code{nil} nor @code{t}, then 861 @item @code{t}
862 @code{re-search-forward} moves point to @var{limit} (or the end of the 862 Do nothing and return @code{nil}.
863 accessible portion of the buffer) and returns @code{nil}. 863 @item anything else
864 Move point to @var{limit} (or the end of the accessible portion of the
865 buffer) and return @code{nil}.
866 @end table
864 867
865 In the following example, point is initially before the @samp{T}. 868 In the following example, point is initially before the @samp{T}.
866 Evaluating the search call moves point to the end of that line (between 869 Evaluating the search call moves point to the end of that line (between
867 the @samp{t} of @samp{hat} and the newline). 870 the @samp{t} of @samp{hat} and the newline).
868 871