Subject: Re: bug#36970: 26.2; invalid-read-syntax could print the location of the error

From: Eli Zaretskii <[email-masked]>
Date: Mon, 01 Feb 2021 17:06:59 +0200

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Mon, 01 Feb 2021 09:40:07 +0100
> 
> 	nlines = display_count_lines (startpos_byte,
> 				      PT_BYTE, PT, &junk);
> 
> So I guess I should just put the prototype in lisp.h and use it?

Yes (and make it non-static).  Alternatively, define a wrapper for it
that doesn't accept that last arg, and make _that_ wrapper extern and
more suitably named.

> (It's kinda surprising that no other part of Emacs has felt the need
> to compute a line number before...)

Emacs almost never counts lines, except for 2 display features: the
line-number display in the mode line and display-line-numbers-mode.
The buffer-with-gap paradigm makes a point of not knowing where each
line ends and how many lines are there.