diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2009-01-01 08:09:32 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2009-01-01 08:09:32 +0000 |
commit | e66d5363935fcfaec5cfffeb2efb2418295c1fc9 (patch) | |
tree | 4b5822282e9883bb8e9af0bf7ea3e62d97ce4540 /src | |
parent | 9ef69046621294192d51c7b8d2a1f99bd6167a2b (diff) | |
download | emacs-e66d5363935fcfaec5cfffeb2efb2418295c1fc9.tar.gz |
(Finternal_set_lisp_face_attribute): Improve error message.
Diffstat (limited to 'src')
-rw-r--r-- | src/xfaces.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index 4e5107a5932..64cd4a09015 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3046,17 +3046,22 @@ FRAME 0 means change the face on all frames, and change the default { if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)) { - Lisp_Object test; - - test = (EQ (face, Qdefault) - ? value - /* The default face must have an absolute size, - otherwise, we do a test merge with a random - height to see if VALUE's ok. */ - : merge_face_heights (value, make_number (10), Qnil)); - - if (!INTEGERP (test) || XINT (test) <= 0) - signal_error ("Invalid face height", value); + if (EQ (face, Qdefault)) + { + /* The default face must have an absolute size. */ + if (!INTEGERP (value) || XINT (value) <= 0) + signal_error ("Invalid default face height", value); + } + else + { + /* For non-default faces, do a test merge with a random + height to see if VALUE's ok. */ + Lisp_Object test = merge_face_heights (value, + make_number (10), + Qnil); + if (!INTEGERP (test) || XINT (test) <= 0) + signal_error ("Invalid face height", value); + } } old_value = LFACE_HEIGHT (lface); |