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

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

bug#32462: 26.1; Can `count-lines' be rewritten to use the newline cache


From: Eli Zaretskii
Subject: bug#32462: 26.1; Can `count-lines' be rewritten to use the newline cache?
Date: Fri, 17 Aug 2018 17:40:35 +0300

> Date: Fri, 17 Aug 2018 13:01:38 +1200
> From: Phil Sainty <psainty@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).

(And based on my experience, the newline cache doesn't actually speed
up things all that much, except in buffers with unusually long lines.)





reply via email to

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