free realized faces now because they depend on face definitions
that might have changed. Don't free faces while there might be
desired matrices pending which reference these faces. */
- if (face_change && !inhibit_free_realized_faces)
+ if (!inhibit_free_realized_faces)
{
- face_change = false;
- free_all_realized_faces (Qnil);
+ if (face_change)
+ {
+ face_change = false;
+ free_all_realized_faces (Qnil);
+ }
+ else if (XFRAME (w->frame)->face_change)
+ {
+ XFRAME (w->frame)->face_change = 0;
+ free_all_realized_faces (w->frame);
+ }
}
/* Perhaps remap BASE_FACE_ID to a user-specified alternative. */
&& FRAME_VISIBLE_P (XFRAME (w->frame))
&& !FRAME_OBSCURED_P (XFRAME (w->frame))
&& !XFRAME (w->frame)->cursor_type_changed
+ && !XFRAME (w->frame)->face_change
/* Make sure recorded data applies to current buffer, etc. */
&& this_line_buffer == current_buffer
&& match_p
&& REDISPLAY_SOME_P ()
&& !w->redisplay
&& !w->update_mode_line
+ && !f->face_change
&& !f->redisplay
&& !buffer->text->redisplay
&& BUF_PT (buffer) == w->last_point)
#endif /* HAVE_WINDOW_SYSTEM */
}
-
DEFUN ("clear-face-cache", Fclear_face_cache, Sclear_face_cache, 0, 1, 0,
doc: /* Clear face caches on all frames.
Optional THOROUGHLY non-nil means try to free unused fonts, too. */)
free realized faces. */
if (NILP (Fget (face, Qface_no_inherit)))
{
- face_change = true;
+ if (f)
+ f->face_change = 1;
+ else
+ face_change = true;
windows_or_buffers_changed = 54;
}
(Lisp_Object from, Lisp_Object to, Lisp_Object frame, Lisp_Object new_frame)
{
Lisp_Object lface, copy;
+ struct frame *f;
CHECK_SYMBOL (from);
CHECK_SYMBOL (to);
strings etc. because 20.2 didn't do it either. */
lface = lface_from_face_name (NULL, from, true);
copy = Finternal_make_lisp_face (to, Qnil);
+ f = NULL;
}
else
{
CHECK_LIVE_FRAME (new_frame);
lface = lface_from_face_name (XFRAME (frame), from, true);
copy = Finternal_make_lisp_face (to, new_frame);
+ f = XFRAME (new_frame);
}
vcopy (copy, 0, XVECTOR (lface)->contents, LFACE_VECTOR_SIZE);
free realized faces. */
if (NILP (Fget (to, Qface_no_inherit)))
{
- face_change = true;
+ if (f)
+ f->face_change = 1;
+ else
+ face_change = true;
windows_or_buffers_changed = 55;
}
/* Set one of enum font_property_index (> 0) if ATTR is one of
font-related attributes other than QCfont and QCfontset. */
enum font_property_index prop_index = 0;
+ struct frame *f;
CHECK_SYMBOL (face);
CHECK_SYMBOL (attr);
/* Set lface to the Lisp attribute vector of FACE. */
if (EQ (frame, Qt))
{
+ f = NULL;
lface = lface_from_face_name (NULL, face, true);
/* When updating face-new-frame-defaults, we put :ignore-defface
{
if (NILP (frame))
frame = selected_frame;
+ f = XFRAME (frame);
CHECK_LIVE_FRAME (frame);
- lface = lface_from_face_name (XFRAME (frame), face, false);
+ lface = lface_from_face_name (f, face, false);
/* If a frame-local face doesn't exist yet, create one. */
if (NILP (lface))
else if (EQ (attr, QCfont))
{
#ifdef HAVE_WINDOW_SYSTEM
- if (EQ (frame, Qt) || FRAME_WINDOW_P (XFRAME (frame)))
+ if (EQ (frame, Qt) || FRAME_WINDOW_P (f))
{
if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
{
- struct frame *f;
+ struct frame *f1;
old_value = LFACE_FONT (lface);
if (! FONTP (value))
signal_error ("Invalid font or font-spec", value);
}
if (EQ (frame, Qt))
- f = XFRAME (selected_frame);
+ f1 = XFRAME (selected_frame);
else
- f = XFRAME (frame);
+ f1 = XFRAME (frame);
/* FIXME:
If frame is t, and selected frame is a tty frame, the font
can't be realized. An improvement would be to loop over frames
for a non-tty frame and use that. See discussion in Bug#18573.
For a daemon, frame may be an initial frame (Bug#18869). */
- if (FRAME_WINDOW_P (f))
+ if (FRAME_WINDOW_P (f1))
{
if (! FONT_OBJECT_P (value))
{
Lisp_Object *attrs = XVECTOR (lface)->contents;
Lisp_Object font_object;
- font_object = font_load_for_lface (f, attrs, value);
+ font_object = font_load_for_lface (f1, attrs, value);
if (NILP (font_object))
signal_error ("Font not available", value);
value = font_object;
}
- set_lface_from_font (f, lface, value, true);
+ set_lface_from_font (f1, lface, value, true);
+ f1->face_change = 1;
}
}
else
else if (EQ (attr, QCfontset))
{
#ifdef HAVE_WINDOW_SYSTEM
- if (EQ (frame, Qt) || FRAME_WINDOW_P (XFRAME (frame)))
+ if (EQ (frame, Qt) || FRAME_WINDOW_P (f))
{
Lisp_Object tmp;
&& NILP (Fget (face, Qface_no_inherit))
&& NILP (Fequal (old_value, value)))
{
- face_change = true;
+ f->face_change = true;
windows_or_buffers_changed = 56;
}
if (!NILP (face)
&& NILP (Fget (face, Qface_no_inherit)))
{
- face_change = true;
+ f->face_change = true;
windows_or_buffers_changed = 57;
}
}