diff options
| author | Eli Zaretskii | 1999-08-10 10:43:12 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 1999-08-10 10:43:12 +0000 |
| commit | e30aee93e264629f010d39edd26fbaf7e31a9b1f (patch) | |
| tree | 4c03fb27ec91912c0c11352837401e848956847e | |
| parent | 1697ca3831112a5aa282ecbc1fd59d9bf4ab7867 (diff) | |
| download | emacs-e30aee93e264629f010d39edd26fbaf7e31a9b1f.tar.gz emacs-e30aee93e264629f010d39edd26fbaf7e31a9b1f.zip | |
(IT_set_face): Abort if the default face is not realized
and cached.
(IT_write_glyphs): Reset the screen face to the default face
before writing glyphs.
| -rw-r--r-- | src/msdos.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/msdos.c b/src/msdos.c index b73b8e7a5f7..1cea4af486c 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -670,7 +670,13 @@ IT_set_face (int face) | |||
| 670 | unsigned long fg, bg; | 670 | unsigned long fg, bg; |
| 671 | 671 | ||
| 672 | if (!fp) | 672 | if (!fp) |
| 673 | fp = FACE_FROM_ID (selected_frame, DEFAULT_FACE_ID); | 673 | { |
| 674 | fp = FACE_FROM_ID (selected_frame, DEFAULT_FACE_ID); | ||
| 675 | /* The default face for the frame should always be realized and | ||
| 676 | cached. */ | ||
| 677 | if (!fp) | ||
| 678 | abort (); | ||
| 679 | } | ||
| 674 | screen_face = face; | 680 | screen_face = face; |
| 675 | fg = fp->foreground; | 681 | fg = fp->foreground; |
| 676 | bg = fp->background; | 682 | bg = fp->background; |
| @@ -729,6 +735,13 @@ IT_write_glyphs (struct glyph *str, int str_len) | |||
| 729 | 735 | ||
| 730 | screen_buf = screen_bp = alloca (str_len * 2); | 736 | screen_buf = screen_bp = alloca (str_len * 2); |
| 731 | screen_buf_end = screen_buf + str_len * 2; | 737 | screen_buf_end = screen_buf + str_len * 2; |
| 738 | |||
| 739 | /* Since faces get cached and uncached behind our back, we can't | ||
| 740 | rely on their indices in the cache being consistent across | ||
| 741 | invocations. So always reset the screen face to the default | ||
| 742 | face of the frame, before writing glyphs, and let the glyphs | ||
| 743 | set the right face if it's different from the default. */ | ||
| 744 | IT_set_face (DEFAULT_FACE_ID); | ||
| 732 | 745 | ||
| 733 | /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at | 746 | /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at |
| 734 | the tail. */ | 747 | the tail. */ |