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

From: Eli Zaretskii <[email-masked]>
Date: Sun, 31 Jan 2021 16:57:54 +0200

> From: Lars Ingebrigtsen <[email-masked]>
> Date: Sun, 31 Jan 2021 10:14:59 +0100
> Cc: [email-masked]
> 
> Should the line/column numbers be based on what Fcount_lines return, or
> should they be the actual line number of the buffer?  That is, taking
> selective display etc into consideration or not?  Ignoring all that and
> just counting newlines would make sense in many situations (it's more
> like when compiling a file), but not in others?
> 
> And...  I'm slightly nervous about calling out to something as
> complicated as Fcount_lines.

What is Fcount_lines?

> So I was poking through the Emacs lisp code to see whether there's any
> function that will just tell me what line I'm on, and there's...
> display_count_lines in xdisp.c, but that doesn't really seem like a good
> fit, since that's in redisplay, and not lread.c context.

Can you tell why did you think display_count_lines will not do the job
you need it to do?

> Isn't there any function that will just return the line number at point?

That's display_count_lines, IMO.