static struct text_pos display_prop_end P_ ((struct it *, Lisp_Object,
struct text_pos));
static int compute_window_start_on_continuation_line P_ ((struct window *));
-static Lisp_Object eval_handler P_ ((Lisp_Object));
+static Lisp_Object safe_eval_handler P_ ((Lisp_Object));
static void insert_left_trunc_glyphs P_ ((struct it *));
static struct glyph_row *get_overlay_arrow_glyph_row P_ ((struct window *));
static void extend_face_to_end_of_line P_ ((struct it *));
Lisp form evaluation
***********************************************************************/
-/* Error handler for eval_form and call_function. */
+/* Error handler for safe_eval and safe_call. */
static Lisp_Object
-eval_handler (arg)
+safe_eval_handler (arg)
Lisp_Object arg;
{
return Qnil;
wrong. */
Lisp_Object
-eval_form (sexpr)
+safe_eval (sexpr)
Lisp_Object sexpr;
{
int count = specpdl_ptr - specpdl;
GCPRO1 (sexpr);
specbind (Qinhibit_redisplay, Qt);
- val = internal_condition_case_1 (Feval, sexpr, Qerror, eval_handler);
+ val = internal_condition_case_1 (Feval, sexpr, Qerror, safe_eval_handler);
UNGCPRO;
return unbind_to (count, val);
}
Return the result, or nil if something went wrong. */
Lisp_Object
-call_function (nargs, args)
+safe_call (nargs, args)
int nargs;
Lisp_Object *args;
{
gcpro1.nvars = nargs;
specbind (Qinhibit_redisplay, Qt);
val = internal_condition_case_2 (Ffuncall, nargs, args, Qerror,
- eval_handler);
+ safe_eval_handler);
UNGCPRO;
return unbind_to (count, val);
}
+/* Call function FN with one argument ARG.
+ Return the result, or nil if something went wrong. */
+
+Lisp_Object
+safe_call1 (fn, arg)
+ Lisp_Object fn, arg;
+{
+ Lisp_Object args[2];
+ args[0] = fn;
+ args[1] = arg;
+ return safe_call (2, args);
+}
+
+
\f
/***********************************************************************
Debugging
specbind (Qafter_change_functions, Qnil);
if (!CONSP (val) || EQ (XCAR (val), Qlambda))
- call1 (val, pos);
+ safe_call1 (val, pos);
else
{
Lisp_Object globals, fn;
{
fn = XCAR (globals);
if (!EQ (fn, Qt))
- call1 (fn, pos);
+ safe_call1 (fn, pos);
}
}
else
- call1 (fn, pos);
+ safe_call1 (fn, pos);
}
UNGCPRO;
TEMP_SET_PT_BOTH (CHARPOS (end_pos), BYTEPOS (end_pos));
}
- form = eval_form (form);
+ form = safe_eval (form);
if (BUFFERP (object))
TEMP_SET_PT_BOTH (CHARPOS (pt), BYTEPOS (pt));
{
/* Call function with current height as argument.
Value is the new height. */
- Lisp_Object args[2], height;
-
- args[0] = it->font_height;
- args[1] = face->lface[LFACE_HEIGHT_INDEX];
- height = call_function (2, args);
-
+ Lisp_Object height;
+ height = safe_call1 (it->font_height,
+ face->lface[LFACE_HEIGHT_INDEX]);
if (NUMBERP (height))
new_height = XFLOATINT (height);
}
int count = specpdl_ptr - specpdl;
specbind (Qheight, face->lface[LFACE_HEIGHT_INDEX]);
- value = eval_form (it->font_height);
+ value = safe_eval (it->font_height);
unbind_to (count, Qnil);
if (NUMBERP (value))
struct gcpro gcpro1;
Lisp_Object spec;
- spec = eval_form (XCAR (XCDR (elt)));
+ spec = safe_eval (XCAR (XCDR (elt)));
GCPRO1 (spec);
n += display_mode_element (it, depth, field_width - n,
precision - n, spec);