Mercurial > emacs
changeset 100816:b6d603864354
(Finternal_set_lisp_face_attribute): Improve error message.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Thu, 01 Jan 2009 08:09:32 +0000 |
parents | 781037532b30 |
children | 9ea6227529f4 |
files | src/xfaces.c |
diffstat | 1 files changed, 16 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xfaces.c Thu Jan 01 08:09:11 2009 +0000 +++ b/src/xfaces.c Thu Jan 01 08:09:32 2009 +0000 @@ -3046,17 +3046,22 @@ { 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);