bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18013: 24.3.92; looking-back "[^\n]" taking a lot of time in large b


From: npostavs
Subject: bug#18013: 24.3.92; looking-back "[^\n]" taking a lot of time in large buffers
Date: Sat, 25 Mar 2017 16:59:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

tags 18013 wontfix
close 18013
quit

Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:

>
> (looking-back "[^\n]") is bad code, so I totally deserve this. Still, is
> it possible to make the search smarter when the match is supposed to be
> "anchored" at point ? Otherwise let's just close this bug.

`looking-back' would have to analyse "[^\n]" to realize that it could
only match a single character.  I think this is too much effort for too
little benefit to justify implementing this.  For cases like this you
can limit the amount of searching by passing a non-nil LIMIT argument
(as described in the docstring):

    (looking-back "[^\n]" (1- (point)))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]