Commit dfb3c4c6 authored by Jan Djärv's avatar Jan Djärv

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.
parent 25fe851a
2009-11-17 Jan Djärv <jan.h.d@swipnet.se>
* font-setting.el (font-use-system-font): Moved ...
* cus-start.el (all): ... to here.
2009-11-17 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-advice-file-expand-wildcards): Simplify.
......
......@@ -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.
......
......@@ -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)
......
2009-11-17 Jan Djärv <jan.h.d@swipnet.se>
* 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 <schwab@linux-m68k.org>
* xfns.c (x_default_font_parameter): Remove dead assignment.
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment