NOTE: This patch has been committed. The version below is
informational only (whitespace differences have been removed).
Dear reviewers,
this patch implements Aidan's suggestion of asserting the
correct order of built-in faces additions to the cache.
src/ChangeLog addition:
2007-10-03 Didier Verna <didier(a)xemacs.org>
* faces.c (reset_face_cachels): Assert correct order of built-in
faces additions to the face cache, as per suggestion from Aidan.
XEmacs source patch:
Diff command: cvs -q diff -u -t -b -B -w
Files affected: src/faces.c
Index: src/faces.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/faces.c,v
retrieving revision 1.56
diff -u -u -t -b -B -w -r1.56 faces.c
--- src/faces.c 26 Sep 2007 13:28:00 -0000 1.56
+++ src/faces.c 3 Oct 2007 13:25:03 -0000
@@ -1584,6 +1584,7 @@
if (w->face_cachels)
{
int i;
+ face_index fi;
for (i = 0; i < Dynarr_length (w->face_cachels); i++)
{
@@ -1594,10 +1595,13 @@
Dynarr_reset (w->face_cachels);
/* #### NOTE: be careful with the order !
The cpp macros DEFAULT_INDEX and MODELINE_INDEX defined in
- redisplay.h depend on the code below, which is really clumsy.
+ redisplay.h depend on the code below. Please make sure to assert the
+ correct values if you ever add new built-in faces here.
-- dvl */
- get_builtin_face_cache_index (w, Vdefault_face);
- get_builtin_face_cache_index (w, Vmodeline_face);
+ fi = get_builtin_face_cache_index (w, Vdefault_face);
+ assert (fi == DEFAULT_INDEX);
+ fi = get_builtin_face_cache_index (w, Vmodeline_face);
+ assert (fi == MODELINE_INDEX);
XFRAME (w->frame)->window_face_cache_reset = 1;
}
}
--
New @-quartet featured CD Review !!
http://www.indie-music.com/modules.php?name=News&file=article&sid...
Didier Verna, didier(a)lrde.epita.fr,
http://www.lrde.epita.fr/~didier
EPITA / LRDE, 14-16 rue Voltaire Tel.+33 (1) 44 08 01 85
94276 Le Kremlin-Bicêtre, France Fax.+33 (1) 53 14 59 22 didier(a)xemacs.org
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches