emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/src ChangeLog xfns.c xsettings.c xsettings.h


From: Jan Djärv
Subject: [Emacs-diffs] emacs/src ChangeLog xfns.c xsettings.c xsettings.h
Date: Fri, 20 Nov 2009 09:44:44 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Jan Djärv <jhd> 09/11/20 09:44:43

Modified files:
        src            : ChangeLog xfns.c xsettings.c xsettings.h 

Log message:
        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.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7884&r2=1.7885
http://cvs.savannah.gnu.org/viewcvs/emacs/src/xfns.c?cvsroot=emacs&r1=1.752&r2=1.753
http://cvs.savannah.gnu.org/viewcvs/emacs/src/xsettings.c?cvsroot=emacs&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/emacs/src/xsettings.h?cvsroot=emacs&r1=1.2&r2=1.3

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7884
retrieving revision 1.7885
diff -u -b -r1.7884 -r1.7885
--- ChangeLog   20 Nov 2009 08:54:18 -0000      1.7884
+++ ChangeLog   20 Nov 2009 09:44:42 -0000      1.7885
@@ -1,5 +1,14 @@
 2009-11-20  Jan Djärv  <address@hidden>
 
+       * 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.
+
        * gtkutil.c (xg_modify_menubar_widgets): If menubar is totally empty
        add a blank entry so it doesn't collapse into nothing.
 

Index: xfns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xfns.c,v
retrieving revision 1.752
retrieving revision 1.753
diff -u -b -r1.752 -r1.753
--- xfns.c      17 Nov 2009 21:57:49 -0000      1.752
+++ xfns.c      20 Nov 2009 09:44:43 -0000      1.753
@@ -3031,9 +3031,16 @@
   Lisp_Object font;
   int got_from_gconf = 0;
   if (EQ (font_param, Qunbound))
+    font_param = Qnil;
+
+  if (NILP (font_param))
     {
-      font_param = Ffont_get_system_font();
-      got_from_gconf = !NILP (font_param);
+      /* System font takes precedendce over X resources.  We must suggest this
+         regardless of font-use-system-font because .emacs may not have been
+         read yet.  */
+      const char *system_font = xsettings_get_system_font ();
+      if (system_font) font_param = make_string (system_font,
+                                                 strlen (system_font));
     }
 
   font = !NILP (font_param) ? font_param

Index: xsettings.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xsettings.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- xsettings.c 17 Nov 2009 20:17:50 -0000      1.4
+++ xsettings.c 20 Nov 2009 09:44:43 -0000      1.5
@@ -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
 }

Index: xsettings.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xsettings.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- xsettings.h 17 Nov 2009 21:57:50 -0000      1.2
+++ xsettings.h 20 Nov 2009 09:44:43 -0000      1.3
@@ -24,6 +24,7 @@
 extern void xsettings_initialize P_ ((struct x_display_info *dpyinfo));
 extern void xft_settings_event P_ ((struct x_display_info *dpyinfo,
                                     XEvent *));
+extern const char *xsettings_get_system_font P_ ((void));
 
 
 #endif /* XSETTINGS_H */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]