Subject: Re: bug#43489: [PATCH] Don't signal scan-error when moving by sexp interactively

From: Stefan Monnier <[email-masked]>
Date: Mon, 28 Sep 2020 13:05:27 -0400

>>> I disagree Mattias.  I think swallowing errors is bad, generally.
>>
>> Agreed, BUT the reason Matthias did it this way is that the error we get
>> currently from `scan-sexp` can't be turned into a good error message
>> without knowing that it was triggered during `forward-sexp`.
>
> I don't understand.  The point about not swallowing errors is that we
> don't want to turn them into anything else.

By "turning into" I'm referring to the job of `print-object` done in
the command-loop when it catches an unhandled error.

> I don't see why scan-sexp needs to be changed.

Because the error objects it throws give information that is
difficult/impossible to turn into good error messages.  For example,
when doing an up-list, `scan-sexp` may signal the error object:

    (scan-error "Unbalanced parentheses" 5010 1)

even tho there is no unbalanced paren in the buffer.
Instead, the error is that we were not within a set of parens when
we started.

        Stefan