Mercurial > emacs
changeset 5807:cc9d9ab24008
(internal_condition_case_1): New function.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 07 Feb 1994 01:02:05 +0000 |
parents | f40d86815317 |
children | 995860e5f342 |
files | src/eval.c |
diffstat | 1 files changed, 37 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/eval.c Mon Feb 07 00:55:58 1994 +0000 +++ b/src/eval.c Mon Feb 07 01:02:05 1994 +0000 @@ -1094,6 +1094,43 @@ return val; } +Lisp_Object +internal_condition_case_1 (bfun, arg, handlers, hfun) + Lisp_Object (*bfun) (); + Lisp_Object arg; + Lisp_Object handlers; + Lisp_Object (*hfun) (); +{ + Lisp_Object val; + struct catchtag c; + struct handler h; + + c.tag = Qnil; + c.val = Qnil; + c.backlist = backtrace_list; + c.handlerlist = handlerlist; + c.lisp_eval_depth = lisp_eval_depth; + c.pdlcount = specpdl_ptr - specpdl; + c.poll_suppress_count = poll_suppress_count; + c.gcpro = gcprolist; + if (_setjmp (c.jmp)) + { + return (*hfun) (Fcdr (c.val)); + } + c.next = catchlist; + catchlist = &c; + h.handler = handlers; + h.var = Qnil; + h.next = handlerlist; + h.tag = &c; + handlerlist = &h; + + val = (*bfun) (arg); + catchlist = c.next; + handlerlist = h.next; + return val; +} + static Lisp_Object find_handler_clause (); DEFUN ("signal", Fsignal, Ssignal, 2, 2, 0,