]> git.eshelyaron.com Git - emacs.git/commit
(signal_or_quit): Preserve error object identity
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 27 Dec 2023 20:06:32 +0000 (15:06 -0500)
committerEshel Yaron <me@eshelyaron.com>
Fri, 5 Jan 2024 08:20:40 +0000 (09:20 +0100)
commit08d856cf107dba89f7f82e315e15930f110a1fe5
treeb9c81f6735ce92d6f9863dd7c0a27aa0305cdbc4
parent0dfebb410301e1a336b57f8196aaf7473d5f7f94
(signal_or_quit): Preserve error object identity

Make sure we build the (ERROR-SYMBOL . ERROR-DATA) object only once
when signaling an error, so that its `eq` identity can be used.
It also gets us a tiny bit closer to having real "error objects"
like in most other current programming languages.

* src/eval.c (maybe_call_debugger): Change arglist to receive the error
object instead of receiving the signal and the data separately.
(signal_or_quit): Build the error object right at the beginning so it
stays `eq` to itself.
Rename the `keyboard_quit` arg to `continuable` so say what it does
rather than what it's used for.
(signal_quit_p): Change arg to be the error object rather than just the
error-symbol.

* src/keyboard.c (cmd_error_internal, menu_item_eval_property_1):
Adjust calls to `signal_quit_p` accordingly.

* test/src/eval-tests.el (eval-tests--error-id): New test.

(cherry picked from commit 2ef6e40da88d5b4f070e339a2210f5751ab6a7cb)
src/eval.c
src/keyboard.c
test/src/eval-tests.el