]> git.eshelyaron.com Git - emacs.git/commit
Refactoring: have CATCHER_ALL also catch signals.
authorPhilipp Stephani <phst@google.com>
Thu, 18 Apr 2019 23:04:55 +0000 (01:04 +0200)
committerPhilipp Stephani <phst@google.com>
Thu, 18 Apr 2019 23:04:55 +0000 (01:04 +0200)
commit23a82cba12380b0905670c34395dc460a4bc9984
treedf001ea84a8173dab9381a3ec75d36d25f6a3650
parente712a8fe0929a18eaf3f4ec83b023f475afdc4d4
Refactoring: have CATCHER_ALL also catch signals.

In all cases where we use a CATCHER_ALL handler we also want to catch
signals.  Therefore have 'signal' respect CATCHER_ALL.  Adapt internal
interfaces so that handlers can distinguish among the two types of
nonlocal exits in CATCHER_ALL handlers.

* src/lisp.h (enum nonlocal_exit): New enum.
(struct handler): Add member 'nonlocal_exit' to hold the type of
nonlocal exit during stack unwinding.

* src/eval.c (signal_or_quit): Also respect CATCHER_ALL handlers.
(unwind_to_catch): Store nonlocal exit type in catch structure.
(Fthrow, signal_or_quit): Adapt callers.
(internal_catch_all): Install only one handler.  Give handler a
nonlocal exit type argument.
(internal_catch_all_1): Remove, no longer needed.

* src/emacs-module.c (MODULE_SETJMP): Install only one handler.
(module_handle_nonlocal_exit): New function to handle all nonlocal
exits.
(MODULE_SETJMP_1): Pass nonlocal exit type to handler function.
(module_handle_signal, module_handle_throw): Remove, no longer needed.

* src/json.c (json_handle_nonlocal_exit): New helper function.
(json_insert_callback): Adapt to change in 'internal_catch_all'.
src/emacs-module.c
src/eval.c
src/json.c
src/lisp.h