Subject: RE: bug#25243: 26.0.50; ffap-guesser very slow w/ region active in large diff files

From: Drew Adams <[email-masked]>
Date: Fri, 23 Dec 2016 07:41:02 -0800 (PST)

below

> > 2. Instead of testing whether the max-length var is nil, I'd suggest
> > testing it with `natnump', to take care of the unexpected case where
> > it might get assigned a non-number.
> Yes, `natnump' is a better choice.

> +    (if (or (not (natnump ffap-max-region-length))
> +            (< region-len ffap-max-region-length)) ; Bug#25243.
> +        (setf ffap-string-at-point-region (list beg end)
> +              ffap-string-at-point
> +              (buffer-substring-no-properties beg end))
> +      (setf ffap-string-at-point-region (list 1 1)
> +            ffap-string-at-point ""))))

I'd suggest the other way around.  What you have lets someone or
some code assign a non-number and get the same slow behavior we
want to avoid.  I'd say (and (natnump ...) (< region-len ...)).

IOW, if it's not a natnump and the size is not smaller than that
number then don't use the region.

The rest sounds good to me.