+2015-01-28 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use bool, not int, to track face changes
+ * xfaces.c (face_change): Rename from face_change_count, and
+ change from int to bool. The var is now true (instead of nonzero)
+ if attributes have changed; this is simpler. All uses changed.
+ Fixes: bug#19698
+
2015-01-27 Eli Zaretskii <eliz@gnu.org>
* dired.c (directory_files_internal) [WINDOWSNT]: If readdir
: TYPE_MAXIMUM (EMACS_INT)))));
}
-/* Non-zero means face attributes have been changed since the last
+/* True means face attributes have been changed since the last
redisplay. Used in redisplay_internal. */
-extern int face_change_count;
+extern bool face_change;
/* For reordering of bidirectional text. */
XSETFRAME (frame, f);
x_set_font (f, Fframe_parameter (frame, Qfont), Qnil);
- ++face_change_count;
+ face_change = true;
windows_or_buffers_changed = 18;
}
}
if (redraw)
{
- face_change_count++; /* forces xdisp.c to recompute basic faces */
+ face_change = true; /* forces xdisp.c to recompute basic faces */
if (f == SELECTED_FRAME ())
redraw_frame (f);
}
ptrdiff_t count = SPECPDL_INDEX ();
struct gcpro gcpro1, gcpro2, gcpro3;
struct kboard *kb;
- int face_change_count_before = face_change_count;
+ bool face_change_before = face_change;
Lisp_Object buffer;
struct buffer *old_buffer;
f->can_x_set_window_size = true;
/* Setting attributes of faces of the tooltip frame from resources
- and similar will increment face_change_count, which leads to the
+ and similar will set face_change, which leads to the
clearing of all current matrices. Since this isn't necessary
- here, avoid it by resetting face_change_count to the value it
+ here, avoid it by resetting face_change to the value it
had before we created the tip frame. */
- face_change_count = face_change_count_before;
+ face_change = face_change_before;
/* Discard the unwind_protect. */
return unbind_to (count, frame);
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_count && !inhibit_free_realized_faces)
+ if (face_change && !inhibit_free_realized_faces)
{
- face_change_count = 0;
+ face_change = false;
free_all_realized_faces (Qnil);
}
last_glyphless_glyph_frame = NULL;
last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
- /* If face_change_count is non-zero, init_iterator will free all
- realized faces, which includes the faces referenced from current
- matrices. So, we can't reuse current matrices in this case. */
- if (face_change_count)
+ /* If face_change, init_iterator will free all realized faces, which
+ includes the faces referenced from current matrices. So, we
+ can't reuse current matrices in this case. */
+ if (face_change)
windows_or_buffers_changed = 47;
if ((FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf))
#endif /* HAVE_WINDOW_SYSTEM */
-/* Non-zero means face attributes have been changed since the last
+/* True means face attributes have been changed since the last
redisplay. Used in redisplay_internal. */
-int face_change_count;
+bool face_change;
/* True means don't display bold text if a face's foreground
and background colors are the inverse of the default colors of the
(Lisp_Object thoroughly)
{
clear_face_cache (!NILP (thoroughly));
- ++face_change_count;
+ face_change = true;
windows_or_buffers_changed = 53;
return Qnil;
}
/* Changing a named face means that all realized faces depending on
that face are invalid. Since we cannot tell which realized faces
depend on the face, make sure they are all removed. This is done
- by incrementing face_change_count. The next call to
- init_iterator will then free realized faces. */
+ by setting face_change. The next call to init_iterator will then
+ free realized faces. */
if (NILP (Fget (face, Qface_no_inherit)))
{
- ++face_change_count;
+ face_change = true;
windows_or_buffers_changed = 54;
}
/* Changing a named face means that all realized faces depending on
that face are invalid. Since we cannot tell which realized faces
depend on the face, make sure they are all removed. This is done
- by incrementing face_change_count. The next call to
- init_iterator will then free realized faces. */
+ by setting face_change. The next call to init_iterator will then
+ free realized faces. */
if (NILP (Fget (to, Qface_no_inherit)))
{
- ++face_change_count;
+ face_change = true;
windows_or_buffers_changed = 55;
}
/* Changing a named face means that all realized faces depending on
that face are invalid. Since we cannot tell which realized faces
depend on the face, make sure they are all removed. This is done
- by incrementing face_change_count. The next call to
- init_iterator will then free realized faces. */
+ by setting face_change. The next call to init_iterator will then
+ free realized faces. */
if (!EQ (frame, Qt)
&& NILP (Fget (face, Qface_no_inherit))
&& NILP (Fequal (old_value, value)))
{
- ++face_change_count;
+ face_change = true;
windows_or_buffers_changed = 56;
}
/* Changing a named face means that all realized faces depending on
that face are invalid. Since we cannot tell which realized faces
depend on the face, make sure they are all removed. This is done
- by incrementing face_change_count. The next call to
- init_iterator will then free realized faces. */
+ by setting face_change. The next call to init_iterator will then
+ free realized faces. */
if (!NILP (face)
&& NILP (Fget (face, Qface_no_inherit)))
{
- ++face_change_count;
+ face_change = true;
windows_or_buffers_changed = 57;
}
}
(Lisp_Object suppress)
{
tty_suppress_bold_inverse_default_colors_p = !NILP (suppress);
- ++face_change_count;
+ face_change = true;
return suppress;
}
int width, height;
ptrdiff_t count = SPECPDL_INDEX ();
struct gcpro gcpro1, gcpro2, gcpro3;
- int face_change_count_before = face_change_count;
+ bool face_change_before = face_change;
Lisp_Object buffer;
struct buffer *old_buffer;
f->can_x_set_window_size = true;
/* Setting attributes of faces of the tooltip frame from resources
- and similar will increment face_change_count, which leads to the
- clearing of all current matrices. Since this isn't necessary
- here, avoid it by resetting face_change_count to the value it
- had before we created the tip frame. */
- face_change_count = face_change_count_before;
+ and similar will set face_change, which leads to the clearing of
+ all current matrices. Since this isn't necessary here, avoid it
+ by resetting face_change to the value it had before we created
+ the tip frame. */
+ face_change = face_change_before;
/* Discard the unwind_protect. */
return unbind_to (count, frame);