diff options
| author | Richard M. Stallman | 1994-09-29 23:00:43 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-09-29 23:00:43 +0000 |
| commit | 4699e6d2a1a94b81e853c8afd48e652af232e529 (patch) | |
| tree | f711c062c28036d37159c06891ddf7507eaafa57 /src | |
| parent | cb5fbf94a8730473d64738028a3eec0ab73887ee (diff) | |
| download | emacs-4699e6d2a1a94b81e853c8afd48e652af232e529.tar.gz emacs-4699e6d2a1a94b81e853c8afd48e652af232e529.zip | |
(compute_char_face): Handle list as overlay face property.
(compute_char_face): If face text-property is a list,
merge the attributes of the faces in the list.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfaces.c | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index 3ddc6e5f78d..7ac1a400cef 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -864,7 +864,30 @@ compute_char_face (f, w, pos, region_beg, region_end, endptr, limit, mouse) | |||
| 864 | 864 | ||
| 865 | compute_base_face (f, &face); | 865 | compute_base_face (f, &face); |
| 866 | 866 | ||
| 867 | if (!NILP (prop)) | 867 | if (CONSP (prop)) |
| 868 | { | ||
| 869 | /* We have a list of faces, merge them in reverse order */ | ||
| 870 | Lisp_Object length = Flength (prop); | ||
| 871 | int len = XINT (length); | ||
| 872 | Lisp_Object *faces; | ||
| 873 | |||
| 874 | /* Put them into an array */ | ||
| 875 | faces = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); | ||
| 876 | for (j = 0; j < len; j++) | ||
| 877 | { | ||
| 878 | faces[j] = Fcar (prop); | ||
| 879 | prop = Fcdr (prop); | ||
| 880 | } | ||
| 881 | /* So that we can merge them in the reverse order */ | ||
| 882 | for (j = len - 1; j >= 0; j--) | ||
| 883 | { | ||
| 884 | facecode = face_name_id_number (f, faces[j]); | ||
| 885 | if (facecode >= 0 && facecode < FRAME_N_PARAM_FACES (f) | ||
| 886 | && FRAME_PARAM_FACES (f) [facecode] != 0) | ||
| 887 | merge_faces (FRAME_PARAM_FACES (f) [facecode], &face); | ||
| 888 | } | ||
| 889 | } | ||
| 890 | else if (!NILP (prop)) | ||
| 868 | { | 891 | { |
| 869 | facecode = face_name_id_number (f, prop); | 892 | facecode = face_name_id_number (f, prop); |
| 870 | if (facecode >= 0 && facecode < FRAME_N_PARAM_FACES (f) | 893 | if (facecode >= 0 && facecode < FRAME_N_PARAM_FACES (f) |
| @@ -878,7 +901,31 @@ compute_char_face (f, w, pos, region_beg, region_end, endptr, limit, mouse) | |||
| 878 | for (i = 0; i < noverlays; i++) | 901 | for (i = 0; i < noverlays; i++) |
| 879 | { | 902 | { |
| 880 | prop = Foverlay_get (overlay_vec[i], propname); | 903 | prop = Foverlay_get (overlay_vec[i], propname); |
| 881 | if (!NILP (prop)) | 904 | if (CONSP (prop)) |
| 905 | { | ||
| 906 | /* We have a list of faces, merge them in reverse order */ | ||
| 907 | Lisp_Object length = Flength (prop); | ||
| 908 | int len = XINT (length); | ||
| 909 | Lisp_Object *faces; | ||
| 910 | int i; | ||
| 911 | |||
| 912 | /* Put them into an array */ | ||
| 913 | faces = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); | ||
| 914 | for (j = 0; j < len; j++) | ||
| 915 | { | ||
| 916 | faces[j] = Fcar (prop); | ||
| 917 | prop = Fcdr (prop); | ||
| 918 | } | ||
| 919 | /* So that we can merge them in the reverse order */ | ||
| 920 | for (j = len - 1; j >= 0; j--) | ||
| 921 | { | ||
| 922 | facecode = face_name_id_number (f, faces[j]); | ||
| 923 | if (facecode >= 0 && facecode < FRAME_N_PARAM_FACES (f) | ||
| 924 | && FRAME_PARAM_FACES (f) [facecode] != 0) | ||
| 925 | merge_faces (FRAME_PARAM_FACES (f) [facecode], &face); | ||
| 926 | } | ||
| 927 | } | ||
| 928 | else if (!NILP (prop)) | ||
| 882 | { | 929 | { |
| 883 | Lisp_Object oend; | 930 | Lisp_Object oend; |
| 884 | int oendpos; | 931 | int oendpos; |