Subject: bug#24353: 25.1.1: looking-back wrong info

From: [email-masked]
Date: Sat, 03 Sep 2016 14:31:33 -0400

Drew Adams <[email-masked]> writes:

> The right fix is to have the doc do three things:
>
> 1. Be honest about the signature.

Casting this as a moral issue (about "honesty") doesn't seem to be
constructive.  Anyway, the whole point of advertised-calling-convention
is to advertise a signature different from the actual implemented one.

> 2. Recommend strongly that you use LIMIT.
> 3. Say WHY you should use LIMIT: not doing so can lead
>    to poor performance.

The doc string already says

    LIMIT if non-nil speeds up the search by specifying a minimum
    starting position, to avoid checking matches that would start
    before LIMIT.

>
> Had #2 and #3 been in the doc when you (presumably) first
> consulted it, you would likely have included LIMIT, and
> there would be no need to "upgrade" your code now.
>
> Is there a reason to avoid using `looking-back', even if
> LIMIT is provided?  It too should be mentioned in the doc.

The docstring already says

    As a general recommendation, try to avoid using ‘looking-back’
    wherever possible, since it is slow.