GNU bug report logs - #36970
26.2; invalid-read-syntax could print the location of the error

Previous Next

Package: emacs;

Reported by: ndame <emacsuser <at> freemail.hu>

Date: Thu, 8 Aug 2019 08:29:01 UTC

Severity: wishlist

Tags: fixed

Found in version 26.2

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: emacsuser <at> freemail.hu, 36970 <at> debbugs.gnu.org
Subject: bug#36970: 26.2; invalid-read-syntax could print the location of the error
Date: Mon, 01 Feb 2021 17:10:30 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> 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.

Yup.  I've made the wrapper even simpler, and dropped the count, too.

>> (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.

Emacs almost never counts lines while running normally, but line numbers
are useful when reporting errors (like here), so I was surprised not to
find a convenient function to use.  On the other hand, perhaps this
explains why errors like these didn't use to report lines.  :-)

Anyway, I'm running some more tests, and then I'll push the change.  The
error message could be improved: It's

		CALLN (Fformat, build_string ("%s (line %d, column %d)"),

which looks a bit awkward -- feel free to tweak, everybody.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 4 years and 162 days ago.

Previous Next


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