From: Xue Fuqiao Date: Sun, 29 Sep 2013 06:16:45 +0000 (+0800) Subject: Refine documentation of `looking-back'. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1431 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6cfe977d9f4cc0ac1321ef25a18c4f2a7d5fb9b1;p=emacs.git Refine documentation of `looking-back'. * lisp/subr.el (looking-back): Do not recommend using looking-back. (bug#5689) * doc/lispref/searching.texi (Regexp Search): Refine. --- diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 2fa3fc13e31..4a55b17127d 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,7 @@ +2013-09-29 Xue Fuqiao + + * searching.texi (Regexp Search): Refine. + 2013-09-22 Xue Fuqiao * nonascii.texi (Default Coding Systems): Typo fix. diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 386d5bdde4c..993c2b26772 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1146,13 +1146,7 @@ implemented by searching backwards from point for a match that ends at point. That can be quite slow if it has to search a long distance. 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}. +found must begin at or after @var{limit}. Here's an example: @example @group @@ -1168,6 +1162,12 @@ comes back" twice. @end group @end example +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}. + @c http://debbugs.gnu.org/5689 As a general recommendation, try to avoid using @code{looking-back} wherever possible, since it is slow. For this reason, there are no diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9a04acfa686..9395df089bb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2013-09-29 Xue Fuqiao + + * subr.el (looking-back): Do not recommend using looking-back. + 2013-09-28 Alan Mackenzie Fix indentation/fontification of Java enum with "implements". diff --git a/lisp/subr.el b/lisp/subr.el index 43be9f529be..ba240a27064 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3482,7 +3482,10 @@ If GREEDY is non-nil, extend 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 -LIMIT." +LIMIT. + +As a general recommendation, try to avoid using `looking-back' +wherever possible, since it is slow." (let ((start (point)) (pos (save-excursion