[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#25243: 26.0.50; ffap-guesser very slow w/ region active in large dif
bug#25243: 26.0.50; ffap-guesser very slow w/ region active in large diff files
Thu, 22 Dec 2016 09:22:38 -0800 (PST)
Thanks for working on this, Tino. Some minor comments below.
> +(defvar ffap-max-region-length 1024
> + "Maximum allowed region length in `ffap-string-at-point'.")
1. I think it should say "active region".
Very minor (can be ignored): If we say something is not allowed it is
unclear what happens. In particular, it can suggest that we raise an
error. You might want to say here that if the active region is larger
... it is considered empty. (Or just refer to `ffap-string-at-point',
which you do already.)
> + (region-len (- (max beg end) (min beg end))))
> + (if (or (null 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 ""))))
1. The doc string should say that if the active region is
larger than `ffap-max-region-length' then those two vars
are set to ... and ....
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.