GNU bug report logs - #32462
26.1; Can `count-lines' be rewritten to use the newline cache?

Previous Next

Package: emacs;

Reported by: Phil Sainty <psainty <at> orcon.net.nz>

Date: Fri, 17 Aug 2018 01:02:01 UTC

Severity: wishlist

Found in version 26.1

Done: Phil Sainty <psainty <at> orcon.net.nz>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 32462-done <at> debbugs.gnu.org (full text, mbox):

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 32462-done <at> debbugs.gnu.org
Subject: Re: bug#32462: 26.1; Can `count-lines' be rewritten to use the
 newline cache?
Date: Sun, 19 Aug 2018 00:10:27 +1200
On 18/08/18 02:40, Eli Zaretskii wrote:
>> From: Phil Sainty <psainty <at> orcon.net.nz>
>> `count-lines' uses a regexp search to find all the newlines (and/or
>> carriage returns
> 
> It uses regexp search only when selective-display is in effect, which
> means almost never.  Otherwise, it uses forward-line, which uses
> scan_newline_from_point, which already uses the newline cache (unless
> the cache is disabled).

Ah, thanks Eli; I see that now.  A look at the C code suggests that the
newline cache is also a more complicated arrangement than I'd imagined,
so I don't think my original thoughts about this were actually viable.

I'm closing this bug.





This bug report was last modified 6 years and 328 days ago.

Previous Next


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