aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/xfaces.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index f237e0630b6..51dcfb144d1 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -3204,6 +3204,20 @@ push_named_merge_point (struct named_merge_point *new_named_merge_point,
3204 3204
3205 3205
3206 3206
3207static Lisp_Object
3208internal_resolve_face_name (nargs, args)
3209 int nargs;
3210 Lisp_Object *args;
3211{
3212 Fget (args[0], args[1]);
3213}
3214
3215static Lisp_Object
3216resolve_face_name_error (ignore)
3217 Lisp_Object ignore;
3218{
3219 return Qnil;
3220}
3207 3221
3208/* Resolve face name FACE_NAME. If FACE_NAME is a string, intern it 3222/* Resolve face name FACE_NAME. If FACE_NAME is a string, intern it
3209 to make it a symvol. If FACE_NAME is an alias for another face, 3223 to make it a symvol. If FACE_NAME is an alias for another face,
@@ -3214,17 +3228,25 @@ resolve_face_name (face_name)
3214 Lisp_Object face_name; 3228 Lisp_Object face_name;
3215{ 3229{
3216 Lisp_Object aliased; 3230 Lisp_Object aliased;
3231 Lisp_Object args[2];
3232 int c = 0;
3217 3233
3218 if (STRINGP (face_name)) 3234 if (STRINGP (face_name))
3219 face_name = intern (SDATA (face_name)); 3235 face_name = intern (SDATA (face_name));
3220 3236
3221 while (SYMBOLP (face_name)) 3237 /* Protect against loops by limiting the number of indirections. */
3238 while (SYMBOLP (face_name) && c < 10)
3222 { 3239 {
3223 aliased = Fget (face_name, Qface_alias); 3240 /* Fget can signal an error; just ignore it. */
3241 args[0] = face_name;
3242 args[1] = Qface_alias;
3243 aliased = internal_condition_case_2 (internal_resolve_face_name, 2, args, Qt,
3244 resolve_face_name_error);
3224 if (NILP (aliased)) 3245 if (NILP (aliased))
3225 break; 3246 break;
3226 else 3247 else
3227 face_name = aliased; 3248 face_name = aliased;
3249 c++;
3228 } 3250 }
3229 3251
3230 return face_name; 3252 return face_name;