aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2008-01-22 12:03:15 +0000
committerKenichi Handa2008-01-22 12:03:15 +0000
commitdb1c10a277d4bfc091ff043cb30224e3bc6f35d1 (patch)
treefb153ac8bcbc32626300974104bfd244813c729d
parenteee0d6865fda22857c71724edc491c19a815e3db (diff)
downloademacs-db1c10a277d4bfc091ff043cb30224e3bc6f35d1.tar.gz
emacs-db1c10a277d4bfc091ff043cb30224e3bc6f35d1.zip
(Finternal_set_lisp_face_attribute) [USE_FONT_BACKEND]:
Fix previous change. If the frame is not on a window system, signal an error.
-rw-r--r--src/xfaces.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index c2a5dd9d4a0..ce7e9bec498 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -4540,41 +4540,32 @@ FRAME 0 means change the face on all frames, and change the default
4540 4540
4541#ifdef USE_FONT_BACKEND 4541#ifdef USE_FONT_BACKEND
4542 if (enable_font_backend 4542 if (enable_font_backend
4543 && FRAME_WINDOW_P (XFRAME (frame))
4544 && !UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)) 4543 && !UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
4545 { 4544 {
4546 int fontset; 4545 tmp = Fquery_fontset (value, Qnil);
4547
4548 if (EQ (attr, QCfontset)) 4546 if (EQ (attr, QCfontset))
4549 { 4547 {
4550 Lisp_Object fontset_name = Fquery_fontset (value, Qnil); 4548 if (NILP (tmp))
4551
4552 if (NILP (fontset_name))
4553 signal_error ("Invalid fontset name", value); 4549 signal_error ("Invalid fontset name", value);
4554 LFACE_FONTSET (lface) = value; 4550 LFACE_FONTSET (lface) = tmp;
4555 } 4551 }
4556 else 4552 else
4557 { 4553 {
4554 int fontset;
4558 Lisp_Object font_object; 4555 Lisp_Object font_object;
4559 4556
4560 if (FONT_OBJECT_P (value)) 4557 if (! NILP (tmp))
4561 { 4558 {
4562 font_object = value; 4559 fontset = fs_query_fontset (tmp, 0);
4563 fontset = FRAME_FONTSET (f); 4560 value = fontset_ascii (fontset);
4564 } 4561 }
4565 else 4562 else
4566 { 4563 {
4567 CHECK_STRING (value); 4564 fontset = FRAME_FONTSET (f);
4568
4569 fontset = fs_query_fontset (value, 0);
4570 if (fontset >= 0)
4571 value = fontset_ascii (fontset);
4572 else
4573 fontset = FRAME_FONTSET (f);
4574 font_object = font_open_by_name (f, SDATA (value));
4575 if (NILP (font_object))
4576 signal_error ("Invalid font", value);
4577 } 4565 }
4566 font_object = font_open_by_name (f, SDATA (value));
4567 if (NILP (font_object))
4568 signal_error ("Invalid font", value);
4578 set_lface_from_font_and_fontset (f, lface, font_object, 4569 set_lface_from_font_and_fontset (f, lface, font_object,
4579 fontset, 1); 4570 fontset, 1);
4580 } 4571 }