diff src/xsettings.c @ 106162:4cee82a6f25b

Always suggest system font because .emacs may not have been read yet. * xfns.c (x_default_font_parameter): Call xsettings_get_system_font. * xsettings.h: Declare xsettings_get_system_font. * xsettings.c (xsettings_get_system_font): New function. (init_gconf): No use initiating gconf unless we have Xft also. (syms_of_xsettings): Only provide system-font-setting if HAVE_XFT and HAVE_GCONF.
author Jan Dj?rv <jan.h.d@swipnet.se>
date Fri, 20 Nov 2009 09:44:42 +0000
parents 5fa329215a93
children 9b6f45dd8386
line wrap: on
line diff
--- a/src/xsettings.c	Fri Nov 20 08:54:18 2009 +0000
+++ b/src/xsettings.c	Fri Nov 20 09:44:42 2009 +0000
@@ -498,7 +498,7 @@
 static void
 init_gconf ()
 {
-#ifdef HAVE_GCONF
+#if defined (HAVE_GCONF) && defined (HAVE_XFT)
   int i;
   char *s;
   /* Should be enough, this is called at startup */
@@ -556,7 +556,7 @@
           init_sigio (i);
 #endif /* ! defined (SIGIO) */
       }
-#endif /* HAVE_GCONF */
+#endif /* HAVE_GCONF && HAVE_XFT */
 }
 
 static void
@@ -605,6 +605,11 @@
   init_xfd_settings (dpyinfo);
 }
 
+const char *
+xsettings_get_system_font ()
+{
+  return current_mono_font;
+}
 
 DEFUN ("font-get-system-font", Ffont_get_system_font, Sfont_get_system_font,
        0, 0, 0,
@@ -635,10 +640,10 @@
     doc: /* *Non-nil means to use the system defined font.  */);
   use_system_font = 0;
 
+#ifdef HAVE_XFT
+  Fprovide (intern_c_string ("font-render-setting"), Qnil);
 #ifdef HAVE_GCONF
   Fprovide (intern_c_string ("system-font-setting"), Qnil);
 #endif
-#ifdef HAVE_XFT
-  Fprovide (intern_c_string ("font-render-setting"), Qnil);
 #endif
 }