diff options
| author | Richard M. Stallman | 2004-11-07 03:47:09 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-11-07 03:47:09 +0000 |
| commit | e1e419ecc6263bc887bc4c4a23f1db4e8582da81 (patch) | |
| tree | 5e5fd1ad8e3348c73dd74d04bc256d5f500beafd /src | |
| parent | 3b6536b10170a03da2d0b4682513a2ec3d5df4e5 (diff) | |
| download | emacs-e1e419ecc6263bc887bc4c4a23f1db4e8582da81.tar.gz emacs-e1e419ecc6263bc887bc4c4a23f1db4e8582da81.zip | |
(merge_named_face): GCPRO the face_name in the
named_merge_point struct that we make.
(merge_face_heights): Eliminate GCPRO arg. All callers changed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfaces.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index 8f604e33cce..1e0de77ea3b 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -3432,8 +3432,8 @@ set_lface_from_font_name (f, lface, fontname, force_p, may_fail_p) | |||
| 3432 | call into lisp. */ | 3432 | call into lisp. */ |
| 3433 | 3433 | ||
| 3434 | Lisp_Object | 3434 | Lisp_Object |
| 3435 | merge_face_heights (from, to, invalid, gcpro) | 3435 | merge_face_heights (from, to, invalid) |
| 3436 | Lisp_Object from, to, invalid, gcpro; | 3436 | Lisp_Object from, to, invalid; |
| 3437 | { | 3437 | { |
| 3438 | Lisp_Object result = invalid; | 3438 | Lisp_Object result = invalid; |
| 3439 | 3439 | ||
| @@ -3458,16 +3458,11 @@ merge_face_heights (from, to, invalid, gcpro) | |||
| 3458 | /* Call function with current height as argument. | 3458 | /* Call function with current height as argument. |
| 3459 | From is the new height. */ | 3459 | From is the new height. */ |
| 3460 | Lisp_Object args[2]; | 3460 | Lisp_Object args[2]; |
| 3461 | struct gcpro gcpro1; | ||
| 3462 | |||
| 3463 | GCPRO1 (gcpro); | ||
| 3464 | 3461 | ||
| 3465 | args[0] = from; | 3462 | args[0] = from; |
| 3466 | args[1] = to; | 3463 | args[1] = to; |
| 3467 | result = safe_call (2, args); | 3464 | result = safe_call (2, args); |
| 3468 | 3465 | ||
| 3469 | UNGCPRO; | ||
| 3470 | |||
| 3471 | /* Ensure that if TO was absolute, so is the result. */ | 3466 | /* Ensure that if TO was absolute, so is the result. */ |
| 3472 | if (INTEGERP (to) && !INTEGERP (result)) | 3467 | if (INTEGERP (to) && !INTEGERP (result)) |
| 3473 | result = invalid; | 3468 | result = invalid; |
| @@ -3520,8 +3515,7 @@ merge_face_vectors (f, from, to, named_merge_points) | |||
| 3520 | if (!UNSPECIFIEDP (from[i])) | 3515 | if (!UNSPECIFIEDP (from[i])) |
| 3521 | { | 3516 | { |
| 3522 | if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i])) | 3517 | if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i])) |
| 3523 | to[i] = merge_face_heights (from[i], to[i], to[i], | 3518 | to[i] = merge_face_heights (from[i], to[i], to[i]); |
| 3524 | named_merge_points); | ||
| 3525 | else | 3519 | else |
| 3526 | to[i] = from[i]; | 3520 | to[i] = from[i]; |
| 3527 | } | 3521 | } |
| @@ -3548,11 +3542,16 @@ merge_named_face (f, face_name, to, named_merge_points) | |||
| 3548 | if (push_named_merge_point (&named_merge_point, | 3542 | if (push_named_merge_point (&named_merge_point, |
| 3549 | face_name, &named_merge_points)) | 3543 | face_name, &named_merge_points)) |
| 3550 | { | 3544 | { |
| 3545 | struct gcpro gcpro1; | ||
| 3551 | Lisp_Object from[LFACE_VECTOR_SIZE]; | 3546 | Lisp_Object from[LFACE_VECTOR_SIZE]; |
| 3552 | int ok = get_lface_attributes (f, face_name, from, 0); | 3547 | int ok = get_lface_attributes (f, face_name, from, 0); |
| 3553 | 3548 | ||
| 3554 | if (ok) | 3549 | if (ok) |
| 3555 | merge_face_vectors (f, from, to, named_merge_points); | 3550 | { |
| 3551 | GCPRO1 (named_merge_point.face_name); | ||
| 3552 | merge_face_vectors (f, from, to, named_merge_points); | ||
| 3553 | UNGCPRO; | ||
| 3554 | } | ||
| 3556 | 3555 | ||
| 3557 | return ok; | 3556 | return ok; |
| 3558 | } | 3557 | } |
| @@ -3643,8 +3642,7 @@ merge_face_ref (f, face_ref, to, err_msgs, named_merge_points) | |||
| 3643 | else if (EQ (keyword, QCheight)) | 3642 | else if (EQ (keyword, QCheight)) |
| 3644 | { | 3643 | { |
| 3645 | Lisp_Object new_height = | 3644 | Lisp_Object new_height = |
| 3646 | merge_face_heights (value, to[LFACE_HEIGHT_INDEX], | 3645 | merge_face_heights (value, to[LFACE_HEIGHT_INDEX], Qnil); |
| 3647 | Qnil, Qnil); | ||
| 3648 | 3646 | ||
| 3649 | if (! NILP (new_height)) | 3647 | if (! NILP (new_height)) |
| 3650 | to[LFACE_HEIGHT_INDEX] = new_height; | 3648 | to[LFACE_HEIGHT_INDEX] = new_height; |
| @@ -4031,7 +4029,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 4031 | /* The default face must have an absolute size, | 4029 | /* The default face must have an absolute size, |
| 4032 | otherwise, we do a test merge with a random | 4030 | otherwise, we do a test merge with a random |
| 4033 | height to see if VALUE's ok. */ | 4031 | height to see if VALUE's ok. */ |
| 4034 | : merge_face_heights (value, make_number (10), Qnil, Qnil)); | 4032 | : merge_face_heights (value, make_number (10), Qnil)); |
| 4035 | 4033 | ||
| 4036 | if (!INTEGERP (test) || XINT (test) <= 0) | 4034 | if (!INTEGERP (test) || XINT (test) <= 0) |
| 4037 | signal_error ("Invalid face height", value); | 4035 | signal_error ("Invalid face height", value); |
| @@ -4737,7 +4735,7 @@ the result will be absolute, otherwise it will be relative. */) | |||
| 4737 | if (EQ (value1, Qunspecified)) | 4735 | if (EQ (value1, Qunspecified)) |
| 4738 | return value2; | 4736 | return value2; |
| 4739 | else if (EQ (attribute, QCheight)) | 4737 | else if (EQ (attribute, QCheight)) |
| 4740 | return merge_face_heights (value1, value2, value1, Qnil); | 4738 | return merge_face_heights (value1, value2, value1); |
| 4741 | else | 4739 | else |
| 4742 | return value1; | 4740 | return value1; |
| 4743 | } | 4741 | } |