bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Stefan Monnier
Subject: bug#43489: [PATCH] Don't signal scan-error when moving by sexp interactively
Date: Mon, 28 Sep 2020 13:05:27 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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






reply via email to

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