* src/xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 8 Aug 2012 19:53:44 +0000 (15:53 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 8 Aug 2012 19:53:44 +0000 (15:53 -0400)
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
src/eval.c
src/lisp.h
src/w32term.c
src/xdisp.c

index 3717b44..4a570a5 100644 (file)
@@ -1,3 +1,10 @@
+2012-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * 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  <dmantipov@yandex.ru>
 
        Inline functions to examine and change buffer overlays.
index d648be8..b531f79 100644 (file)
@@ -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;
index ea6f9da..025736e 100644 (file)
@@ -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);
index 8108a1e..190919f 100644 (file)
@@ -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;
         }
     }
index 39a6067..3f1c97e 100644 (file)
@@ -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;
 }