changeset 5189:b65692aa90d8

Cosmetic XFT-code fixes, some variable renamings -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-04-04 Ben Wing <ben@xemacs.org> * font-mgr.c: * font-mgr.c (fc_standard_properties): * font-mgr.c (Ffc_pattern_p): * font-mgr.c (Ffc_pattern_create): * font-mgr.c (Ffc_name_parse): * font-mgr.c (Ffc_name_unparse): * font-mgr.c (Ffc_pattern_duplicate): * font-mgr.c (Ffc_pattern_add): * font-mgr.c (Ffc_pattern_del): * font-mgr.c (Ffc_pattern_get): * font-mgr.c (fc_config_create_using): * font-mgr.c (fc_strlist_to_lisp_using): * font-mgr.c (fontset_to_list): * font-mgr.c (Ffc_config_p): * font-mgr.c (Ffc_config_create): * font-mgr.c (Ffc_config_destroy): * font-mgr.c (Ffc_config_up_to_date): * font-mgr.c (Ffc_config_build_fonts): * font-mgr.c (Ffc_config_get_config_dirs): * font-mgr.c (Ffc_config_get_font_dirs): * font-mgr.c (Ffc_config_get_config_files): * font-mgr.c (Ffc_config_get_cache): * font-mgr.c (Ffc_config_get_fonts): * font-mgr.c (Ffc_config_set_current): * font-mgr.c (Ffc_config_get_blanks): * font-mgr.c (Ffc_config_get_rescan_interval): * font-mgr.c (Ffc_config_set_rescan_interval): * font-mgr.c (Ffc_config_app_font_add_file): * font-mgr.c (Ffc_config_app_font_add_dir): * font-mgr.c (Ffc_config_app_font_clear): * font-mgr.c (Ffc_init_load_config): * font-mgr.c (Ffc_init_load_config_and_fonts): * font-mgr.c (Ffc_config_get_current): * font-mgr.c (size): * font-mgr.c (Ffc_font_render_prepare): * font-mgr.c (Ffc_font_match): * font-mgr.c (Ffc_font_sort): * font-mgr.c (Ffc_init): * font-mgr.c (Ffc_get_version): * font-mgr.c (Ffc_init_reinitialize): * font-mgr.c (Ffc_init_bring_up_to_date): * font-mgr.c (Fxlfd_font_name_p): * font-mgr.c (make_xlfd_font_regexp): * font-mgr.c (syms_of_font_mgr): * font-mgr.c (vars_of_font_mgr): * font-mgr.c (complex_vars_of_font_mgr): Fix the code to conform to GNU style standards. Rename xft-debug-level to debug-xft. * fontcolor-x.c: * fontcolor-x.c (vars_of_fontcolor_x): Rename debug-x-objects to debug-x-fonts. * fontcolor-xlike-inc.c: * fontcolor-xlike-inc.c (DEBUG_FONTS1): * fontcolor-xlike-inc.c (DEBUG_FONTS2): * fontcolor-xlike-inc.c (DEBUG_FONTS3): * fontcolor-xlike-inc.c (DEBUG_FONTS4): * fontcolor-xlike-inc.c (DEBUG_FONTS_LISP1): * fontcolor-xlike-inc.c (count_hyphens): * fontcolor-xlike-inc.c (XFUN): * fontcolor-xlike-inc.c (xlistfonts_checking_charset): * fontcolor-xlike-inc.c (xft_find_charset_font): Misc. code fixes, mostly cosmetic. Get rid of some warnings. Fix the code to conform to GNU style standards. * lisp.h: * print.c: * print.c (debug_out_lisp): New function for doing printf-like formatting involving Lisp objects and outputting to the debug output.
author Ben Wing <ben@xemacs.org>
date Sun, 04 Apr 2010 23:46:50 -0500
parents a00bfbd64e0a
children 1c1d8843de5e
files src/ChangeLog src/font-mgr.c src/fontcolor-x.c src/fontcolor-xlike-inc.c src/lisp.h src/print.c
diffstat 6 files changed, 362 insertions(+), 235 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Mar 29 23:23:33 2010 -0500
+++ b/src/ChangeLog	Sun Apr 04 23:46:50 2010 -0500
@@ -1,3 +1,77 @@
+2010-04-04  Ben Wing  <ben@xemacs.org>
+
+	* font-mgr.c:
+	* font-mgr.c (fc_standard_properties):
+	* font-mgr.c (Ffc_pattern_p):
+	* font-mgr.c (Ffc_pattern_create):
+	* font-mgr.c (Ffc_name_parse):
+	* font-mgr.c (Ffc_name_unparse):
+	* font-mgr.c (Ffc_pattern_duplicate):
+	* font-mgr.c (Ffc_pattern_add):
+	* font-mgr.c (Ffc_pattern_del):
+	* font-mgr.c (Ffc_pattern_get):
+	* font-mgr.c (fc_config_create_using):
+	* font-mgr.c (fc_strlist_to_lisp_using):
+	* font-mgr.c (fontset_to_list):
+	* font-mgr.c (Ffc_config_p):
+	* font-mgr.c (Ffc_config_create):
+	* font-mgr.c (Ffc_config_destroy):
+	* font-mgr.c (Ffc_config_up_to_date):
+	* font-mgr.c (Ffc_config_build_fonts):
+	* font-mgr.c (Ffc_config_get_config_dirs):
+	* font-mgr.c (Ffc_config_get_font_dirs):
+	* font-mgr.c (Ffc_config_get_config_files):
+	* font-mgr.c (Ffc_config_get_cache):
+	* font-mgr.c (Ffc_config_get_fonts):
+	* font-mgr.c (Ffc_config_set_current):
+	* font-mgr.c (Ffc_config_get_blanks):
+	* font-mgr.c (Ffc_config_get_rescan_interval):
+	* font-mgr.c (Ffc_config_set_rescan_interval):
+	* font-mgr.c (Ffc_config_app_font_add_file):
+	* font-mgr.c (Ffc_config_app_font_add_dir):
+	* font-mgr.c (Ffc_config_app_font_clear):
+	* font-mgr.c (Ffc_init_load_config):
+	* font-mgr.c (Ffc_init_load_config_and_fonts):
+	* font-mgr.c (Ffc_config_get_current):
+	* font-mgr.c (size):
+	* font-mgr.c (Ffc_font_render_prepare):
+	* font-mgr.c (Ffc_font_match):
+	* font-mgr.c (Ffc_font_sort):
+	* font-mgr.c (Ffc_init):
+	* font-mgr.c (Ffc_get_version):
+	* font-mgr.c (Ffc_init_reinitialize):
+	* font-mgr.c (Ffc_init_bring_up_to_date):
+	* font-mgr.c (Fxlfd_font_name_p):
+	* font-mgr.c (make_xlfd_font_regexp):
+	* font-mgr.c (syms_of_font_mgr):
+	* font-mgr.c (vars_of_font_mgr):
+	* font-mgr.c (complex_vars_of_font_mgr):
+	Fix the code to conform to GNU style standards.
+	Rename xft-debug-level to debug-xft.
+	
+	* fontcolor-x.c:
+	* fontcolor-x.c (vars_of_fontcolor_x):
+	Rename debug-x-objects to debug-x-fonts.
+	
+	* fontcolor-xlike-inc.c:
+	* fontcolor-xlike-inc.c (DEBUG_FONTS1):
+	* fontcolor-xlike-inc.c (DEBUG_FONTS2):
+	* fontcolor-xlike-inc.c (DEBUG_FONTS3):
+	* fontcolor-xlike-inc.c (DEBUG_FONTS4):
+	* fontcolor-xlike-inc.c (DEBUG_FONTS_LISP1):
+	* fontcolor-xlike-inc.c (count_hyphens):
+	* fontcolor-xlike-inc.c (XFUN):
+	* fontcolor-xlike-inc.c (xlistfonts_checking_charset):
+	* fontcolor-xlike-inc.c (xft_find_charset_font):
+	Misc. code fixes, mostly cosmetic.  Get rid of some warnings.
+	Fix the code to conform to GNU style standards.
+	
+	* lisp.h:
+	* print.c:
+	* print.c (debug_out_lisp):
+	New function for doing printf-like formatting involving Lisp objects
+	and outputting to the debug output.
+
 2010-03-29  Ben Wing  <ben@xemacs.org>
 
 	* lisp.h (PRIVATE_UNVERIFIED_LIST_LOOP_7):
--- a/src/font-mgr.c	Mon Mar 29 23:23:33 2010 -0500
+++ b/src/font-mgr.c	Sun Apr 04 23:46:50 2010 -0500
@@ -173,7 +173,8 @@
    ourselves; hash.c hashtables do not interpret the value pointers.
 
    This array should be FcChar8**, but GCC 4.x bitches about signedness. */
-static const Extbyte *fc_standard_properties[] = {
+static const Extbyte *fc_standard_properties[] =
+{
   /* treated specially, ordered first */
   "family", "size",
   /* remaining are alphabetized by group */
@@ -212,15 +213,15 @@
   return prop;
 }
 
-DEFUN("fc-pattern-p", Ffc_pattern_p, 1, 1, 0, /*
+DEFUN ("fc-pattern-p", Ffc_pattern_p, 1, 1, 0, /*
 Returns t if OBJECT is of type fc-pattern, nil otherwise.
 */
       (object))
 {
-  return FC_PATTERNP(object) ? Qt : Qnil;
+  return FC_PATTERNP (object) ? Qt : Qnil;
 }
 
-DEFUN("fc-pattern-create", Ffc_pattern_create, 0, 0, 0, /* 
+DEFUN ("fc-pattern-create", Ffc_pattern_create, 0, 0, 0, /* 
 Return a new, empty fc-pattern object.
 */
       ())
@@ -231,7 +232,7 @@
   return wrap_fc_pattern (fcpat);
 }
 
-DEFUN("fc-name-parse", Ffc_name_parse, 1, 1, 0, /*
+DEFUN ("fc-name-parse", Ffc_name_parse, 1, 1, 0, /*
 Parse an Fc font name and return its representation as a fc pattern object.
 */
       (name))
@@ -246,21 +247,21 @@
 
 /* #### Ga-a-ack!  Xft's similar function is actually a different API.
    We provide both. */
-DEFUN("fc-name-unparse", Ffc_name_unparse, 1, 1, 0, /*
+DEFUN ("fc-name-unparse", Ffc_name_unparse, 1, 1, 0, /*
 Unparse an fc pattern object to a string.
 */
       (pattern))
 {
   FcChar8 *name;
   Lisp_Object result;
-  CHECK_FC_PATTERN(pattern);
+  CHECK_FC_PATTERN (pattern);
   name = FcNameUnparse (XFC_PATTERN_PTR (pattern));
   result = build_fcapi_string (name);
   xfree (name);
   return result;
 }
 
-DEFUN("fc-pattern-duplicate", Ffc_pattern_duplicate, 1, 1, 0, /* 
+DEFUN ("fc-pattern-duplicate", Ffc_pattern_duplicate, 1, 1, 0, /* 
 Make a copy of the fc pattern object PATTERN and return it.
 */
       (pattern))
@@ -273,7 +274,7 @@
   return wrap_fc_pattern (copy);
 }
 
-DEFUN("fc-pattern-add", Ffc_pattern_add, 3, 3, 0, /*
+DEFUN ("fc-pattern-add", Ffc_pattern_add, 3, 3, 0, /*
 Add attributes to the pattern object PATTERN.  PROPERTY is a string naming
 the attribute to add, VALUE the value for this attribute.
 
@@ -292,46 +293,46 @@
   obj = fc_intern (property);
   fcpat = XFC_PATTERN_PTR (pattern);
 
-  if (STRINGP(value)) 
+  if (STRINGP (value)) 
     {
       FcChar8 *str = (FcChar8 *) extract_fcapi_string (value);
       res = FcPatternAddString (fcpat, obj, str);
     }
-  else if (INTP(value)) 
+  else if (INTP (value)) 
     {
-      res = FcPatternAddInteger (fcpat, obj, XINT(value));
+      res = FcPatternAddInteger (fcpat, obj, XINT (value));
     }
-  else if (FLOATP(value)) 
+  else if (FLOATP (value)) 
     {
-      res = FcPatternAddDouble (fcpat, obj, (double) XFLOAT_DATA(value));
+      res = FcPatternAddDouble (fcpat, obj, (double) XFLOAT_DATA (value));
     }
-  else if (SYMBOLP(value)) 
+  else if (SYMBOLP (value)) 
     {
-      res = FcPatternAddBool (fcpat, obj, !NILP(value));
+      res = FcPatternAddBool (fcpat, obj, !NILP (value));
     }
   /* else ... maybe we should wta here? */
 
   return res ? Qt : Qnil;
 }
 
-DEFUN("fc-pattern-del", Ffc_pattern_del, 2, 2, 0, /*
+DEFUN ("fc-pattern-del", Ffc_pattern_del, 2, 2, 0, /*
 Remove attribute PROPERTY from fc pattern object OBJECT.
 */
       (pattern, property))
 {
   Bool res;
 
-  CHECK_FC_PATTERN(pattern);
-  CHECK_STRING(property);
+  CHECK_FC_PATTERN (pattern);
+  CHECK_STRING (property);
 
-  res = FcPatternDel(XFC_PATTERN_PTR(pattern), extract_fcapi_string (property));
+  res = FcPatternDel (XFC_PATTERN_PTR (pattern), extract_fcapi_string (property));
   return res ? Qt : Qnil;
 }
 
 /* Generic interface to FcPatternGet()
  * Don't support the losing symbol-for-property interface.
  */
-DEFUN("fc-pattern-get", Ffc_pattern_get, 2, 4, 0, /*
+DEFUN ("fc-pattern-get", Ffc_pattern_get, 2, 4, 0, /*
 From PATTERN, extract PROPERTY for the ID'th member, of type TYPE.
 
 PATTERN is an Xft (fontconfig) pattern object.
@@ -440,7 +441,7 @@
   /* get property */
   fc_result = FcPatternGet (XFC_PATTERN_PTR (pattern),
 			    fc_property,
-			    NILP (id) ? 0 : XINT(id),
+			    NILP (id) ? 0 : XINT (id),
 			    &fc_value);
 
   switch (fc_result)
@@ -498,7 +499,7 @@
 enum DestroyFontsetP { DestroyNo = 0, DestroyYes = 1 };
 
 static Lisp_Object
-fc_config_create_using (FcConfig * (*create_function) ())
+fc_config_create_using (FcConfig * (*create_function) (void))
 {
   FcConfig *fc = (*create_function) ();
   Lisp_Object configs = XWEAK_LIST_LIST (Vfc_config_weak_list);
@@ -528,7 +529,7 @@
   FcStrList *thing_list;
   
   CHECK_FC_CONFIG (config);     
-  thing_list = (*getter) (XFC_CONFIG_PTR(config));
+  thing_list = (*getter) (XFC_CONFIG_PTR (config));
   /* Yes, we need to do this check -- sheesh, Keith! */
   if (!thing_list)
     return Qnil;
@@ -552,14 +553,14 @@
     {
       fcpat = XFC_PATTERN (ALLOC_NORMAL_LISP_OBJECT (fc_pattern));
       fcpat->fcpatPtr = FcPatternDuplicate (fontset->fonts[idx]);
-      fontlist = Fcons (wrap_fc_pattern(fcpat), fontlist);
+      fontlist = Fcons (wrap_fc_pattern (fcpat), fontlist);
     }
   if (destroyp)
     FcFontSetDestroy (fontset);
   return fontlist;
 }
 
-DEFUN("fc-config-p", Ffc_config_p, 1, 1, 0, /*
+DEFUN ("fc-config-p", Ffc_config_p, 1, 1, 0, /*
 Returns t if OBJECT is of type fc-config, nil otherwise.
 */
       (object))
@@ -567,7 +568,7 @@
   return FC_CONFIGP (object) ? Qt : Qnil;
 }
 
-DEFUN("fc-config-create", Ffc_config_create, 0, 0, 0, /*
+DEFUN ("fc-config-create", Ffc_config_create, 0, 0, 0, /*
  -- Function: FcConfig *FcConfigCreate (void)
      Creates an empty configuration. */
       ())
@@ -578,7 +579,7 @@
 #if 0
 /* I'm sorry, but we just don't do this in Lisp, OK?
    Don't even think about implementing this. */
-DEFUN("fc-config-destroy", Ffc_config_destroy, 1, 1, 0, /*
+DEFUN ("fc-config-destroy", Ffc_config_destroy, 1, 1, 0, /*
  -- Function: void FcConfigDestroy (FcConfig *config)
      Destroys a configuration and any data associated with it.  Note
      that calling this function with the return value from
@@ -591,7 +592,7 @@
 }
 #endif
 
-DEFUN("fc-config-up-to-date", Ffc_config_up_to_date, 1, 1, 0, /*
+DEFUN ("fc-config-up-to-date", Ffc_config_up_to_date, 1, 1, 0, /*
  -- Function: FcBool FcConfigUptoDate (FcConfig *config)
      Checks all of the files related to 'config' and returns whether the
      in-memory version is in sync with the disk version. */
@@ -601,7 +602,7 @@
   return FcConfigUptoDate (XFC_CONFIG_PTR (config)) == FcFalse ? Qnil : Qt;
 }
 
-DEFUN("fc-config-build-fonts", Ffc_config_build_fonts, 1, 1, 0, /*
+DEFUN ("fc-config-build-fonts", Ffc_config_build_fonts, 1, 1, 0, /*
  -- Function: FcBool FcConfigBuildFonts (FcConfig *config)
      Builds the set of available fonts for the given configuration.
      Note that any changes to the configuration after this call have
@@ -616,7 +617,7 @@
   return Qnil;
 }
 
-DEFUN("fc-config-get-config-dirs", Ffc_config_get_config_dirs, 1, 1, 0, /*
+DEFUN ("fc-config-get-config-dirs", Ffc_config_get_config_dirs, 1, 1, 0, /*
  -- Function: FcStrList *FcConfigGetConfigDirs (FcConfig *config)
      Returns the list of font directories specified in the
      configuration files for 'config'.  Does not include any
@@ -626,7 +627,7 @@
   return fc_strlist_to_lisp_using (&FcConfigGetConfigDirs, config);
 }
 
-DEFUN("fc-config-get-font-dirs", Ffc_config_get_font_dirs, 1, 1, 0, /*
+DEFUN ("fc-config-get-font-dirs", Ffc_config_get_font_dirs, 1, 1, 0, /*
  -- Function: FcStrList *FcConfigGetFontDirs (FcConfig *config)
      Returns the list of font directories in 'config'. This includes the
      configured font directories along with any directories below those
@@ -636,7 +637,7 @@
   return fc_strlist_to_lisp_using (&FcConfigGetFontDirs, config);
 }
 
-DEFUN("fc-config-get-config-files", Ffc_config_get_config_files, 1, 1, 0, /*
+DEFUN ("fc-config-get-config-files", Ffc_config_get_config_files, 1, 1, 0, /*
  -- Function: FcStrList *FcConfigGetConfigFiles (FcConfig *config)
      Returns the list of known configuration files used to generate
      'config'.  Note that this will not include any configuration done
@@ -646,7 +647,7 @@
  return fc_strlist_to_lisp_using (&FcConfigGetConfigFiles, config);
 }
 
-DEFUN("fc-config-get-cache", Ffc_config_get_cache, 1, 1, 0, /*
+DEFUN ("fc-config-get-cache", Ffc_config_get_cache, 1, 1, 0, /*
  -- Function: char *FcConfigGetCache (FcConfig *config)
      Returns the name of the file used to store per-user font
      information. */
@@ -657,7 +658,7 @@
   return build_fcapi_string ((FcChar8 *) FcConfigGetCache (XFC_CONFIG_PTR (config)));
 }
 
-DEFUN("fc-config-get-fonts", Ffc_config_get_fonts, 2, 2, 0, /*
+DEFUN ("fc-config-get-fonts", Ffc_config_get_fonts, 2, 2, 0, /*
  -- Function: FcFontSet *FcConfigGetFonts (FcConfig *config, FcSetName set)
      Returns one of the two sets of fonts from the configuration as
      specified by 'set'.
@@ -685,7 +686,7 @@
   return fs ? fontset_to_list (fs, DestroyNo) : Qnil;
 }
 
-DEFUN("fc-config-set-current", Ffc_config_set_current, 1, 1, 0, /*
+DEFUN ("fc-config-set-current", Ffc_config_set_current, 1, 1, 0, /*
  -- Function: FcBool FcConfigSetCurrent (FcConfig *config)
      Sets the current default configuration to 'config'.  Implicitly
      calls FcConfigBuildFonts if necessary, returning FcFalse if that
@@ -717,7 +718,7 @@
   return Qnil;
 }
 
-DEFUN("fc-config-get-blanks", Ffc_config_get_blanks, 1, 1, 0, /*
+DEFUN ("fc-config-get-blanks", Ffc_config_get_blanks, 1, 1, 0, /*
  -- Function: FcBlanks *FcConfigGetBlanks (FcConfig *config)
      Returns the FcBlanks object associated with the given
      configuration, if no blanks were present in the configuration,
@@ -731,7 +732,7 @@
 		intern ("fc-config-get-blanks"));
 }
 
-DEFUN("fc-config-get-rescan-interval", Ffc_config_get_rescan_interval, 1, 1, 0, /*
+DEFUN ("fc-config-get-rescan-interval", Ffc_config_get_rescan_interval, 1, 1, 0, /*
  -- Function: int FcConfigGetRescanInterval (FcConfig *config)
      Returns the interval between automatic checks of the configuration
      (in seconds) specified in 'config'.  The configuration is checked
@@ -743,7 +744,7 @@
   return make_int (FcConfigGetRescanInterval (XFC_CONFIG_PTR (config)));
 }
 
-DEFUN("fc-config-set-rescan-interval", Ffc_config_set_rescan_interval, 2, 2, 0, /*
+DEFUN ("fc-config-set-rescan-interval", Ffc_config_set_rescan_interval, 2, 2, 0, /*
  -- Function: FcBool FcConfigSetRescanInterval (FcConfig *config, int
           rescanInterval)
      Sets the rescan interval; returns FcFalse if an error occurred.
@@ -760,7 +761,7 @@
 }
 
 /* #### This might usefully be made interactive. */
-DEFUN("fc-config-app-font-add-file", Ffc_config_app_font_add_file, 2, 2, 0, /*
+DEFUN ("fc-config-app-font-add-file", Ffc_config_app_font_add_file, 2, 2, 0, /*
  -- Function: FcBool FcConfigAppFontAddFile (FcConfig *config, const
           char *file)
      Adds an application-specific font to the configuration. */
@@ -778,7 +779,7 @@
 }
 
 /* #### This might usefully be made interactive. */
-DEFUN("fc-config-app-font-add-dir", Ffc_config_app_font_add_dir, 2, 2, 0, /*
+DEFUN ("fc-config-app-font-add-dir", Ffc_config_app_font_add_dir, 2, 2, 0, /*
  -- Function: FcBool FcConfigAppFontAddDir (FcConfig *config, const
           char *dir)
      Scans the specified directory for fonts, adding each one found to
@@ -797,7 +798,7 @@
 }
 
 /* #### This might usefully be made interactive. */
-DEFUN("fc-config-app-font-clear", Ffc_config_app_font_clear, 1, 1, 0, /*
+DEFUN ("fc-config-app-font-clear", Ffc_config_app_font_clear, 1, 1, 0, /*
  -- Function: void FcConfigAppFontClear (FcConfig *config)
      Clears the set of application-specific fonts. */
       (config))
@@ -811,7 +812,7 @@
    configuration of the library is initialized.  (This configuration is
    normally implicitly initialized.) */
 
-DEFUN("fc-config-filename", Ffc_config_filename, 1, 1, 0, /*
+DEFUN ("fc-config-filename", Ffc_config_filename, 1, 1, 0, /*
  -- Function: char *FcConfigFilename (const char *name)
      Given the specified external entity name, return the associated
      filename.  This provides applications a way to convert various
@@ -838,7 +839,7 @@
   return (build_fcapi_string (FcConfigFilename ((FcChar8 *) fcname)));
 }
 
-DEFUN("fc-init-load-config", Ffc_init_load_config, 0, 0, 0, /*
+DEFUN ("fc-init-load-config", Ffc_init_load_config, 0, 0, 0, /*
  -- Function: FcConfig *FcInitLoadConfig (void)
      Loads the default configuration file and returns the resulting
      configuration.  Does not load any font information. */
@@ -847,7 +848,7 @@
   return fc_config_create_using (&FcInitLoadConfig);
 }
 
-DEFUN("fc-init-load-config-and-fonts", Ffc_init_load_config_and_fonts, 0, 0, 0, /*
+DEFUN ("fc-init-load-config-and-fonts", Ffc_init_load_config_and_fonts, 0, 0, 0, /*
  -- Function: FcConfig *FcInitLoadConfigAndFonts (void)
      Loads the default configuration file and builds information about
      the available fonts.  Returns the resulting configuration. */
@@ -856,7 +857,7 @@
   return fc_config_create_using (&FcInitLoadConfigAndFonts);
 }
 
-DEFUN("fc-config-get-current", Ffc_config_get_current, 0, 0, 0, /*
+DEFUN ("fc-config-get-current", Ffc_config_get_current, 0, 0, 0, /*
  -- Function: FcConfig *FcConfigGetCurrent (void)
      Returns the current default configuration. */
       ())
@@ -866,7 +867,7 @@
 
 /* Pattern manipulation functions. */
 
-DEFUN("fc-default-substitute", Ffc_default_substitute, 1, 1, 0, /*
+DEFUN ("fc-default-substitute", Ffc_default_substitute, 1, 1, 0, /*
 Adds defaults for certain attributes if not specified in PATTERN.
 FcPattern PATTERN is modified in-place, and nil is returned.
 * Patterns without a specified style or weight are set to Medium
@@ -884,7 +885,7 @@
           FcPattern *p, FcPattern *p_pat FcMatchKind kind)
      OMITTED: use optional arguments in `fc-config-substitute'. */
 
-DEFUN("fc-config-substitute", Ffc_config_substitute, 1, 4, 0, /*
+DEFUN ("fc-config-substitute", Ffc_config_substitute, 1, 4, 0, /*
 Modifies PATTERN according to KIND and TESTPAT using operations from CONFIG.
 PATTERN is modified in-place.  Returns an undocumented Boolean value.
 If optional KIND is `fc-match-pattern', then those tagged as pattern operations
@@ -932,7 +933,7 @@
    filtering out fonts that do not provide additional characters beyond
    those provided by preferred fonts. */
 
-DEFUN("fc-font-render-prepare", Ffc_font_render_prepare, 2, 3, 0, /*
+DEFUN ("fc-font-render-prepare", Ffc_font_render_prepare, 2, 3, 0, /*
 Return a new pattern blending PATTERN and FONT.
 Optional CONFIG is an FcConfig, defaulting to the current one.
 The returned pattern consists of elements of FONT not appearing in PATTERN,
@@ -949,12 +950,12 @@
   CHECK_FC_CONFIG (config);
 
   /* I don't think this can fail? */
-  return wrap_fc_pattern (FcFontRenderPrepare (XFC_CONFIG_PTR(config),
-					      XFC_PATTERN_PTR(font),
-					      XFC_PATTERN_PTR(pattern)));
+  return wrap_fc_pattern (FcFontRenderPrepare (XFC_CONFIG_PTR (config),
+					      XFC_PATTERN_PTR (font),
+					      XFC_PATTERN_PTR (pattern)));
 }
 
-DEFUN("fc-font-match", Ffc_font_match, 2, 3, 0, /*
+DEFUN ("fc-font-match", Ffc_font_match, 2, 3, 0, /*
 Return the font on DEVICE that most closely matches PATTERN.
 
 DEVICE is an X11 device.
@@ -972,17 +973,17 @@
   FcPattern *p;
   FcConfig *fcc;
 
-  CHECK_FC_PATTERN(pattern);
-  if (NILP(device))
+  CHECK_FC_PATTERN (pattern);
+  if (NILP (device))
     return Qnil;
-  CHECK_X_DEVICE(device);
-  if (!DEVICE_LIVE_P(XDEVICE(device)))
+  CHECK_X_DEVICE (device);
+  if (!DEVICE_LIVE_P (XDEVICE (device)))
     return Qnil;
   if (!NILP (config))
     CHECK_FC_CONFIG (config);
 
   res_fcpat = XFC_PATTERN (ALLOC_NORMAL_LISP_OBJECT (fc_pattern));
-  p = XFC_PATTERN_PTR(pattern);
+  p = XFC_PATTERN_PTR (pattern);
   fcc = NILP (config) ? FcConfigGetCurrent () : XFC_CONFIG_PTR (config);
 
   FcConfigSubstitute (fcc, p, FcMatchPattern);
@@ -991,20 +992,21 @@
   res_fcpat->fcpatPtr = FcFontMatch (fcc, p, &res);
 
   if (res_fcpat->fcpatPtr == NULL)
-    switch (res) {
-    case FcResultNoMatch:
-      return Qfc_result_no_match;
-    case FcResultNoId:
-      return Qfc_result_no_id;
-    default:
-      return Qfc_internal_error;
-    }
+    switch (res)
+      {
+      case FcResultNoMatch:
+	return Qfc_result_no_match;
+      case FcResultNoId:
+	return Qfc_result_no_id;
+      default:
+	return Qfc_internal_error;
+      }
   else
-    return wrap_fc_pattern(res_fcpat);
+    return wrap_fc_pattern (res_fcpat);
 }
 
 /* #### fix this name to correspond to Ben's new nomenclature */
-DEFUN("fc-list-fonts-pattern-objects", Ffc_list_fonts_pattern_objects,
+DEFUN ("fc-list-fonts-pattern-objects", Ffc_list_fonts_pattern_objects,
       3, 3, 0, /*
 Return a list of fonts on DEVICE that match PATTERN for PROPERTIES.
 Each font is represented by a fontconfig pattern object.
@@ -1034,7 +1036,7 @@
 }
 
 /* #### maybe this can/should be folded into fc-list-fonts-pattern-objects? */
-DEFUN("fc-font-sort", Ffc_font_sort, 2, 4, 0, /*
+DEFUN ("fc-font-sort", Ffc_font_sort, 2, 4, 0, /*
 Return a list of all fonts sorted by proximity to PATTERN.
 Each font is represented by a fontconfig pattern object.
 
@@ -1060,10 +1062,10 @@
     FcPattern *p = XFC_PATTERN_PTR (pattern);
     FcResult fcresult;
 
-    if (NILP(nosub))		/* #### temporary debug hack */
+    if (NILP (nosub))		/* #### temporary debug hack */
       FcDefaultSubstitute (p);
     FcConfigSubstitute (fcc, p, FcMatchPattern);
-    fontset = FcFontSort (fcc, p, !NILP(trim), NULL, &fcresult);
+    fontset = FcFontSort (fcc, p, !NILP (trim), NULL, &fcresult);
 
     return fontset_to_list (fontset, DestroyYes);
   }
@@ -1106,7 +1108,7 @@
 			   0, 0, fcconfig_description,
 			   struct fc_config);
 
-DEFUN("fc-init", Ffc_init, 0, 0, 0, /*
+DEFUN ("fc-init", Ffc_init, 0, 0, 0, /*
  -- Function: FcBool FcInit (void)
      Loads the default configuration file and the fonts referenced
      therein and sets the default configuration to that result.
@@ -1118,7 +1120,7 @@
   return (FcInit () == FcTrue) ? Qt : Qnil;
 }
 
-DEFUN("fc-get-version", Ffc_get_version, 0, 0, 0, /*
+DEFUN ("fc-get-version", Ffc_get_version, 0, 0, 0, /*
  -- Function: int FcGetVersion (void)
      Returns the version number of the library.
 XEmacs:  No, this should NOT return a pretty string.
@@ -1132,7 +1134,7 @@
   return make_int (FcGetVersion ());
 }
 
-DEFUN("fc-init-reinitialize", Ffc_init_reinitialize, 0, 0, 0, /*
+DEFUN ("fc-init-reinitialize", Ffc_init_reinitialize, 0, 0, 0, /*
  -- Function: FcBool FcInitReinitialize (void)
      Forces the default configuration file to be reloaded and resets
      the default configuration. */
@@ -1141,7 +1143,7 @@
   return (FcInitReinitialize () == FcTrue) ? Qt : Qnil;
 }
 
-DEFUN("fc-init-bring-up-to-date", Ffc_init_bring_up_to_date, 0, 0, 0, /*
+DEFUN ("fc-init-bring-up-to-date", Ffc_init_bring_up_to_date, 0, 0, 0, /*
  -- Function: FcBool FcInitBringUptoDate (void)
      Checks the rescan interval in the default configuration, checking
      the configuration if the interval has passed and reloading the
@@ -1153,13 +1155,13 @@
 
 #endif /* FONTCONFIG_EXPOSE_CONFIG */
 
-DEFUN("xlfd-font-name-p", Fxlfd_font_name_p, 1, 1, 0, /*
+DEFUN ("xlfd-font-name-p", Fxlfd_font_name_p, 1, 1, 0, /*
 Check whether the string FONTNAME is a XLFD font name. */
       (fontname))
 {
-  CHECK_STRING(fontname);
+  CHECK_STRING (fontname);
   /* #### should bind `case-fold-search' here? */
-  return Fstring_match(Vxlfd_font_name_regexp, fontname, Qnil, Qnil);
+  return Fstring_match (Vxlfd_font_name_regexp, fontname, Qnil, Qnil);
 }
 
 /* FcPatternPrint: there is no point in having wrappers fc-pattern-print,
@@ -1240,10 +1242,10 @@
     };
   
   GCPRO1 (reg);  
-  for (i = 0; i < sizeof(re)/sizeof(Extbyte *); i++)
+  for (i = 0; i < sizeof (re)/sizeof (Extbyte *); i++)
     {
       /* #### Currently this is Host Portable Coding, not ISO 8859-1. */
-      reg = concat2(reg, build_extstring (re[i], Qx_font_name_encoding));
+      reg = concat2 (reg, build_extstring (re[i], Qx_font_name_encoding));
     }
 
   RETURN_UNGCPRO (reg);
@@ -1275,67 +1277,68 @@
 }
 
 void
-syms_of_font_mgr (void) {
-  INIT_LISP_OBJECT(fc_pattern);
+syms_of_font_mgr (void)
+{
+  INIT_LISP_OBJECT (fc_pattern);
 
-  DEFSYMBOL_MULTIWORD_PREDICATE(Qfc_patternp);
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qfc_patternp);
 
-  DEFSYMBOL(Qfc_result_type_mismatch);
-  DEFSYMBOL(Qfc_result_no_match);
-  DEFSYMBOL(Qfc_result_no_id);
-  DEFSYMBOL(Qfc_internal_error);
-  DEFSYMBOL(Qfc_match_pattern);
-  DEFSYMBOL(Qfc_match_font);
-  DEFSYMBOL(Qfont_mgr);
+  DEFSYMBOL (Qfc_result_type_mismatch);
+  DEFSYMBOL (Qfc_result_no_match);
+  DEFSYMBOL (Qfc_result_no_id);
+  DEFSYMBOL (Qfc_internal_error);
+  DEFSYMBOL (Qfc_match_pattern);
+  DEFSYMBOL (Qfc_match_font);
+  DEFSYMBOL (Qfont_mgr);
 
-  DEFSUBR(Ffc_pattern_p);
-  DEFSUBR(Ffc_pattern_create);
-  DEFSUBR(Ffc_name_parse);
-  DEFSUBR(Ffc_name_unparse);
-  DEFSUBR(Ffc_pattern_duplicate);
-  DEFSUBR(Ffc_pattern_add);
-  DEFSUBR(Ffc_pattern_del);
-  DEFSUBR(Ffc_pattern_get);
-  DEFSUBR(Ffc_list_fonts_pattern_objects);
-  DEFSUBR(Ffc_font_sort);
-  DEFSUBR(Ffc_font_match);
-  DEFSUBR(Ffc_default_substitute);
-  DEFSUBR(Ffc_config_substitute);
-  DEFSUBR(Ffc_font_render_prepare);
-  DEFSUBR(Fxlfd_font_name_p);
+  DEFSUBR (Ffc_pattern_p);
+  DEFSUBR (Ffc_pattern_create);
+  DEFSUBR (Ffc_name_parse);
+  DEFSUBR (Ffc_name_unparse);
+  DEFSUBR (Ffc_pattern_duplicate);
+  DEFSUBR (Ffc_pattern_add);
+  DEFSUBR (Ffc_pattern_del);
+  DEFSUBR (Ffc_pattern_get);
+  DEFSUBR (Ffc_list_fonts_pattern_objects);
+  DEFSUBR (Ffc_font_sort);
+  DEFSUBR (Ffc_font_match);
+  DEFSUBR (Ffc_default_substitute);
+  DEFSUBR (Ffc_config_substitute);
+  DEFSUBR (Ffc_font_render_prepare);
+  DEFSUBR (Fxlfd_font_name_p);
 
 #ifdef FONTCONFIG_EXPOSE_CONFIG
-  INIT_LISP_OBJECT(fc_config);
+  INIT_LISP_OBJECT (fc_config);
 
-  DEFSYMBOL_MULTIWORD_PREDICATE(Qfc_configp);
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qfc_configp);
 
-  DEFSUBR(Ffc_config_p);
-  DEFSUBR(Ffc_config_create);
+  DEFSUBR (Ffc_config_p);
+  DEFSUBR (Ffc_config_create);
 #if 0
-  DEFSUBR(Ffc_config_destroy);
+  DEFSUBR (Ffc_config_destroy);
 #endif
-  DEFSUBR(Ffc_config_set_current);
-  DEFSUBR(Ffc_config_get_current);
-  DEFSUBR(Ffc_config_up_to_date);
-  DEFSUBR(Ffc_config_build_fonts);
-  DEFSUBR(Ffc_config_get_config_dirs);
-  DEFSUBR(Ffc_config_get_font_dirs);
-  DEFSUBR(Ffc_config_get_config_files);
-  DEFSUBR(Ffc_config_get_cache);
-  DEFSUBR(Ffc_config_get_fonts);
-  DEFSUBR(Ffc_config_get_blanks);
-  DEFSUBR(Ffc_config_get_rescan_interval);
-  DEFSUBR(Ffc_config_set_rescan_interval);
-  DEFSUBR(Ffc_config_app_font_add_file);
-  DEFSUBR(Ffc_config_app_font_add_dir);
-  DEFSUBR(Ffc_config_app_font_clear);
-  DEFSUBR(Ffc_config_filename);
-  DEFSUBR(Ffc_init_load_config);
-  DEFSUBR(Ffc_init_load_config_and_fonts);
-  DEFSUBR(Ffc_init);
-  DEFSUBR(Ffc_get_version);
-  DEFSUBR(Ffc_init_reinitialize);
-  DEFSUBR(Ffc_init_bring_up_to_date);
+  DEFSUBR (Ffc_config_set_current);
+  DEFSUBR (Ffc_config_get_current);
+  DEFSUBR (Ffc_config_up_to_date);
+  DEFSUBR (Ffc_config_build_fonts);
+  DEFSUBR (Ffc_config_get_config_dirs);
+  DEFSUBR (Ffc_config_get_font_dirs);
+  DEFSUBR (Ffc_config_get_config_files);
+  DEFSUBR (Ffc_config_get_cache);
+  DEFSUBR (Ffc_config_get_fonts);
+  DEFSUBR (Ffc_config_get_blanks);
+  DEFSUBR (Ffc_config_get_rescan_interval);
+  DEFSUBR (Ffc_config_set_rescan_interval);
+  DEFSUBR (Ffc_config_app_font_add_file);
+  DEFSUBR (Ffc_config_app_font_add_dir);
+  DEFSUBR (Ffc_config_app_font_clear);
+  DEFSUBR (Ffc_config_filename);
+  DEFSUBR (Ffc_init_load_config);
+  DEFSUBR (Ffc_init_load_config_and_fonts);
+  DEFSUBR (Ffc_init);
+  DEFSUBR (Ffc_get_version);
+  DEFSUBR (Ffc_init_reinitialize);
+  DEFSUBR (Ffc_init_bring_up_to_date);
 #endif /* FONTCONFIG_EXPOSE_CONFIG */
 }
 
@@ -1345,7 +1348,7 @@
   /* #### The next two DEFVARs belong somewhere else. */
 
   /* #### I know, but the right fix is use the generic debug facility. */
-  DEFVAR_INT ("xft-debug-level", &debug_xft /*
+  DEFVAR_INT ("debug-xft", &debug_xft /*
 Level of debugging messages to issue to stderr for Xft.
 A nonnegative integer.  Set to 0 to suppress all warnings.
 Default is 1 to ensure a minimum of debugging output at initialization.
@@ -1353,12 +1356,12 @@
 */ );
   debug_xft = 0;
 
-  DEFVAR_CONST_INT("xft-version", &xft_version /*
+  DEFVAR_CONST_INT ("xft-version", &xft_version /*
 The major version number of the Xft library being used.
 */ );
   xft_version = XFT_VERSION;
 
-  DEFVAR_CONST_INT("fc-version", &fc_version /*
+  DEFVAR_CONST_INT ("fc-version", &fc_version /*
 The version number of fontconfig.h.  It can be checked against
 `(fc-get-version)', which is the version of the .so.
 It's probably not a disaster if `(> (fc-get-version) fc-version)'.
@@ -1376,7 +1379,7 @@
   staticpro (&Vfc_config_weak_list);
 #endif
 
-  DEFVAR_LISP("xft-xlfd-font-regexp", &Vxlfd_font_name_regexp /*
+  DEFVAR_LISP ("xft-xlfd-font-regexp", &Vxlfd_font_name_regexp /*
 The regular expression used to match XLFD font names. */			       
 	      );
   Vxlfd_font_name_regexp = make_xlfd_font_regexp();
--- a/src/fontcolor-x.c	Mon Mar 29 23:23:33 2010 -0500
+++ b/src/fontcolor-x.c	Sun Apr 04 23:46:50 2010 -0500
@@ -1,8 +1,8 @@
-/* X-specific Lisp objects.
+/* X-specific fonts and colors.
    Copyright (C) 1993, 1994 Free Software Foundation, Inc.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1995 Tinker Systems.
-   Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004 Ben Wing.
+   Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004, 2010 Ben Wing.
    Copyright (C) 1995 Sun Microsystems, Inc.
 
 This file is part of XEmacs.
@@ -46,7 +46,7 @@
 int x_handle_non_fully_specified_fonts;
 
 #ifdef DEBUG_XEMACS 
-Fixnum debug_x_objects;
+Fixnum debug_x_fonts;
 #endif /* DEBUG_XEMACS */
 
 
@@ -941,10 +941,10 @@
 vars_of_fontcolor_x (void)
 {
 #ifdef DEBUG_XEMACS
-  DEFVAR_INT ("debug-x-objects", &debug_x_objects /*
-If non-zero, display debug information about X objects
+  DEFVAR_INT ("debug-x-fonts", &debug_x_fonts /*
+If non-zero, display debug information about X fonts
 */ );
-  debug_x_objects = 0;
+  debug_x_fonts = 0;
 #endif
 
   DEFVAR_BOOL ("x-handle-non-fully-specified-fonts",
--- a/src/fontcolor-xlike-inc.c	Mon Mar 29 23:23:33 2010 -0500
+++ b/src/fontcolor-xlike-inc.c	Sun Apr 04 23:46:50 2010 -0500
@@ -34,27 +34,53 @@
 
 #include "console-xlike-inc.h"
 
-#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
+#define DEBUG_FONTS1(format, arg)		\
+do {						\
+  if (debug_x_fonts)				\
+    debug_out (format, arg);			\
+} while (0)
+
+#define DEBUG_FONTS2(format, arg1, arg2)	\
+do {						\
+  if (debug_x_fonts)				\
+    debug_out (format, arg1, arg2);		\
+} while (0)
 
-#ifdef DEBUG_XEMACS
-# define DEBUG_OBJECTS(FORMAT, ...)  \
-     do { if (debug_x_objects) stderr_out(FORMAT, __VA_ARGS__); } while (0)
-#else  /* DEBUG_XEMACS */
-# define DEBUG_OBJECTS(format, ...)
-#endif /* DEBUG_XEMACS */
+#define DEBUG_FONTS3(format, arg1, arg2, arg3)	\
+do {						\
+  if (debug_x_fonts)				\
+    debug_out (format, arg1, arg2, arg3);	\
+} while (0)
 
-#elif defined(__GNUC__)
+#define DEBUG_FONTS4(format, arg1, arg2, arg3, arg4)	\
+do {							\
+  if (debug_x_fonts)					\
+    debug_out (format, arg1, arg2, arg3, arg4);		\
+} while (0)
 
-#ifdef DEBUG_XEMACS
-# define DEBUG_OBJECTS(format, args...)  \
-  do { if (debug_x_objects) stderr_out(format, args ); } while (0)
-#else  /* DEBUG_XEMACS */
-# define DEBUG_OBJECTS(format, args...)
-#endif /* DEBUG_XEMACS */
+#define DEBUG_FONTS_LISP1(format, arg)		\
+do {						\
+  if (debug_x_fonts)				\
+    debug_out_lisp (format, 1, arg);		\
+} while (0)
+
+#define DEBUG_FONTS_LISP2(format, arg1, arg2)	\
+do {						\
+  if (debug_x_fonts)				\
+    debug_out_lisp (format, 2, arg1, arg2);	\
+} while (0)
 
-#else /* defined(__STDC_VERSION__) [...] */
-# define DEBUG_OBJECTS	(void)
-#endif
+#define DEBUG_FONTS_LISP3(format, arg1, arg2, arg3)	\
+do {							\
+  if (debug_x_fonts)					\
+    debug_out_lisp (format, 3, arg1, arg2, arg3);	\
+} while (0)
+
+#define DEBUG_FONTS_LISP4(format, arg1, arg2, arg3, arg4)	\
+do {								\
+  if (debug_x_fonts)						\
+    debug_out_lisp (format, 4, arg1, arg2, arg3, arg4);		\
+} while (0)
 
 #ifdef MULE
 
@@ -62,14 +88,14 @@
    at run-time.  For other code it isn't. */
 
 static int 
-count_hyphens(const Ibyte *str, Bytecount length, Ibyte **last_hyphen)
+count_hyphens (const Ibyte *str, Bytecount length, Ibyte **last_hyphen)
 {
   int hyphen_count = 0; 
   const Ibyte *hyphening = str;
   const Ibyte *new_hyphening;
 
   for (hyphen_count = 0; 
-       NULL != (new_hyphening = (Ibyte *) memchr((const void *)hyphening, '-', length));
+       NULL != (new_hyphening = (Ibyte *) memchr ((const void *)hyphening, '-', length));
        hyphen_count++)
     {
       ++new_hyphening;
@@ -111,9 +137,8 @@
       Display *dpy = DEVICE_X_DISPLAY (d);
       Extbyte *extname;
       XftFont *rf;
-      const Ibyte *the_nonreloc;
 
-      if (!NILP(reloc))
+      if (!NILP (reloc))
 	{
 	  the_nonreloc = XSTRING_DATA (reloc);
 	  extname = LISP_STRING_TO_EXTERNAL (reloc, Qx_font_name_encoding);
@@ -141,7 +166,7 @@
      */
   if (EQ (charset, Vcharset_ascii) && 
       (!memchr (the_nonreloc, '*', the_length))
-      && (5 > (count_hyphens(the_nonreloc, the_length, NULL))))
+      && (5 > (count_hyphens (the_nonreloc, the_length, NULL))))
     {
       return 1;
     }
@@ -153,20 +178,20 @@
   else if (STAGE_INITIAL == stage)
     {
       registries = XCHARSET_REGISTRIES (charset);
-      if (NILP(registries))
+      if (NILP (registries))
 	{
 	  return 0;
 	}
     }
-  else assert(0);
+  else assert (0);
 
   CHECK_VECTOR (registries);
-  registries_len = XVECTOR_LENGTH(registries);
+  registries_len = XVECTOR_LENGTH (registries);
 
   for (i = 0; i < registries_len; ++i)
     {
-      if (!(STRINGP(XVECTOR_DATA(registries)[i]))
-     	  || (XSTRING_LENGTH(XVECTOR_DATA(registries)[i]) > the_length))
+      if (!(STRINGP (XVECTOR_DATA (registries)[i]))
+     	  || (XSTRING_LENGTH (XVECTOR_DATA (registries)[i]) > the_length))
      	{
      	  continue;
      	}
@@ -177,10 +202,10 @@
      	  "Alphabetic case distinctions are allowed but are for human
      	  readability concerns only. Conforming X servers will perform
      	  matching on font name query or open requests independent of case." */
-       if (0 == qxestrcasecmp(XSTRING_DATA(XVECTOR_DATA(registries)[i]), 
+       if (0 == qxestrcasecmp (XSTRING_DATA (XVECTOR_DATA (registries)[i]), 
      			      the_nonreloc + (the_length - 
      					      XSTRING_LENGTH
-     					      (XVECTOR_DATA(registries)[i]))))
+     					      (XVECTOR_DATA (registries)[i]))))
      	 {
      	   return 1;
      	 }
@@ -189,31 +214,34 @@
 }
 
 static Lisp_Object
-xlistfonts_checking_charset (Lisp_Object device, const Extbyte *xlfd,
+xlistfonts_checking_charset (Lisp_Object device, const Ibyte *xlfd,
 			     Lisp_Object charset, 
 			     enum font_specifier_matchspec_stages stage)
 {
   Extbyte **names;
   Lisp_Object result = Qnil;
   int count = 0, i;
-  DECLARE_EISTRING(ei_single_result);
+  DECLARE_EISTRING (ei_single_result);
+  Extbyte *fontext;
 
+  DEBUG_FONTS2 ("xlistfonts_checking_charset called, XLFD %s stage %s",
+		xlfd, stage == STAGE_INITIAL ? "initial" : "final");
+  DEBUG_FONTS_LISP1 (" charset %s\n", charset);
+  fontext = ITEXT_TO_EXTERNAL (xlfd, Qx_font_name_encoding); 
   names = XListFonts (GET_XLIKE_DISPLAY (XDEVICE (device)),
-		      xlfd, MAX_FONT_COUNT, &count);
+		      fontext, MAX_FONT_COUNT, &count);
 
   for (i = 0; i < count; ++i)
     {
-      eireset(ei_single_result);
-      eicpy_ext(ei_single_result, names[i], Qx_font_name_encoding);
+      eireset (ei_single_result);
+      eicpy_ext (ei_single_result, names[i], Qx_font_name_encoding);
 
-      if (DEVMETH_OR_GIVEN(XDEVICE (device), font_spec_matches_charset,
+      if (DEVMETH_OR_GIVEN (XDEVICE (device), font_spec_matches_charset,
 			   (XDEVICE (device), charset,
-			    eidata(ei_single_result), Qnil, 0,
+			    eidata (ei_single_result), Qnil, 0,
 			    -1, stage), 0))
 	{
-	  result = eimake_string(ei_single_result);
-	  DEBUG_OBJECTS ("in xlistfonts_checking_charset, returning %s\n", 
-			 eidata(ei_single_result));
+	  result = eimake_string (ei_single_result);
 	  break;
 	}
     }
@@ -223,6 +251,7 @@
       XFreeFontNames (names);
     }
 
+  DEBUG_FONTS_LISP1 ("xlistfonts_checking_charset returns %s\n", result);
   return result;
 }
 
@@ -397,7 +426,7 @@
      I don't believe this is documented.  */
 
   DEBUG_XFT1 (1, "confirming charset for font instance %s\n", 
-	      XSTRING_DATA(font));
+	      XSTRING_DATA (font));
 
   /* #### this looks like a fair amount of work, but the basic design
      has never been rethought, and it should be
@@ -535,7 +564,7 @@
 	if (cr->rfc3066)
 	  {
 	    DECLARE_DEBUG_FONTNAME (name);
-	    CHECKING_LANG (0, eidata(name), cr->language);
+	    CHECKING_LANG (0, eidata (name), cr->language);
 	    lang = cr->rfc3066;
 	  }
 	else if (cr->charset)
@@ -581,18 +610,18 @@
 		 Should we just store it into the truename right here? */
 	      DECLARE_DEBUG_FONTNAME (name);
 	      DEBUG_XFT2 (0, "Xft font %s supports %s\n",
-			  eidata(name), lang);
+			  eidata (name), lang);
 #ifdef RETURN_LONG_FONTCONFIG_NAMES
-	      result = eimake_string(eistr_fullname);
+	      result = eimake_string (eistr_fullname);
 #else
-	      result = eimake_string(eistr_longname);
+	      result = eimake_string (eistr_longname);
 #endif
 	    }
 	  else
 	    {
 	      DECLARE_DEBUG_FONTNAME (name);
 	      DEBUG_XFT2 (0, "Xft font %s doesn't support %s\n",
-			  eidata(name), lang);
+			  eidata (name), lang);
 	      result = Qnil;
 	    }
 
@@ -611,7 +640,7 @@
 	    {
 	      if (v.type != FcTypeLangSet) /* excessive paranoia */
 		{
-		  ASSERT_ASCTEXT_ASCII(FcTypeOfValueToString(v));
+		  ASSERT_ASCTEXT_ASCII (FcTypeOfValueToString (v));
 		  /* Urk!  Fall back and punt to core font. */
 		  DEBUG_XFT1 (0, "Unexpected type of lang value (%s)\n",
 			       FcTypeOfValueToString (v));
@@ -622,24 +651,24 @@
 		{
 		  DECLARE_DEBUG_FONTNAME (name);
 		  DEBUG_XFT2 (0, "Xft font %s supports %s\n",
-			      eidata(name), lang);
+			      eidata (name), lang);
 #ifdef RETURN_LONG_FONTCONFIG_NAMES
-		  result = eimake_string(eistr_fullname);
+		  result = eimake_string (eistr_fullname);
 #else
-		  result = eimake_string(eistr_longname);
+		  result = eimake_string (eistr_longname);
 #endif
 		}
 	      else
 		{
 		  DECLARE_DEBUG_FONTNAME (name);
 		  DEBUG_XFT2 (0, "Xft font %s doesn't support %s\n",
-			      eidata(name), lang);
+			      eidata (name), lang);
 		  result = Qnil;
 		}
 	    }
 	  else
 	    {
-	      ASSERT_ASCTEXT_ASCII(FcResultToString(r));
+	      ASSERT_ASCTEXT_ASCII (FcResultToString (r));
 	      DEBUG_XFT1 (0, "Getting lang: unexpected result=%s\n",
 			  FcResultToString (r));
 	      result = Qnil;
@@ -670,12 +699,12 @@
   Ibyte *hyphening, *new_hyphening;
   Bytecount xlfd_length;
 
-  DECLARE_EISTRING(ei_xlfd_without_registry);
-  DECLARE_EISTRING(ei_xlfd);
+  DECLARE_EISTRING (ei_xlfd_without_registry);
+  DECLARE_EISTRING (ei_xlfd);
 
 #ifdef USE_XFT 
-  result = xft_find_charset_font(font, charset, stage);
-  if (!NILP(result)) 
+  result = xft_find_charset_font (font, charset, stage);
+  if (!NILP (result)) 
     {
       return result;
     }
@@ -685,11 +714,11 @@
     {
     case STAGE_INITIAL:
       {
-	if (!(NILP(XCHARSET_REGISTRIES(charset))) 
-	    && VECTORP(XCHARSET_REGISTRIES(charset)))
+	if (!(NILP (XCHARSET_REGISTRIES (charset))) 
+	    && VECTORP (XCHARSET_REGISTRIES (charset)))
 	  {
-	    registries_len = XVECTOR_LENGTH(XCHARSET_REGISTRIES(charset));
-	    registries = XCHARSET_REGISTRIES(charset);
+	    registries_len = XVECTOR_LENGTH (XCHARSET_REGISTRIES (charset));
+	    registries = XCHARSET_REGISTRIES (charset);
 	  }
 	break;
       }
@@ -701,18 +730,18 @@
       }
     default:
       {
-	assert(0);
+	assert (0);
 	break;
       }
     }
 
-  eicpy_lstr(ei_xlfd, font);
-  hyphening = eidata(ei_xlfd);
-  xlfd_length = eilen(ei_xlfd);
+  eicpy_lstr (ei_xlfd, font);
+  hyphening = eidata (ei_xlfd);
+  xlfd_length = eilen (ei_xlfd);
 
   /* Count the hyphens in the string, moving new_hyphening to just after the
      last one. */
-  hyphen_count = count_hyphens(hyphening, xlfd_length, &new_hyphening);
+  hyphen_count = count_hyphens (hyphening, xlfd_length, &new_hyphening);
 
   if (0 == registries_len || (5 > hyphen_count && 
 			      !(1 == xlfd_length && '*' == *hyphening)))
@@ -720,10 +749,7 @@
       /* No proper XLFD specified, or we can't modify the pattern to change
 	 the registry and encoding to match what we want, or we have no
 	 information on the registry needed.  */
-      eito_external(ei_xlfd, Qx_font_name_encoding); 
-      DEBUG_OBJECTS ("about to xlistfonts_checking_charset, XLFD %s\n",
-		     eidata(ei_xlfd));
-      result = xlistfonts_checking_charset (device, eiextdata(ei_xlfd),
+      result = xlistfonts_checking_charset (device, eidata (ei_xlfd),
 					    charset, stage);
       /* No need to loop through the available registries; return
 	 immediately. */
@@ -733,7 +759,7 @@
     {
       /* It's a single asterisk. We can add the registry directly to the
          end. */
-      eicpy_ch(ei_xlfd_without_registry, '*');
+      eicpy_ch (ei_xlfd_without_registry, '*');
     }
   else 
     {
@@ -749,12 +775,12 @@
 	;
       ++new_hyphening;
 
-      eicpy_ei(ei_xlfd_without_registry, ei_xlfd); 
+      eicpy_ei (ei_xlfd_without_registry, ei_xlfd); 
 
       /* Manipulate ei_xlfd_without_registry, using the information about
 	 ei_xlfd, to which it's identical. */
-      eidel(ei_xlfd_without_registry, new_hyphening - hyphening, -1, 
-	    eilen(ei_xlfd) - (new_hyphening - hyphening), -1);
+      eidel (ei_xlfd_without_registry, new_hyphening - hyphening, -1, 
+	    eilen (ei_xlfd) - (new_hyphening - hyphening), -1);
 
     }
 
@@ -765,18 +791,14 @@
      anyway, where before the X server did its search, transferred huge
      amounts of data, and then we proceeded to do a regexp search on that
      data. */
-  for (j = 0; j < registries_len && NILP(result); ++j)
+  for (j = 0; j < registries_len && NILP (result); ++j)
     {
-      eireset(ei_xlfd);
-      eicpy_ei(ei_xlfd, ei_xlfd_without_registry);
+      eireset (ei_xlfd);
+      eicpy_ei (ei_xlfd, ei_xlfd_without_registry);
 
-      eicat_lstr(ei_xlfd, XVECTOR_DATA(registries)[j]);
-
-      eito_external(ei_xlfd, Qx_font_name_encoding); 
+      eicat_lstr (ei_xlfd, XVECTOR_DATA (registries)[j]);
 
-      DEBUG_OBJECTS ("about to xlistfonts_checking_charset, XLFD %s\n",
-		     eidata(ei_xlfd));
-      result = xlistfonts_checking_charset (device, eiextdata(ei_xlfd),
+      result = xlistfonts_checking_charset (device, eidata (ei_xlfd),
 					    charset, stage);
     }
 
@@ -786,8 +808,8 @@
      for ASCII means our frame geometry calculations are
      inconsistent, and that we may crash. */
 
-  if (1 == xlfd_length && EQ(charset, Vcharset_ascii) && NILP(result)
-      && ('*' == eigetch(ei_xlfd_without_registry, 0)))
+  if (1 == xlfd_length && EQ (charset, Vcharset_ascii) && NILP (result)
+      && ('*' == eigetch (ei_xlfd_without_registry, 0)))
 
     {
       int have_latin1 = 0;
@@ -799,7 +821,7 @@
 
       for (j = 0; j < registries_len; ++j)
 	{
-	  if (0 == qxestrcasecmp(XSTRING_DATA(XVECTOR_DATA(registries)[j]),
+	  if (0 == qxestrcasecmp (XSTRING_DATA (XVECTOR_DATA (registries)[j]),
 				 (Ibyte *) FALLBACK_ASCII_REGISTRY))
 	    {
 	      have_latin1 = 1;
@@ -809,21 +831,21 @@
 
       if (!have_latin1)
 	{
-	  Lisp_Object new_registries = make_vector(registries_len + 1, Qnil);
+	  Lisp_Object new_registries = make_vector (registries_len + 1, Qnil);
 
-	  XVECTOR_DATA(new_registries)[0]
-	    = build_ascstring(FALLBACK_ASCII_REGISTRY);
+	  XVECTOR_DATA (new_registries)[0]
+	    = build_ascstring (FALLBACK_ASCII_REGISTRY);
 
-	  memcpy(XVECTOR_DATA(new_registries) + 1,
-		 XVECTOR_DATA(registries),
-		 sizeof XVECTOR_DATA(registries)[0] * 
-		 XVECTOR_LENGTH(registries));
+	  memcpy (XVECTOR_DATA (new_registries) + 1,
+		 XVECTOR_DATA (registries),
+		 sizeof XVECTOR_DATA (registries)[0] * 
+		 XVECTOR_LENGTH (registries));
 
 	  /* Calling set_charset_registries instead of overwriting the
 	     value directly, to allow the charset font caches to be
 	     invalidated and a change to the default face to be
 	     noted.  */
-	  set_charset_registries(charset, new_registries);
+	  set_charset_registries (charset, new_registries);
 
 	  warn_when_safe (Qface, Qwarning,
 			  "Your ASCII charset registries contain nothing "
@@ -842,7 +864,7 @@
 	  /* We preserve a copy of the connection name for the error message
 	     after the device is deleted. */
 	  eicpy_lstr (ei_connection_name, 
-		      DEVICE_CONNECTION (XDEVICE(device)));
+		      DEVICE_CONNECTION (XDEVICE (device)));
 
 	  stderr_out ("Cannot find a font for ASCII, deleting device on %s\n",
 		      eidata (ei_connection_name));
--- a/src/lisp.h	Mon Mar 29 23:23:33 2010 -0500
+++ b/src/lisp.h	Sun Apr 04 23:46:50 2010 -0500
@@ -5467,6 +5467,7 @@
 void stdout_out (const CIbyte *, ...) PRINTF_ARGS (1, 2);
 void external_out (int dest, const CIbyte *fmt, ...) PRINTF_ARGS (2, 3);
 void debug_out (const CIbyte *, ...) PRINTF_ARGS (1, 2);
+void debug_out_lisp (const CIbyte *, int nargs, ...);
 DECLARE_DOESNT_RETURN (fatal (const CIbyte *, ...)) PRINTF_ARGS(1, 2);
 
 /* Internal functions: */
--- a/src/print.c	Mon Mar 29 23:23:33 2010 -0500
+++ b/src/print.c	Sun Apr 04 23:46:50 2010 -0500
@@ -2465,6 +2465,33 @@
   external_debug_print (debug_print_obj, EXT_PRINT_ALL);
 }
 
+/* Printf-style output when the objects being printed are Lisp objects.
+   Calling style is e.g.
+
+   debug_out_lisp ("Called foo(%s %s)\n", 2, arg0, arg1)
+*/
+
+void
+debug_out_lisp (const CIbyte *format, int nargs, ...)
+{
+  /* This function cannot GC, since GC is forbidden */
+  struct debug_bindings bindings;
+  int specdepth = debug_print_enter (&bindings);
+  Lisp_Object *args = alloca_array (Lisp_Object, nargs);
+  va_list va;
+  int i;
+  Ibyte *msgout;
+
+  va_start (va, nargs);
+  for (i = 0; i < nargs; i++)
+    args[i] = va_arg (va, Lisp_Object);
+  va_end (va);
+  msgout = emacs_vsprintf_malloc_lisp (format, Qnil, nargs, args, NULL);
+  debug_out ("%s", msgout);
+  xfree (msgout);
+  unbind_to (specdepth);
+}
+
 /* Getting tired of typing debug_print() ... */
 void dp (Lisp_Object debug_print_obj);
 void