diff options
| author | Eli Zaretskii | 2012-03-30 11:45:27 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2012-03-30 11:45:27 +0300 |
| commit | 65a0a738476acb1a7103602ee3e6c041108b6c91 (patch) | |
| tree | e7dcf450ff9dd570c81a9e3ff89cbd8655382f5f /src | |
| parent | 61c6e8fd0ef5423e1b500608747a3b77b0e96ae9 (diff) | |
| download | emacs-65a0a738476acb1a7103602ee3e6c041108b6c91.tar.gz emacs-65a0a738476acb1a7103602ee3e6c041108b6c91.zip | |
Fix bug #11068 with window display when default face was remapped.
src/xdisp.c (append_space_for_newline): If the default face was
remapped, use the remapped face for the appended newline.
(extend_face_to_end_of_line): Use the remapped default face for
extending the face to the end of the line.
(display_line): Call extend_face_to_end_of_line when the default
face was remapped.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 9 | ||||
| -rw-r--r-- | src/xdisp.c | 24 |
2 files changed, 26 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e57b1af1b8b..cbf9abd0ea1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2012-03-30 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (append_space_for_newline): If the default face was | ||
| 4 | remapped, use the remapped face for the appended newline. | ||
| 5 | (extend_face_to_end_of_line): Use the remapped default face for | ||
| 6 | extending the face to the end of the line. | ||
| 7 | (display_line): Call extend_face_to_end_of_line when the default | ||
| 8 | face was remapped. (Bug#11068) | ||
| 9 | |||
| 1 | 2012-03-29 Eli Zaretskii <eliz@gnu.org> | 10 | 2012-03-29 Eli Zaretskii <eliz@gnu.org> |
| 2 | 11 | ||
| 3 | * s/ms-w32.h: Discourage from defining HAVE_GETCWD. | 12 | * s/ms-w32.h: Discourage from defining HAVE_GETCWD. |
diff --git a/src/xdisp.c b/src/xdisp.c index 97364e785cb..118480a20ae 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -18172,8 +18172,10 @@ append_space_for_newline (struct it *it, int default_face_p) | |||
| 18172 | it->c = it->char_to_display = ' '; | 18172 | it->c = it->char_to_display = ' '; |
| 18173 | it->len = 1; | 18173 | it->len = 1; |
| 18174 | 18174 | ||
| 18175 | /* If the default face was remapped, be sure to use the | ||
| 18176 | remapped face for the appended newline. */ | ||
| 18175 | if (default_face_p) | 18177 | if (default_face_p) |
| 18176 | it->face_id = DEFAULT_FACE_ID; | 18178 | it->face_id = lookup_basic_face (it->f, DEFAULT_FACE_ID); |
| 18177 | else if (it->face_before_selective_p) | 18179 | else if (it->face_before_selective_p) |
| 18178 | it->face_id = it->saved_face_id; | 18180 | it->face_id = it->saved_face_id; |
| 18179 | face = FACE_FROM_ID (it->f, it->face_id); | 18181 | face = FACE_FROM_ID (it->f, it->face_id); |
| @@ -18209,7 +18211,7 @@ append_space_for_newline (struct it *it, int default_face_p) | |||
| 18209 | static void | 18211 | static void |
| 18210 | extend_face_to_end_of_line (struct it *it) | 18212 | extend_face_to_end_of_line (struct it *it) |
| 18211 | { | 18213 | { |
| 18212 | struct face *face; | 18214 | struct face *face, *default_face; |
| 18213 | struct frame *f = it->f; | 18215 | struct frame *f = it->f; |
| 18214 | 18216 | ||
| 18215 | /* If line is already filled, do nothing. Non window-system frames | 18217 | /* If line is already filled, do nothing. Non window-system frames |
| @@ -18223,6 +18225,9 @@ extend_face_to_end_of_line (struct it *it) | |||
| 18223 | && !it->glyph_row->continued_p)) | 18225 | && !it->glyph_row->continued_p)) |
| 18224 | return; | 18226 | return; |
| 18225 | 18227 | ||
| 18228 | /* The default face, possibly remapped. */ | ||
| 18229 | default_face = FACE_FROM_ID (f, lookup_basic_face (f, DEFAULT_FACE_ID)); | ||
| 18230 | |||
| 18226 | /* Face extension extends the background and box of IT->face_id | 18231 | /* Face extension extends the background and box of IT->face_id |
| 18227 | to the end of the line. If the background equals the background | 18232 | to the end of the line. If the background equals the background |
| 18228 | of the frame, we don't have to do anything. */ | 18233 | of the frame, we don't have to do anything. */ |
| @@ -18260,7 +18265,7 @@ extend_face_to_end_of_line (struct it *it) | |||
| 18260 | if (it->glyph_row->used[TEXT_AREA] == 0) | 18265 | if (it->glyph_row->used[TEXT_AREA] == 0) |
| 18261 | { | 18266 | { |
| 18262 | it->glyph_row->glyphs[TEXT_AREA][0] = space_glyph; | 18267 | it->glyph_row->glyphs[TEXT_AREA][0] = space_glyph; |
| 18263 | it->glyph_row->glyphs[TEXT_AREA][0].face_id = it->face_id; | 18268 | it->glyph_row->glyphs[TEXT_AREA][0].face_id = face->id; |
| 18264 | it->glyph_row->used[TEXT_AREA] = 1; | 18269 | it->glyph_row->used[TEXT_AREA] = 1; |
| 18265 | } | 18270 | } |
| 18266 | #ifdef HAVE_WINDOW_SYSTEM | 18271 | #ifdef HAVE_WINDOW_SYSTEM |
| @@ -18296,7 +18301,7 @@ extend_face_to_end_of_line (struct it *it) | |||
| 18296 | face, to avoid painting the rest of the window with | 18301 | face, to avoid painting the rest of the window with |
| 18297 | the region face, if the region ends at ZV. */ | 18302 | the region face, if the region ends at ZV. */ |
| 18298 | if (it->glyph_row->ends_at_zv_p) | 18303 | if (it->glyph_row->ends_at_zv_p) |
| 18299 | it->face_id = DEFAULT_FACE_ID; | 18304 | it->face_id = default_face->id; |
| 18300 | else | 18305 | else |
| 18301 | it->face_id = face->id; | 18306 | it->face_id = face->id; |
| 18302 | append_stretch_glyph (it, make_number (0), stretch_width, | 18307 | append_stretch_glyph (it, make_number (0), stretch_width, |
| @@ -18329,7 +18334,7 @@ extend_face_to_end_of_line (struct it *it) | |||
| 18329 | avoid painting the rest of the window with the region face, | 18334 | avoid painting the rest of the window with the region face, |
| 18330 | if the region ends at ZV. */ | 18335 | if the region ends at ZV. */ |
| 18331 | if (it->glyph_row->ends_at_zv_p) | 18336 | if (it->glyph_row->ends_at_zv_p) |
| 18332 | it->face_id = DEFAULT_FACE_ID; | 18337 | it->face_id = default_face->id; |
| 18333 | else | 18338 | else |
| 18334 | it->face_id = face->id; | 18339 | it->face_id = face->id; |
| 18335 | 18340 | ||
| @@ -18993,8 +18998,13 @@ display_line (struct it *it) | |||
| 18993 | /* A row that displays right-to-left text must always have | 18998 | /* A row that displays right-to-left text must always have |
| 18994 | its last face extended all the way to the end of line, | 18999 | its last face extended all the way to the end of line, |
| 18995 | even if this row ends in ZV, because we still write to | 19000 | even if this row ends in ZV, because we still write to |
| 18996 | the screen left to right. */ | 19001 | the screen left to right. We also need to extend the |
| 18997 | if (row->reversed_p) | 19002 | last face if the default face is remapped to some |
| 19003 | different face, otherwise the functions that clear | ||
| 19004 | portions of the screen will clear with the default face's | ||
| 19005 | background color. */ | ||
| 19006 | if (row->reversed_p | ||
| 19007 | || lookup_basic_face (it->f, DEFAULT_FACE_ID) != DEFAULT_FACE_ID) | ||
| 18998 | extend_face_to_end_of_line (it); | 19008 | extend_face_to_end_of_line (it); |
| 18999 | break; | 19009 | break; |
| 19000 | } | 19010 | } |