=== modified file 'src/fontset.c' --- src/fontset.c 2012-08-13 12:56:30 +0000 +++ src/fontset.c 2012-08-13 13:13:30 +0000 @@ -214,23 +214,44 @@ #define FONTSET_FROM_ID(id) AREF (Vfontset_table, id) /* Macros to access special values of FONTSET. */ -#define FONTSET_ID(fontset) XCHAR_TABLE (fontset)->extras[0] + +#define FONTSET_ID(fontset) XCHAR_TABLE (fontset)->extras[0] +#define SET_FONTSET_ID(fontset, id) \ + char_table_set_extras ((fontset), 0, (id)) /* Macros to access special values of (base) FONTSET. */ -#define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1] -#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[4] -/* #define FONTSET_SPEC(fontset) XCHAR_TABLE (fontset)->extras[5] */ + +#define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1] +#define SET_FONTSET_NAME(fontset, name) \ + char_table_set_extras ((fontset), 1, (name)) + +#define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->extras[4] +#define SET_FONTSET_ASCII(fontset, ascii) \ + char_table_set_extras ((fontset), 4, (ascii)) /* Macros to access special values of (realized) FONTSET. */ -#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2] -#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3] -/* #define FONTSET_OBJLIST(fontset) XCHAR_TABLE (fontset)->extras[4] */ -#define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5] -/* #define FONTSET_REPERTORY(fontset) XCHAR_TABLE (fontset)->extras[6] */ -#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7] + +#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2] +#define SET_FONTSET_BASE(fontset, base) \ + char_table_set_extras ((fontset), 2, (base)) + +#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3] +#define SET_FONTSET_FRAME(fontset, frame) \ + char_table_set_extras ((fontset), 3, (frame)) + +#define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5] +#define SET_FONTSET_NOFONT_FACE(fontset, face) \ + char_table_set_extras ((fontset), 5, (face)) + +#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7] +#define SET_FONTSET_DEFAULT(fontset, def) \ + char_table_set_extras ((fontset), 7, (def)) /* For both base and realized fontset. */ -#define FONTSET_FALLBACK(fontset) XCHAR_TABLE (fontset)->extras[8] + +#define FONTSET_FALLBACK(fontset) XCHAR_TABLE (fontset)->extras[8] +#define SET_FONTSET_FALLBACK(fontset, fallback) \ + char_table_set_extras ((fontset), 8, (fallback)) #define BASE_FONTSET_P(fontset) (NILP (FONTSET_BASE (fontset))) @@ -307,12 +328,13 @@ replace with ELT, if ADD is `prepend', prepend ELT, otherwise, append ELT. */ -#define FONTSET_ADD(fontset, range, elt, add) \ - (NILP (add) \ - ? (NILP (range) \ - ? (FONTSET_FALLBACK (fontset) = Fmake_vector (make_number (1), (elt))) \ - : Fset_char_table_range ((fontset), (range), \ - Fmake_vector (make_number (1), (elt)))) \ +#define FONTSET_ADD(fontset, range, elt, add) \ + (NILP (add) \ + ? (NILP (range) \ + ? (SET_FONTSET_FALLBACK \ + (fontset, Fmake_vector (make_number (1), (elt)))) \ + : Fset_char_table_range ((fontset), (range), \ + Fmake_vector (make_number (1), (elt)))) \ : fontset_add ((fontset), (range), (elt), (add))) static Lisp_Object @@ -720,8 +742,9 @@ if (! EQ (base_fontset, Vdefault_fontset)) { if (NILP (FONTSET_DEFAULT (fontset))) - FONTSET_DEFAULT (fontset) - = make_fontset (FONTSET_FRAME (fontset), Qnil, Vdefault_fontset); + SET_FONTSET_DEFAULT + (fontset, + make_fontset (FONTSET_FRAME (fontset), Qnil, Vdefault_fontset)); FONT_DEFERRED_LOG ("default fontset: font for", make_number (c), Qnil); default_rfont_def = fontset_find_font (FONTSET_DEFAULT (fontset), c, face, id, 0); @@ -781,16 +804,14 @@ fontset = Fmake_char_table (Qfontset, Qnil); - FONTSET_ID (fontset) = make_number (id); + SET_FONTSET_ID (fontset, make_number (id)); if (NILP (base)) - { - FONTSET_NAME (fontset) = name; - } + SET_FONTSET_NAME (fontset, name); else { - FONTSET_NAME (fontset) = Qnil; - FONTSET_FRAME (fontset) = frame; - FONTSET_BASE (fontset) = base; + SET_FONTSET_NAME (fontset, Qnil); + SET_FONTSET_FRAME (fontset, frame); + SET_FONTSET_BASE (fontset, base); } ASET (Vfontset_table, id, fontset); @@ -958,7 +979,7 @@ else { face_id = face_for_font (f, Qnil, face); - FONTSET_NOFONT_FACE (fontset) = make_number (face_id); + SET_FONTSET_NOFONT_FACE (fontset, make_number (face_id)); } } eassert (face_id >= 0); @@ -1581,7 +1602,7 @@ Lisp_Object tail, fr, alist; int fontset_id = XINT (FONTSET_ID (fontset)); - FONTSET_ASCII (fontset) = fontname; + SET_FONTSET_ASCII (fontset, fontname); name = FONTSET_NAME (fontset); FOR_EACH_FRAME (tail, fr) { @@ -1659,7 +1680,7 @@ len = font_unparse_xlfd (font_spec, 0, xlfd, 256); if (len < 0) error ("Invalid fontset name (perhaps too long): %s", SDATA (name)); - FONTSET_ASCII (fontset) = make_unibyte_string (xlfd, len); + SET_FONTSET_ASCII (fontset, make_unibyte_string (xlfd, len)); } else { @@ -1746,7 +1767,7 @@ Fset_fontset_font (name, Qnil, font_spec, Qnil, Qnil); } - FONTSET_ASCII (fontset) = font_name; + SET_FONTSET_ASCII (fontset, font_name); return XINT (FONTSET_ID (fontset)); } @@ -2163,9 +2184,10 @@ Vdefault_fontset = Fmake_char_table (Qfontset, Qnil); staticpro (&Vdefault_fontset); - FONTSET_ID (Vdefault_fontset) = make_number (0); - FONTSET_NAME (Vdefault_fontset) - = build_pure_c_string ("-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default"); + SET_FONTSET_ID (Vdefault_fontset, make_number (0)); + SET_FONTSET_NAME + (Vdefault_fontset, + build_pure_c_string ("-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default")); ASET (Vfontset_table, 0, Vdefault_fontset); next_fontset_id = 1;