comparison src/xsettings.c @ 106097:5fa329215a93

xsettings.c didn't check font-use-system-font, fix that. * xsettings.c (something_changedCB, Ffont_get_system_font): Check use_system_font. (syms_of_xsettings): DEFVAR font-use-system-font. * font-setting.el (font-use-system-font): Moved ... * cus-start.el (all): ... to here.
author Jan Djärv <jan.h.d@swipnet.se>
date Tue, 17 Nov 2009 20:17:46 +0000
parents 6804c4648fee
children 4cee82a6f25b
comparison
equal deleted inserted replaced
106096:58fd09a16d9e 106097:5fa329215a93
38 #endif 38 #endif
39 39
40 static char *current_mono_font; 40 static char *current_mono_font;
41 static struct x_display_info *first_dpyinfo; 41 static struct x_display_info *first_dpyinfo;
42 static Lisp_Object Qfont_name, Qfont_render; 42 static Lisp_Object Qfont_name, Qfont_render;
43 static int use_system_font;
43 44
44 #ifdef HAVE_GCONF 45 #ifdef HAVE_GCONF
45 static GConfClient *gconf_client; 46 static GConfClient *gconf_client;
46 #endif 47 #endif
47 48
94 struct x_display_info *dpyinfo; 95 struct x_display_info *dpyinfo;
95 int found = 0; 96 int found = 0;
96 for (dpyinfo = x_display_list; !found && dpyinfo; dpyinfo = dpyinfo->next) 97 for (dpyinfo = x_display_list; !found && dpyinfo; dpyinfo = dpyinfo->next)
97 found = dpyinfo == first_dpyinfo; 98 found = dpyinfo == first_dpyinfo;
98 99
99 if (found) 100 if (found && use_system_font)
100 store_font_changed_event (Qfont_name, 101 store_font_changed_event (Qfont_name,
101 XCAR (first_dpyinfo->name_list_element)); 102 XCAR (first_dpyinfo->name_list_element));
102 } 103 }
103 } 104 }
104 #endif /* HAVE_GCONF */ 105 #endif /* HAVE_GCONF */
608 DEFUN ("font-get-system-font", Ffont_get_system_font, Sfont_get_system_font, 609 DEFUN ("font-get-system-font", Ffont_get_system_font, Sfont_get_system_font,
609 0, 0, 0, 610 0, 0, 0,
610 doc: /* Get the system default monospaced font. */) 611 doc: /* Get the system default monospaced font. */)
611 () 612 ()
612 { 613 {
613 return current_mono_font 614 return current_mono_font && use_system_font
614 ? make_string (current_mono_font, strlen (current_mono_font)) 615 ? make_string (current_mono_font, strlen (current_mono_font))
615 : Qnil; 616 : Qnil;
616 } 617 }
617 618
618 void 619 void
628 staticpro (&Qfont_name); 629 staticpro (&Qfont_name);
629 Qfont_render = intern_c_string ("font-render"); 630 Qfont_render = intern_c_string ("font-render");
630 staticpro (&Qfont_render); 631 staticpro (&Qfont_render);
631 defsubr (&Sfont_get_system_font); 632 defsubr (&Sfont_get_system_font);
632 633
634 DEFVAR_BOOL ("font-use-system-font", &use_system_font,
635 doc: /* *Non-nil means to use the system defined font. */);
636 use_system_font = 0;
637
633 #ifdef HAVE_GCONF 638 #ifdef HAVE_GCONF
634 Fprovide (intern_c_string ("system-font-setting"), Qnil); 639 Fprovide (intern_c_string ("system-font-setting"), Qnil);
635 #endif 640 #endif
636 #ifdef HAVE_XFT 641 #ifdef HAVE_XFT
637 Fprovide (intern_c_string ("font-render-setting"), Qnil); 642 Fprovide (intern_c_string ("font-render-setting"), Qnil);