From cc92c454ade571f06d04a7578139b561c799b204 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 8 Aug 2012 15:53:44 -0400 Subject: [PATCH] * src/xdisp.c (safe_eval_handler): Remove prototype. Receive args describing the failing expression, include them in the error message. * src/eval.c (internal_condition_case_n): Pass nargs and args to hfun. * src/lisp.h (internal_condition_case_n): Update declaration. --- src/ChangeLog | 7 +++++++ src/eval.c | 6 ++++-- src/lisp.h | 4 +++- src/w32term.c | 4 ++-- src/xdisp.c | 6 +++--- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3717b4400b2..4a570a51df4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-08-08 Stefan Monnier + + * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing + the failing expression, include them in the error message. + * eval.c (internal_condition_case_n): Pass nargs and args to hfun. + * lisp.h (internal_condition_case_n): Update declaration. + 2012-08-08 Dmitry Antipov Inline functions to examine and change buffer overlays. diff --git a/src/eval.c b/src/eval.c index d648be81b8d..b531f790cc5 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1399,7 +1399,9 @@ internal_condition_case_n (Lisp_Object (*bfun) (ptrdiff_t, Lisp_Object *), ptrdiff_t nargs, Lisp_Object *args, Lisp_Object handlers, - Lisp_Object (*hfun) (Lisp_Object)) + Lisp_Object (*hfun) (Lisp_Object err, + ptrdiff_t nargs, + Lisp_Object *args)) { Lisp_Object val; struct catchtag c; @@ -1417,7 +1419,7 @@ internal_condition_case_n (Lisp_Object (*bfun) (ptrdiff_t, Lisp_Object *), c.byte_stack = byte_stack_list; if (_setjmp (c.jmp)) { - return (*hfun) (c.val); + return (*hfun) (c.val, nargs, args); } c.next = catchlist; catchlist = &c; diff --git a/src/lisp.h b/src/lisp.h index ea6f9dac249..025736e7fb5 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2952,7 +2952,9 @@ extern Lisp_Object internal_lisp_condition_case (Lisp_Object, Lisp_Object, Lisp_ extern Lisp_Object internal_condition_case (Lisp_Object (*) (void), Lisp_Object, Lisp_Object (*) (Lisp_Object)); extern Lisp_Object internal_condition_case_1 (Lisp_Object (*) (Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)); extern Lisp_Object internal_condition_case_2 (Lisp_Object (*) (Lisp_Object, Lisp_Object), Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object (*) (Lisp_Object)); -extern Lisp_Object internal_condition_case_n (Lisp_Object (*) (ptrdiff_t, Lisp_Object *), ptrdiff_t, Lisp_Object *, Lisp_Object, Lisp_Object (*) (Lisp_Object)); +extern Lisp_Object internal_condition_case_n + (Lisp_Object (*) (ptrdiff_t, Lisp_Object *), ptrdiff_t, Lisp_Object *, + Lisp_Object, Lisp_Object (*) (Lisp_Object, ptrdiff_t, Lisp_Object *)); extern void specbind (Lisp_Object, Lisp_Object); extern void record_unwind_protect (Lisp_Object (*) (Lisp_Object), Lisp_Object); extern Lisp_Object unbind_to (ptrdiff_t, Lisp_Object); diff --git a/src/w32term.c b/src/w32term.c index 8108a1eb1c0..190919f7176 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -5493,7 +5493,7 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, /* Check if we need to resize the frame due to a fullscreen request. - If so needed, resize the frame. */ + If so needed, resize the frame. */ static void x_check_fullscreen (struct frame *f) { @@ -5513,7 +5513,7 @@ x_check_fullscreen (struct frame *f) SET_FRAME_GARBAGED (f); cancel_mouse_face (f); - /* Wait for the change of frame size to occur */ + /* Wait for the change of frame size to occur. */ f->want_fullscreen |= FULLSCREEN_WAIT; } } diff --git a/src/xdisp.c b/src/xdisp.c index 39a6067278f..3f1c97e601f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -838,7 +838,6 @@ static int string_char_and_length (const unsigned char *, int *); static struct text_pos display_prop_end (struct it *, Lisp_Object, struct text_pos); static int compute_window_start_on_continuation_line (struct window *); -static Lisp_Object safe_eval_handler (Lisp_Object); static void insert_left_trunc_glyphs (struct it *); static struct glyph_row *get_overlay_arrow_glyph_row (struct window *, Lisp_Object); @@ -2397,9 +2396,10 @@ remember_mouse_glyph (struct frame *f, int gx, int gy, NativeRectangle *rect) /* Error handler for safe_eval and safe_call. */ static Lisp_Object -safe_eval_handler (Lisp_Object arg) +safe_eval_handler (Lisp_Object arg, ptrdiff_t nargs, Lisp_Object *args) { - add_to_log ("Error during redisplay: %S", arg, Qnil); + add_to_log ("Error during redisplay: %S signalled %S", + Flist (nargs, args), arg); return Qnil; } -- 2.39.2