aboutsummaryrefslogtreecommitdiffstats
path: root/src/xfaces.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xfaces.c')
-rw-r--r--src/xfaces.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index 5137ab7e721..b8b946bea47 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -3435,8 +3435,8 @@ set_lface_from_font_name (f, lface, fontname, force_p, may_fail_p)
3435 call into lisp. */ 3435 call into lisp. */
3436 3436
3437Lisp_Object 3437Lisp_Object
3438merge_face_heights (from, to, invalid, gcpro) 3438merge_face_heights (from, to, invalid)
3439 Lisp_Object from, to, invalid, gcpro; 3439 Lisp_Object from, to, invalid;
3440{ 3440{
3441 Lisp_Object result = invalid; 3441 Lisp_Object result = invalid;
3442 3442
@@ -3461,16 +3461,11 @@ merge_face_heights (from, to, invalid, gcpro)
3461 /* Call function with current height as argument. 3461 /* Call function with current height as argument.
3462 From is the new height. */ 3462 From is the new height. */
3463 Lisp_Object args[2]; 3463 Lisp_Object args[2];
3464 struct gcpro gcpro1;
3465
3466 GCPRO1 (gcpro);
3467 3464
3468 args[0] = from; 3465 args[0] = from;
3469 args[1] = to; 3466 args[1] = to;
3470 result = safe_call (2, args); 3467 result = safe_call (2, args);
3471 3468
3472 UNGCPRO;
3473
3474 /* Ensure that if TO was absolute, so is the result. */ 3469 /* Ensure that if TO was absolute, so is the result. */
3475 if (INTEGERP (to) && !INTEGERP (result)) 3470 if (INTEGERP (to) && !INTEGERP (result))
3476 result = invalid; 3471 result = invalid;
@@ -3523,8 +3518,7 @@ merge_face_vectors (f, from, to, named_merge_points)
3523 if (!UNSPECIFIEDP (from[i])) 3518 if (!UNSPECIFIEDP (from[i]))
3524 { 3519 {
3525 if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i])) 3520 if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i]))
3526 to[i] = merge_face_heights (from[i], to[i], to[i], 3521 to[i] = merge_face_heights (from[i], to[i], to[i]);
3527 named_merge_points);
3528 else 3522 else
3529 to[i] = from[i]; 3523 to[i] = from[i];
3530 } 3524 }
@@ -3551,11 +3545,16 @@ merge_named_face (f, face_name, to, named_merge_points)
3551 if (push_named_merge_point (&named_merge_point, 3545 if (push_named_merge_point (&named_merge_point,
3552 face_name, &named_merge_points)) 3546 face_name, &named_merge_points))
3553 { 3547 {
3548 struct gcpro gcpro1;
3554 Lisp_Object from[LFACE_VECTOR_SIZE]; 3549 Lisp_Object from[LFACE_VECTOR_SIZE];
3555 int ok = get_lface_attributes (f, face_name, from, 0); 3550 int ok = get_lface_attributes (f, face_name, from, 0);
3556 3551
3557 if (ok) 3552 if (ok)
3558 merge_face_vectors (f, from, to, named_merge_points); 3553 {
3554 GCPRO1 (named_merge_point.face_name);
3555 merge_face_vectors (f, from, to, named_merge_points);
3556 UNGCPRO;
3557 }
3559 3558
3560 return ok; 3559 return ok;
3561 } 3560 }
@@ -3646,8 +3645,7 @@ merge_face_ref (f, face_ref, to, err_msgs, named_merge_points)
3646 else if (EQ (keyword, QCheight)) 3645 else if (EQ (keyword, QCheight))
3647 { 3646 {
3648 Lisp_Object new_height = 3647 Lisp_Object new_height =
3649 merge_face_heights (value, to[LFACE_HEIGHT_INDEX], 3648 merge_face_heights (value, to[LFACE_HEIGHT_INDEX], Qnil);
3650 Qnil, Qnil);
3651 3649
3652 if (! NILP (new_height)) 3650 if (! NILP (new_height))
3653 to[LFACE_HEIGHT_INDEX] = new_height; 3651 to[LFACE_HEIGHT_INDEX] = new_height;
@@ -4034,7 +4032,7 @@ FRAME 0 means change the face on all frames, and change the default
4034 /* The default face must have an absolute size, 4032 /* The default face must have an absolute size,
4035 otherwise, we do a test merge with a random 4033 otherwise, we do a test merge with a random
4036 height to see if VALUE's ok. */ 4034 height to see if VALUE's ok. */
4037 : merge_face_heights (value, make_number (10), Qnil, Qnil)); 4035 : merge_face_heights (value, make_number (10), Qnil));
4038 4036
4039 if (!INTEGERP (test) || XINT (test) <= 0) 4037 if (!INTEGERP (test) || XINT (test) <= 0)
4040 signal_error ("Invalid face height", value); 4038 signal_error ("Invalid face height", value);
@@ -4740,7 +4738,7 @@ the result will be absolute, otherwise it will be relative. */)
4740 if (EQ (value1, Qunspecified)) 4738 if (EQ (value1, Qunspecified))
4741 return value2; 4739 return value2;
4742 else if (EQ (attribute, QCheight)) 4740 else if (EQ (attribute, QCheight))
4743 return merge_face_heights (value1, value2, value1, Qnil); 4741 return merge_face_heights (value1, value2, value1);
4744 else 4742 else
4745 return value1; 4743 return value1;
4746} 4744}