diff options
| author | Kim F. Storm | 2008-02-27 22:52:56 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2008-02-27 22:52:56 +0000 |
| commit | a6fa701eb167558fad7cfcc12951222665f92635 (patch) | |
| tree | 7ba7e266390f662bfde808032da497a4e1486d2e /src | |
| parent | f4d953fcbce96331d8a8aa73b7020de0f5f92ba2 (diff) | |
| download | emacs-a6fa701eb167558fad7cfcc12951222665f92635.tar.gz emacs-a6fa701eb167558fad7cfcc12951222665f92635.zip | |
(get_next_display_element, next_element_from_display_vector):
Adapt to new glyph type and new glyph code encoding.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 6876f16d45e..cc8c4277cac 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -5809,29 +5809,29 @@ get_next_display_element (it) | |||
| 5809 | can be defined in the display table. Fill | 5809 | can be defined in the display table. Fill |
| 5810 | IT->ctl_chars with glyphs for what we have to | 5810 | IT->ctl_chars with glyphs for what we have to |
| 5811 | display. Then, set IT->dpvec to these glyphs. */ | 5811 | display. Then, set IT->dpvec to these glyphs. */ |
| 5812 | GLYPH g; | 5812 | Lisp_Object gc; |
| 5813 | int ctl_len; | 5813 | int ctl_len; |
| 5814 | int face_id, lface_id = 0 ; | 5814 | int face_id, lface_id = 0 ; |
| 5815 | GLYPH escape_glyph; | 5815 | int escape_glyph; |
| 5816 | 5816 | ||
| 5817 | /* Handle control characters with ^. */ | 5817 | /* Handle control characters with ^. */ |
| 5818 | 5818 | ||
| 5819 | if (it->c < 128 && it->ctl_arrow_p) | 5819 | if (it->c < 128 && it->ctl_arrow_p) |
| 5820 | { | 5820 | { |
| 5821 | int g; | ||
| 5822 | |||
| 5821 | g = '^'; /* default glyph for Control */ | 5823 | g = '^'; /* default glyph for Control */ |
| 5822 | /* Set IT->ctl_chars[0] to the glyph for `^'. */ | 5824 | /* Set IT->ctl_chars[0] to the glyph for `^'. */ |
| 5823 | if (it->dp | 5825 | if (it->dp |
| 5824 | && INTEGERP (DISP_CTRL_GLYPH (it->dp)) | 5826 | && (gc = DISP_CTRL_GLYPH (it->dp), GLYPH_CODE_P (gc)) |
| 5825 | && GLYPH_CHAR_VALID_P (XINT (DISP_CTRL_GLYPH (it->dp)))) | 5827 | && GLYPH_CODE_CHAR_VALID_P (gc)) |
| 5826 | { | 5828 | { |
| 5827 | g = XINT (DISP_CTRL_GLYPH (it->dp)); | 5829 | g = GLYPH_CODE_CHAR (gc); |
| 5828 | lface_id = FAST_GLYPH_FACE (g); | 5830 | lface_id = GLYPH_CODE_FACE (gc); |
| 5829 | } | 5831 | } |
| 5830 | if (lface_id) | 5832 | if (lface_id) |
| 5831 | { | 5833 | { |
| 5832 | g = FAST_GLYPH_CHAR (g); | 5834 | face_id = merge_faces (it->f, Qt, lface_id, it->face_id); |
| 5833 | face_id = merge_faces (it->f, Qt, lface_id, | ||
| 5834 | it->face_id); | ||
| 5835 | } | 5835 | } |
| 5836 | else if (it->f == last_escape_glyph_frame | 5836 | else if (it->f == last_escape_glyph_frame |
| 5837 | && it->face_id == last_escape_glyph_face_id) | 5837 | && it->face_id == last_escape_glyph_face_id) |
| @@ -5849,8 +5849,7 @@ get_next_display_element (it) | |||
| 5849 | } | 5849 | } |
| 5850 | 5850 | ||
| 5851 | XSETINT (it->ctl_chars[0], g); | 5851 | XSETINT (it->ctl_chars[0], g); |
| 5852 | g = it->c ^ 0100; | 5852 | XSETINT (it->ctl_chars[1], it->c ^ 0100); |
| 5853 | XSETINT (it->ctl_chars[1], g); | ||
| 5854 | ctl_len = 2; | 5853 | ctl_len = 2; |
| 5855 | goto display_control; | 5854 | goto display_control; |
| 5856 | } | 5855 | } |
| @@ -5865,8 +5864,8 @@ get_next_display_element (it) | |||
| 5865 | face_id = merge_faces (it->f, Qnobreak_space, 0, | 5864 | face_id = merge_faces (it->f, Qnobreak_space, 0, |
| 5866 | it->face_id); | 5865 | it->face_id); |
| 5867 | 5866 | ||
| 5868 | g = it->c = ' '; | 5867 | it->c = ' '; |
| 5869 | XSETINT (it->ctl_chars[0], g); | 5868 | XSETINT (it->ctl_chars[0], ' '); |
| 5870 | ctl_len = 1; | 5869 | ctl_len = 1; |
| 5871 | goto display_control; | 5870 | goto display_control; |
| 5872 | } | 5871 | } |
| @@ -5877,17 +5876,16 @@ get_next_display_element (it) | |||
| 5877 | escape_glyph = '\\'; | 5876 | escape_glyph = '\\'; |
| 5878 | 5877 | ||
| 5879 | if (it->dp | 5878 | if (it->dp |
| 5880 | && INTEGERP (DISP_ESCAPE_GLYPH (it->dp)) | 5879 | && (gc = DISP_ESCAPE_GLYPH (it->dp), GLYPH_CODE_P (gc)) |
| 5881 | && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp)))) | 5880 | && GLYPH_CODE_CHAR_VALID_P (gc)) |
| 5882 | { | 5881 | { |
| 5883 | escape_glyph = XFASTINT (DISP_ESCAPE_GLYPH (it->dp)); | 5882 | escape_glyph = GLYPH_CODE_CHAR (gc); |
| 5884 | lface_id = FAST_GLYPH_FACE (escape_glyph); | 5883 | lface_id = GLYPH_CODE_FACE (gc); |
| 5885 | } | 5884 | } |
| 5886 | if (lface_id) | 5885 | if (lface_id) |
| 5887 | { | 5886 | { |
| 5888 | /* The display table specified a face. | 5887 | /* The display table specified a face. |
| 5889 | Merge it into face_id and also into escape_glyph. */ | 5888 | Merge it into face_id and also into escape_glyph. */ |
| 5890 | escape_glyph = FAST_GLYPH_CHAR (escape_glyph); | ||
| 5891 | face_id = merge_faces (it->f, Qt, lface_id, | 5889 | face_id = merge_faces (it->f, Qt, lface_id, |
| 5892 | it->face_id); | 5890 | it->face_id); |
| 5893 | } | 5891 | } |
| @@ -5912,8 +5910,8 @@ get_next_display_element (it) | |||
| 5912 | if (EQ (Vnobreak_char_display, Qt) | 5910 | if (EQ (Vnobreak_char_display, Qt) |
| 5913 | && it->c == 0xAD) | 5911 | && it->c == 0xAD) |
| 5914 | { | 5912 | { |
| 5915 | g = it->c = '-'; | 5913 | it->c = '-'; |
| 5916 | XSETINT (it->ctl_chars[0], g); | 5914 | XSETINT (it->ctl_chars[0], '-'); |
| 5917 | ctl_len = 1; | 5915 | ctl_len = 1; |
| 5918 | goto display_control; | 5916 | goto display_control; |
| 5919 | } | 5917 | } |
| @@ -5924,8 +5922,8 @@ get_next_display_element (it) | |||
| 5924 | if (it->c == 0xA0 || it->c == 0xAD) | 5922 | if (it->c == 0xA0 || it->c == 0xAD) |
| 5925 | { | 5923 | { |
| 5926 | XSETINT (it->ctl_chars[0], escape_glyph); | 5924 | XSETINT (it->ctl_chars[0], escape_glyph); |
| 5927 | g = it->c = (it->c == 0xA0 ? ' ' : '-'); | 5925 | it->c = (it->c == 0xA0 ? ' ' : '-'); |
| 5928 | XSETINT (it->ctl_chars[1], g); | 5926 | XSETINT (it->ctl_chars[1], it->c); |
| 5929 | ctl_len = 2; | 5927 | ctl_len = 2; |
| 5930 | goto display_control; | 5928 | goto display_control; |
| 5931 | } | 5929 | } |
| @@ -5961,6 +5959,7 @@ get_next_display_element (it) | |||
| 5961 | 5959 | ||
| 5962 | for (i = 0; i < len; i++) | 5960 | for (i = 0; i < len; i++) |
| 5963 | { | 5961 | { |
| 5962 | int g; | ||
| 5964 | XSETINT (it->ctl_chars[i * 4], escape_glyph); | 5963 | XSETINT (it->ctl_chars[i * 4], escape_glyph); |
| 5965 | /* Insert three more glyphs into IT->ctl_chars for | 5964 | /* Insert three more glyphs into IT->ctl_chars for |
| 5966 | the octal display of the character. */ | 5965 | the octal display of the character. */ |
| @@ -6200,18 +6199,20 @@ static int | |||
| 6200 | next_element_from_display_vector (it) | 6199 | next_element_from_display_vector (it) |
| 6201 | struct it *it; | 6200 | struct it *it; |
| 6202 | { | 6201 | { |
| 6202 | Lisp_Object gc; | ||
| 6203 | |||
| 6203 | /* Precondition. */ | 6204 | /* Precondition. */ |
| 6204 | xassert (it->dpvec && it->current.dpvec_index >= 0); | 6205 | xassert (it->dpvec && it->current.dpvec_index >= 0); |
| 6205 | 6206 | ||
| 6206 | it->face_id = it->saved_face_id; | 6207 | it->face_id = it->saved_face_id; |
| 6207 | 6208 | ||
| 6208 | if (INTEGERP (*it->dpvec) | 6209 | /* KFS: This code used to check ip->dpvec[0] instead of the current element. |
| 6209 | && GLYPH_CHAR_VALID_P (XFASTINT (*it->dpvec))) | 6210 | That seemed totally bogus - so I changed it... */ |
| 6210 | { | ||
| 6211 | GLYPH g; | ||
| 6212 | 6211 | ||
| 6213 | g = XFASTINT (it->dpvec[it->current.dpvec_index]); | 6212 | if ((gc = it->dpvec[it->current.dpvec_index], GLYPH_CODE_P (gc)) |
| 6214 | it->c = FAST_GLYPH_CHAR (g); | 6213 | && GLYPH_CODE_CHAR_VALID_P (gc)) |
| 6214 | { | ||
| 6215 | it->c = GLYPH_CODE_CHAR (gc); | ||
| 6215 | it->len = CHAR_BYTES (it->c); | 6216 | it->len = CHAR_BYTES (it->c); |
| 6216 | 6217 | ||
| 6217 | /* The entry may contain a face id to use. Such a face id is | 6218 | /* The entry may contain a face id to use. Such a face id is |
| @@ -6221,7 +6222,7 @@ next_element_from_display_vector (it) | |||
| 6221 | it->face_id = it->dpvec_face_id; | 6222 | it->face_id = it->dpvec_face_id; |
| 6222 | else | 6223 | else |
| 6223 | { | 6224 | { |
| 6224 | int lface_id = FAST_GLYPH_FACE (g); | 6225 | int lface_id = GLYPH_CODE_FACE (gc); |
| 6225 | if (lface_id > 0) | 6226 | if (lface_id > 0) |
| 6226 | it->face_id = merge_faces (it->f, Qt, lface_id, | 6227 | it->face_id = merge_faces (it->f, Qt, lface_id, |
| 6227 | it->saved_face_id); | 6228 | it->saved_face_id); |