aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2009-11-17 20:17:46 +0000
committerJan Djärv2009-11-17 20:17:46 +0000
commitdfb3c4c6403a4199e2479ef9a06713b3cdc504d1 (patch)
tree25ce5cc1a9fb929b243ccf7861ead2eec4e0d970
parent25fe851a7c3c37ba537e5c08af2b0396ccb5ad60 (diff)
downloademacs-dfb3c4c6403a4199e2479ef9a06713b3cdc504d1.tar.gz
emacs-dfb3c4c6403a4199e2479ef9a06713b3cdc504d1.zip
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.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/cus-start.el4
-rw-r--r--lisp/font-setting.el30
-rw-r--r--src/ChangeLog6
-rw-r--r--src/xsettings.c9
5 files changed, 31 insertions, 24 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b37581909eb..3b3b51aacea 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12009-11-17 Jan Djärv <jan.h.d@swipnet.se>
2
3 * font-setting.el (font-use-system-font): Moved ...
4
5 * cus-start.el (all): ... to here.
6
12009-11-17 Michael Albinus <michael.albinus@gmx.de> 72009-11-17 Michael Albinus <michael.albinus@gmx.de>
2 8
3 * net/tramp.el (tramp-advice-file-expand-wildcards): Simplify. 9 * net/tramp.el (tramp-advice-file-expand-wildcards): Simplify.
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 970431d46cd..76acd7e92cb 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -351,7 +351,9 @@ since it could result in memory overflow and make Emacs crash."
351 ;; xterm.c 351 ;; xterm.c
352 (x-use-underline-position-properties display boolean "22.1") 352 (x-use-underline-position-properties display boolean "22.1")
353 (x-underline-at-descent-line display boolean "22.1") 353 (x-underline-at-descent-line display boolean "22.1")
354 (x-stretch-cursor display boolean "21.1"))) 354 (x-stretch-cursor display boolean "21.1")
355 ;; xsettings.c
356 (font-use-system-font font-selection boolean "23.2")))
355 this symbol group type standard version native-p 357 this symbol group type standard version native-p
356 ;; This function turns a value 358 ;; This function turns a value
357 ;; into an expression which produces that value. 359 ;; into an expression which produces that value.
diff --git a/lisp/font-setting.el b/lisp/font-setting.el
index f426a141bbf..51cf1375d8f 100644
--- a/lisp/font-setting.el
+++ b/lisp/font-setting.el
@@ -31,20 +31,6 @@
31 31
32;;; Customizable variables 32;;; Customizable variables
33 33
34(defun font-setting-set-system-font (symbol value)
35 (set-default symbol value)
36 (if (symbol-value symbol)
37 (let ((f (selected-frame)))
38 (if (display-graphic-p f)
39 (font-setting-change-default-font f t)))))
40
41(defcustom font-use-system-font nil
42 "If non-nil, use the system monospaced font"
43 :version "23.2"
44 :type 'boolean
45 :group 'font-selection
46 :set 'font-setting-set-system-font)
47
48(declare-function font-get-system-font "xsettings.c" ()) 34(declare-function font-get-system-font "xsettings.c" ())
49 35
50(defun font-setting-change-default-font (display-or-frame set-font) 36(defun font-setting-change-default-font (display-or-frame set-font)
@@ -75,13 +61,15 @@ current form for the frame (i.e. hinting or somesuch changed)."
75 (if set-font new-font 61 (if set-font new-font
76 ;; else set font again, hinting etc. may have changed. 62 ;; else set font again, hinting etc. may have changed.
77 frame-font))) 63 frame-font)))
78 (progn 64 (if font-to-set
79 (set-frame-parameter f 'font-parameter font-to-set) 65 (progn
80 (set-face-attribute 'default f 66 (message "setting %s" font-to-set)
81 :width 'normal 67 (set-frame-parameter f 'font-parameter font-to-set)
82 :weight 'normal 68 (set-face-attribute 'default f
83 :slant 'normal 69 :width 'normal
84 :font font-to-set))))) 70 :weight 'normal
71 :slant 'normal
72 :font font-to-set))))))
85 73
86 ;; Set for future frames. 74 ;; Set for future frames.
87 (set-face-attribute 'default t :font new-font) 75 (set-face-attribute 'default t :font new-font)
diff --git a/src/ChangeLog b/src/ChangeLog
index ef97e097bf0..4b3b64f74bb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12009-11-17 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xsettings.c (something_changedCB, Ffont_get_system_font): Check
4 use_system_font.
5 (syms_of_xsettings): DEFVAR font-use-system-font.
6
12009-11-17 Andreas Schwab <schwab@linux-m68k.org> 72009-11-17 Andreas Schwab <schwab@linux-m68k.org>
2 8
3 * xfns.c (x_default_font_parameter): Remove dead assignment. 9 * xfns.c (x_default_font_parameter): Remove dead assignment.
diff --git a/src/xsettings.c b/src/xsettings.c
index 99ddd004718..71a7eaa86ca 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -40,6 +40,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
40static char *current_mono_font; 40static char *current_mono_font;
41static struct x_display_info *first_dpyinfo; 41static struct x_display_info *first_dpyinfo;
42static Lisp_Object Qfont_name, Qfont_render; 42static Lisp_Object Qfont_name, Qfont_render;
43static int use_system_font;
43 44
44#ifdef HAVE_GCONF 45#ifdef HAVE_GCONF
45static GConfClient *gconf_client; 46static GConfClient *gconf_client;
@@ -96,7 +97,7 @@ something_changedCB (client, cnxn_id, entry, user_data)
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 }
@@ -610,7 +611,7 @@ DEFUN ("font-get-system-font", Ffont_get_system_font, Sfont_get_system_font,
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}
@@ -630,6 +631,10 @@ syms_of_xsettings ()
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