aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 b37581909e..3b3b51aace 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-17 Jan Djärv <[email protected]>
+
+ * font-setting.el (font-use-system-font): Moved ...
+
+ * cus-start.el (all): ... to here.
+
2009-11-17 Michael Albinus <[email protected]>
* net/tramp.el (tramp-advice-file-expand-wildcards): Simplify.
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 970431d46c..76acd7e92c 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."
;; xterm.c
(x-use-underline-position-properties display boolean "22.1")
(x-underline-at-descent-line display boolean "22.1")
- (x-stretch-cursor display boolean "21.1")))
+ (x-stretch-cursor display boolean "21.1")
+ ;; xsettings.c
+ (font-use-system-font font-selection boolean "23.2")))
this symbol group type standard version native-p
;; This function turns a value
;; into an expression which produces that value.
diff --git a/lisp/font-setting.el b/lisp/font-setting.el
index f426a141bb..51cf1375d8 100644
--- a/lisp/font-setting.el
+++ b/lisp/font-setting.el
@@ -31,20 +31,6 @@
;;; Customizable variables
-(defun font-setting-set-system-font (symbol value)
- (set-default symbol value)
- (if (symbol-value symbol)
- (let ((f (selected-frame)))
- (if (display-graphic-p f)
- (font-setting-change-default-font f t)))))
-
-(defcustom font-use-system-font nil
- "If non-nil, use the system monospaced font"
- :version "23.2"
- :type 'boolean
- :group 'font-selection
- :set 'font-setting-set-system-font)
-
(declare-function font-get-system-font "xsettings.c" ())
(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)."
(if set-font new-font
;; else set font again, hinting etc. may have changed.
frame-font)))
- (progn
- (set-frame-parameter f 'font-parameter font-to-set)
- (set-face-attribute 'default f
- :width 'normal
- :weight 'normal
- :slant 'normal
- :font font-to-set)))))
+ (if font-to-set
+ (progn
+ (message "setting %s" font-to-set)
+ (set-frame-parameter f 'font-parameter font-to-set)
+ (set-face-attribute 'default f
+ :width 'normal
+ :weight 'normal
+ :slant 'normal
+ :font font-to-set))))))
;; Set for future frames.
(set-face-attribute 'default t :font new-font)
diff --git a/src/ChangeLog b/src/ChangeLog
index ef97e097bf..4b3b64f74b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-17 Jan Djärv <[email protected]>
+
+ * xsettings.c (something_changedCB, Ffont_get_system_font): Check
+ use_system_font.
+ (syms_of_xsettings): DEFVAR font-use-system-font.
+
2009-11-17 Andreas Schwab <[email protected]>
* xfns.c (x_default_font_parameter): Remove dead assignment.
diff --git a/src/xsettings.c b/src/xsettings.c
index 99ddd00471..71a7eaa86c 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/>. */
static char *current_mono_font;
static struct x_display_info *first_dpyinfo;
static Lisp_Object Qfont_name, Qfont_render;
+static int use_system_font;
#ifdef HAVE_GCONF
static GConfClient *gconf_client;
@@ -96,7 +97,7 @@ something_changedCB (client, cnxn_id, entry, user_data)
for (dpyinfo = x_display_list; !found && dpyinfo; dpyinfo = dpyinfo->next)
found = dpyinfo == first_dpyinfo;
- if (found)
+ if (found && use_system_font)
store_font_changed_event (Qfont_name,
XCAR (first_dpyinfo->name_list_element));
}
@@ -610,7 +611,7 @@ DEFUN ("font-get-system-font", Ffont_get_system_font, Sfont_get_system_font,
doc: /* Get the system default monospaced font. */)
()
{
- return current_mono_font
+ return current_mono_font && use_system_font
? make_string (current_mono_font, strlen (current_mono_font))
: Qnil;
}
@@ -630,6 +631,10 @@ syms_of_xsettings ()
staticpro (&Qfont_render);
defsubr (&Sfont_get_system_font);
+ DEFVAR_BOOL ("font-use-system-font", &use_system_font,
+ doc: /* *Non-nil means to use the system defined font. */);
+ use_system_font = 0;
+
#ifdef HAVE_GCONF
Fprovide (intern_c_string ("system-font-setting"), Qnil);
#endif