Mercurial > emacs
comparison src/xfaces.c @ 90044:cb7f41387eb3
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-70
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-669
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-678
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-679
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-680
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-688
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-690
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-691
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-69
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-70
- miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-71
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Fri, 12 Nov 2004 02:53:04 +0000 |
parents | 566253900690 7a44d300ed6f |
children | f2ebccfa87d4 |
comparison
equal
deleted
inserted
replaced
90043:e24e2e78deda | 90044:cb7f41387eb3 |
---|---|
3509 unless both FROM and TO are relative. GCPRO is a lisp value that | 3509 unless both FROM and TO are relative. GCPRO is a lisp value that |
3510 will be protected from garbage-collection if this function makes a | 3510 will be protected from garbage-collection if this function makes a |
3511 call into lisp. */ | 3511 call into lisp. */ |
3512 | 3512 |
3513 Lisp_Object | 3513 Lisp_Object |
3514 merge_face_heights (from, to, invalid, gcpro) | 3514 merge_face_heights (from, to, invalid) |
3515 Lisp_Object from, to, invalid, gcpro; | 3515 Lisp_Object from, to, invalid; |
3516 { | 3516 { |
3517 Lisp_Object result = invalid; | 3517 Lisp_Object result = invalid; |
3518 | 3518 |
3519 if (INTEGERP (from)) | 3519 if (INTEGERP (from)) |
3520 /* FROM is absolute, just use it as is. */ | 3520 /* FROM is absolute, just use it as is. */ |
3535 /* FROM is a function, which use to adjust TO. */ | 3535 /* FROM is a function, which use to adjust TO. */ |
3536 { | 3536 { |
3537 /* Call function with current height as argument. | 3537 /* Call function with current height as argument. |
3538 From is the new height. */ | 3538 From is the new height. */ |
3539 Lisp_Object args[2]; | 3539 Lisp_Object args[2]; |
3540 struct gcpro gcpro1; | |
3541 | |
3542 GCPRO1 (gcpro); | |
3543 | 3540 |
3544 args[0] = from; | 3541 args[0] = from; |
3545 args[1] = to; | 3542 args[1] = to; |
3546 result = safe_call (2, args); | 3543 result = safe_call (2, args); |
3547 | |
3548 UNGCPRO; | |
3549 | 3544 |
3550 /* Ensure that if TO was absolute, so is the result. */ | 3545 /* Ensure that if TO was absolute, so is the result. */ |
3551 if (INTEGERP (to) && !INTEGERP (result)) | 3546 if (INTEGERP (to) && !INTEGERP (result)) |
3552 result = invalid; | 3547 result = invalid; |
3553 } | 3548 } |
3597 | 3592 |
3598 for (i = 1; i < LFACE_VECTOR_SIZE; ++i) | 3593 for (i = 1; i < LFACE_VECTOR_SIZE; ++i) |
3599 if (!UNSPECIFIEDP (from[i])) | 3594 if (!UNSPECIFIEDP (from[i])) |
3600 { | 3595 { |
3601 if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i])) | 3596 if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i])) |
3602 to[i] = merge_face_heights (from[i], to[i], to[i], | 3597 to[i] = merge_face_heights (from[i], to[i], to[i]); |
3603 named_merge_points); | |
3604 else | 3598 else |
3605 to[i] = from[i]; | 3599 to[i] = from[i]; |
3606 } | 3600 } |
3607 | 3601 |
3608 /* TO is always an absolute face, which should inherit from nothing. | 3602 /* TO is always an absolute face, which should inherit from nothing. |
3625 struct named_merge_point named_merge_point; | 3619 struct named_merge_point named_merge_point; |
3626 | 3620 |
3627 if (push_named_merge_point (&named_merge_point, | 3621 if (push_named_merge_point (&named_merge_point, |
3628 face_name, &named_merge_points)) | 3622 face_name, &named_merge_points)) |
3629 { | 3623 { |
3624 struct gcpro gcpro1; | |
3630 Lisp_Object from[LFACE_VECTOR_SIZE]; | 3625 Lisp_Object from[LFACE_VECTOR_SIZE]; |
3631 int ok = get_lface_attributes (f, face_name, from, 0); | 3626 int ok = get_lface_attributes (f, face_name, from, 0); |
3632 | 3627 |
3633 if (ok) | 3628 if (ok) |
3634 merge_face_vectors (f, from, to, named_merge_points); | 3629 { |
3630 GCPRO1 (named_merge_point.face_name); | |
3631 merge_face_vectors (f, from, to, named_merge_points); | |
3632 UNGCPRO; | |
3633 } | |
3635 | 3634 |
3636 return ok; | 3635 return ok; |
3637 } | 3636 } |
3638 else | 3637 else |
3639 return 0; | 3638 return 0; |
3720 err = 1; | 3719 err = 1; |
3721 } | 3720 } |
3722 else if (EQ (keyword, QCheight)) | 3721 else if (EQ (keyword, QCheight)) |
3723 { | 3722 { |
3724 Lisp_Object new_height = | 3723 Lisp_Object new_height = |
3725 merge_face_heights (value, to[LFACE_HEIGHT_INDEX], | 3724 merge_face_heights (value, to[LFACE_HEIGHT_INDEX], Qnil); |
3726 Qnil, Qnil); | |
3727 | 3725 |
3728 if (! NILP (new_height)) | 3726 if (! NILP (new_height)) |
3729 to[LFACE_HEIGHT_INDEX] = new_height; | 3727 to[LFACE_HEIGHT_INDEX] = new_height; |
3730 else | 3728 else |
3731 err = 1; | 3729 err = 1; |
4108 test = (EQ (face, Qdefault) | 4106 test = (EQ (face, Qdefault) |
4109 ? value | 4107 ? value |
4110 /* The default face must have an absolute size, | 4108 /* The default face must have an absolute size, |
4111 otherwise, we do a test merge with a random | 4109 otherwise, we do a test merge with a random |
4112 height to see if VALUE's ok. */ | 4110 height to see if VALUE's ok. */ |
4113 : merge_face_heights (value, make_number (10), Qnil, Qnil)); | 4111 : merge_face_heights (value, make_number (10), Qnil)); |
4114 | 4112 |
4115 if (!INTEGERP (test) || XINT (test) <= 0) | 4113 if (!INTEGERP (test) || XINT (test) <= 0) |
4116 signal_error ("Invalid face height", value); | 4114 signal_error ("Invalid face height", value); |
4117 } | 4115 } |
4118 | 4116 |
4822 Lisp_Object attribute, value1, value2; | 4820 Lisp_Object attribute, value1, value2; |
4823 { | 4821 { |
4824 if (EQ (value1, Qunspecified)) | 4822 if (EQ (value1, Qunspecified)) |
4825 return value2; | 4823 return value2; |
4826 else if (EQ (attribute, QCheight)) | 4824 else if (EQ (attribute, QCheight)) |
4827 return merge_face_heights (value1, value2, value1, Qnil); | 4825 return merge_face_heights (value1, value2, value1); |
4828 else | 4826 else |
4829 return value1; | 4827 return value1; |
4830 } | 4828 } |
4831 | 4829 |
4832 | 4830 |