GNU bug report logs - #18013
looking-back is inefficient

Previous Next

Package: emacs;

Reported by: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>

Date: Mon, 14 Jul 2014 09:48:02 UTC

Severity: minor

Tags: wontfix

Found in version 24.3.92

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: npostavs <at> users.sourceforge.net
To: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Cc: Andreas Schwab <schwab <at> suse.de>, 18013 <at> debbugs.gnu.org
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
tags 18013 wontfix
close 18013
quit

Nicolas Richard <theonewiththeevillook <at> 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)))




This bug report was last modified 8 years and 115 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.