changeset 98717:507c5c477e60

(font_clear_prop): When clearing font width, clear the average width field too.
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 14 Oct 2008 14:41:20 +0000
parents 3e598e2ce8a6
children 878c169a1844
files src/font.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/font.c	Tue Oct 14 14:41:11 2008 +0000
+++ b/src/font.c	Tue Oct 14 14:41:20 2008 +0000
@@ -2996,7 +2996,9 @@
   if (! FONTP (font))
     return;
   if (NILP (AREF (font, prop))
-      && prop != FONT_FAMILY_INDEX && prop != FONT_FOUNDRY_INDEX
+      && prop != FONT_FAMILY_INDEX
+      && prop != FONT_FOUNDRY_INDEX
+      && prop != FONT_WIDTH_INDEX
       && prop != FONT_SIZE_INDEX)
     return;
   font = Fcopy_font_spec (font);
@@ -3018,6 +3020,8 @@
       ASET (font, FONT_SPACING_INDEX, Qnil);
       ASET (font, FONT_AVGWIDTH_INDEX, Qnil);
     }
+  else if (prop == FONT_WIDTH_INDEX)
+    ASET (font, FONT_AVGWIDTH_INDEX, Qnil);
   attrs[LFACE_FONT_INDEX] = font;
 }