Subject: bug#22763: 25.1.50; Feature Request -- A faster method to obtain line number at position.

From: Eli Zaretskii <[email-masked]>
Date: Sun, 07 Feb 2021 22:50:29 +0200

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked],  [email-masked]
> Date: Sun, 07 Feb 2021 21:42:30 +0100
> 
> Why does display_count_lines (with no cache) exist, then?

It exists to support the line-number display on the mode line.  That
display has its own cache, as part of the window object, so
display_count_lines very rarely needs to count from the beginning of
the buffer, it usually counts from the last place it stopped the
previous time for the same window.  This is why it has the signature
that it has.