static char *xstrdup P_ ((char *));
static unsigned char *xstrlwr P_ ((unsigned char *));
static void signal_error P_ ((char *, Lisp_Object));
-static void add_to_log P_ ((struct frame *, char *, Lisp_Object, Lisp_Object));
static struct frame *frame_or_selected_frame P_ ((Lisp_Object, int));
static void load_face_font_or_fontset P_ ((struct frame *, struct face *, char *, int));
static void load_face_colors P_ ((struct frame *, struct face *, Lisp_Object *));
}
-/* Display a message with format string FORMAT and arguments ARG1 and
- ARG2 on frame F. Used to display errors if fonts, bitmaps, colors
- etc. for a realized face on frame F cannot be loaded. (If we would
- signal an error in these cases, we would end up in an infinite
- recursion because this would stop realization, and the redisplay
- triggered by the signal would try to realize that same face again.)
-
- If basic faces of F are not realized, just add the message to the
- messages buffer "*Messages*". Because Fmessage calls
- echo_area_display which tries to realize basic faces again, we would
- otherwise also end in an infinite recursion. */
-
-static void
-add_to_log (f, format, arg1, arg2)
- struct frame *f;
- char *format;
- Lisp_Object arg1, arg2;
-{
- Lisp_Object args[3];
- Lisp_Object nargs;
- Lisp_Object msg;
- char *buffer;
- extern int waiting_for_input;
-
- /* Function note_mouse_highlight calls face_at_buffer_position which
- may realize a face. If some attribute of that face is invalid,
- say an invalid color, don't display an error to avoid calling
- Lisp from XTread_socket. */
- if (waiting_for_input)
- return;
-
- nargs = make_number (DIM (args));
- args[0] = build_string (format);
- args[1] = arg1;
- args[2] = arg2;
- msg = Fformat (nargs, args);
-
- /* Log the error, but don't display it in the echo area. This
- proves to be annoying in many cases. */
- buffer = LSTRDUPA (msg);
- message_dolog (buffer, strlen (buffer), 1, 0);
-}
-
-
/* If FRAME is nil, return a pointer to the selected frame.
Otherwise, check that FRAME is a live frame, and return a pointer
to it. NPARAM is the parameter number of FRAME, for
if (bitmap_id < 0)
{
- add_to_log (f, "Invalid or undefined bitmap %s", name, Qnil);
+ add_to_log ("Invalid or undefined bitmap %s", name, Qnil);
bitmap_id = 0;
if (w_ptr)
}
}
else if (fontset >= 0)
- add_to_log (f, "Unable to load ASCII font of fontset %d",
+ add_to_log ("Unable to load ASCII font of fontset %d",
make_number (fontset), Qnil);
else if (font_name)
- add_to_log (f, "Unable to load font %s",
+ add_to_log ("Unable to load font %s",
build_string (font_name), Qnil);
}
to the values in an existing cell. */
if (!defined_color (f, XSTRING (name)->data, &color, 1))
{
- add_to_log (f, "Unable to load color %s", name, Qnil);
+ add_to_log ("Unable to load color %s", name, Qnil);
switch (target_index)
{
if (INTEGERP (color))
return (unsigned long)XINT (color);
- add_to_log (f, "Unable to load color %s", name, Qnil);
+ add_to_log ("Unable to load color %s", name, Qnil);
switch (target_index)
{
to[LFACE_BACKGROUND_INDEX] = color_name;
}
else
- add_to_log (f, "Invalid face color", color_name, Qnil);
+ add_to_log ("Invalid face color", color_name, Qnil);
}
else if (SYMBOLP (first)
&& *XSYMBOL (first)->name->data == ':')
if (STRINGP (value))
to[LFACE_FAMILY_INDEX] = value;
else
- add_to_log (f, "Illegal face font family", value, Qnil);
+ add_to_log ("Illegal face font family", value, Qnil);
}
else if (EQ (keyword, QCheight))
{
if (INTEGERP (value))
to[LFACE_HEIGHT_INDEX] = value;
else
- add_to_log (f, "Illegal face font height", value, Qnil);
+ add_to_log ("Illegal face font height", value, Qnil);
}
else if (EQ (keyword, QCweight))
{
&& face_numeric_weight (value) >= 0)
to[LFACE_WEIGHT_INDEX] = value;
else
- add_to_log (f, "Illegal face weight", value, Qnil);
+ add_to_log ("Illegal face weight", value, Qnil);
}
else if (EQ (keyword, QCslant))
{
&& face_numeric_slant (value) >= 0)
to[LFACE_SLANT_INDEX] = value;
else
- add_to_log (f, "Illegal face slant", value, Qnil);
+ add_to_log ("Illegal face slant", value, Qnil);
}
else if (EQ (keyword, QCunderline))
{
|| STRINGP (value))
to[LFACE_UNDERLINE_INDEX] = value;
else
- add_to_log (f, "Illegal face underline", value, Qnil);
+ add_to_log ("Illegal face underline", value, Qnil);
}
else if (EQ (keyword, QCoverline))
{
|| STRINGP (value))
to[LFACE_OVERLINE_INDEX] = value;
else
- add_to_log (f, "Illegal face overline", value, Qnil);
+ add_to_log ("Illegal face overline", value, Qnil);
}
else if (EQ (keyword, QCstrike_through))
{
|| STRINGP (value))
to[LFACE_STRIKE_THROUGH_INDEX] = value;
else
- add_to_log (f, "Illegal face strike-through", value, Qnil);
+ add_to_log ("Illegal face strike-through", value, Qnil);
}
else if (EQ (keyword, QCbox))
{
|| NILP (value))
to[LFACE_BOX_INDEX] = value;
else
- add_to_log (f, "Illegal face box", value, Qnil);
+ add_to_log ("Illegal face box", value, Qnil);
}
else if (EQ (keyword, QCinverse_video)
|| EQ (keyword, QCreverse_video))
if (EQ (value, Qt) || NILP (value))
to[LFACE_INVERSE_INDEX] = value;
else
- add_to_log (f, "Illegal face inverse-video", value, Qnil);
+ add_to_log ("Illegal face inverse-video", value, Qnil);
}
else if (EQ (keyword, QCforeground))
{
if (STRINGP (value))
to[LFACE_FOREGROUND_INDEX] = value;
else
- add_to_log (f, "Illegal face foreground", value, Qnil);
+ add_to_log ("Illegal face foreground", value, Qnil);
}
else if (EQ (keyword, QCbackground))
{
if (STRINGP (value))
to[LFACE_BACKGROUND_INDEX] = value;
else
- add_to_log (f, "Illegal face background", value, Qnil);
+ add_to_log ("Illegal face background", value, Qnil);
}
else if (EQ (keyword, QCstipple))
{
if (!NILP (pixmap_p))
to[LFACE_STIPPLE_INDEX] = value;
else
- add_to_log (f, "Illegal face stipple", value, Qnil);
+ add_to_log ("Illegal face stipple", value, Qnil);
#endif
}
else if (EQ (keyword, QCwidth))
&& face_numeric_swidth (value) >= 0)
to[LFACE_SWIDTH_INDEX] = value;
else
- add_to_log (f, "Illegal face width", value, Qnil);
+ add_to_log ("Illegal face width", value, Qnil);
}
else
- add_to_log (f, "Invalid attribute %s in face property",
+ add_to_log ("Invalid attribute %s in face property",
keyword, Qnil);
prop = XCDR (XCDR (prop));
/* PROP ought to be a face name. */
Lisp_Object lface = lface_from_face_name (f, prop, 0);
if (NILP (lface))
- add_to_log (f, "Invalid face text property value: %s", prop, Qnil);
+ add_to_log ("Invalid face text property value: %s", prop, Qnil);
else
merge_face_vectors (XVECTOR (lface)->contents, to);
}