emacs-devel
[Top][All Lists]
Advanced

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

Re: master e38e7b7: Make syntax errors say the line/column they appear a


From: Stefan Monnier
Subject: Re: master e38e7b7: Make syntax errors say the line/column they appear at
Date: Mon, 01 Feb 2021 14:47:41 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> +static AVOID
> +invalid_syntax_lisp (Lisp_Object s, Lisp_Object readcharfun)
> +{
> +  if (BUFFERP (readcharfun))
> +    {
> +      xsignal1 (Qinvalid_read_syntax,
> +             CALLN (Fformat, build_string ("%s (line %d, column %d)"),
> +                    s,
> +                    /* We should already be in the readcharfun
> +                       buffer when this error is called, so no need
> +                       to switch to it first. */
> +                    make_fixnum (count_lines (BEGV_BYTE, PT_BYTE) + 1),
> +                    make_fixnum (current_column ())));

Including this info is great, thanks.

But, FWIW, I'd much rather that the error object contains "raw data"
rather than "human-readable" data.  I.e. something like:

    xsignal2 (Qinvalid_read_syntax, s, PT);

and then convert the buf-pos to line+column later on, when the error
is displayed.
[ And if we don't have any ready-made place where we can put
  this display-time conversion, then we should probably change that
  as well.  ]


        Stefan




reply via email to

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