Subject: bug#66912: With `require', the byte compiler reports the wrong file for errors.

From: Alan Mackenzie <[email-masked]>
Date: Sun, 10 Nov 2024 17:48:19 +0000

Hello, Stefan.

On Sun, Nov 10, 2024 at 11:45:38 -0500, Stefan Monnier wrote:
> >> Then I don't know what "the message" you're referring to.
> >> (or are you referring to some other point you made elsewhere?)
> > I simply meant what the user sees on the screen.  If the user sees
> > "While loading foo.el... \nWrong type argument: listp, baz" whilst doing
> > something, then enables the debugger and repeats the action, she should
> > see the same message at the top of the backtrace.  Surely?  Truncating
> > that message can only lead to confusion.

> I still don't understand: currently, if you see a message "Wrong
> type argument: listp, baz", then enable the debugger and reproduce the
> error, you won't see "Wrong type argument: listp, baz" but

>     Debugger entered--Lisp error: (wrong-type-argument listp baz)

> instead.  IOW, instead of the error message, you see the error object.

I've never noticed these to be different.  I suspect most users wouldn't
either.  I wasn't talking about the boilerplate and formatting being
different, I was talking about the essence of the message, the
substance.  It is the same in the two examples you have given.

Part of that essence is to be the "While loading foo.el... " bit.  I
think the user should see that, both when the error first occurs, and
when it occurs again after enabling debug-on-error and repeating the
action that caused it.

> > Again, why do you think this is what we should aim for, rather than
> > having the same message in the error handler and at the top of a
> > backtrace?

> Because of my "A => B => compile => C => D" example: the message I want
> to have depends on the chain from the point where I catch the error
> (i.e. the `condition-case`) to the point where the error is signaled.
> And I don't really care about the debugger case.

That is no explanation as to WHY you think it's the right thing.  The
point in that chain where we catch the error is an internal
implementation detail, of no interest to the user.  WHY are you so
unconcerned about the debugger case?  I think it would be consistent to
display "While loading..." the same in both cases.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).