diff options
| author | Eli Zaretskii | 1999-12-19 11:22:35 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 1999-12-19 11:22:35 +0000 |
| commit | 3b6207313b75639a5f230b1708e59b9eaef39c2d (patch) | |
| tree | 9c1f00ae97eaab411816fd778f5bf0d0cefd65a6 /src | |
| parent | a9c810bf47407b52171c219c593d0fc2fdf3ca54 (diff) | |
| download | emacs-3b6207313b75639a5f230b1708e59b9eaef39c2d.tar.gz emacs-3b6207313b75639a5f230b1708e59b9eaef39c2d.zip | |
(IT_set_face): Don't swap face colors when highlight or
fp->tty_reverse_p is set, unless the computed colors are identical
to frame colors. Print both original and computed colors to
termscript file.
(IT_write_glyphs): Track the changes in handling of composite
characters.
(IT_set_frame_parameters): Don't set frame colors from
unspecified-fg and unspecified-bg pseudo-colors.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/msdos.c | 66 |
2 files changed, 48 insertions, 29 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3230c85951f..4a3e51dcbd3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 1999-12-19 Eli Zaretskii <eliz@is.elta.co.il> | ||
| 2 | |||
| 3 | * msdos.c (IT_set_face): Don't swap face colors when highlight or | ||
| 4 | fp->tty_reverse_p is set, unless the computed colors are identical | ||
| 5 | to frame colors. Print both original and computed colors to | ||
| 6 | termscript file. | ||
| 7 | (IT_write_glyphs): Track the changes in handling of composite | ||
| 8 | characters. | ||
| 9 | (IT_set_frame_parameters): Don't set frame colors from | ||
| 10 | unspecified-fg and unspecified-bg pseudo-colors. | ||
| 11 | |||
| 1 | 1999-12-17 Dave Love <fx@gnu.org> | 12 | 1999-12-17 Dave Love <fx@gnu.org> |
| 2 | 13 | ||
| 3 | * data.c (Fkeywordp): New function. | 14 | * data.c (Fkeywordp): New function. |
diff --git a/src/msdos.c b/src/msdos.c index 1856b6ed656..21d72623127 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -679,25 +679,34 @@ IT_set_face (int face) | |||
| 679 | fg = fp->foreground; | 679 | fg = fp->foreground; |
| 680 | bg = fp->background; | 680 | bg = fp->background; |
| 681 | 681 | ||
| 682 | /* Don't use invalid colors. In particular, a color of -1 means use | 682 | /* Don't use invalid colors. In particular, FACE_TTY_DEFAULT_* |
| 683 | the colors of the default face, except that if highlight is on, | 683 | colors mean use the colors of the default face, except that if |
| 684 | invert the foreground and the background. Note that we assume | 684 | highlight is on, invert the foreground and the background. Note |
| 685 | all 16 colors to be available for the background, since Emacs | 685 | that we assume all 16 colors to be available for the background, |
| 686 | switches on this mode (and loses the blinking attribute) at | 686 | since Emacs switches on this mode (and loses the blinking |
| 687 | startup. */ | 687 | attribute) at startup. */ |
| 688 | if (fg == FACE_TTY_DEFAULT_COLOR || fg == FACE_TTY_DEFAULT_FG_COLOR) | 688 | if (fg == FACE_TTY_DEFAULT_COLOR || fg == FACE_TTY_DEFAULT_FG_COLOR) |
| 689 | fg = highlight || fp->tty_reverse_p ? FRAME_BACKGROUND_PIXEL (sf) | 689 | fg = FRAME_FOREGROUND_PIXEL (sf); |
| 690 | : FRAME_FOREGROUND_PIXEL (sf); | ||
| 691 | else if (fg == FACE_TTY_DEFAULT_BG_COLOR) | 690 | else if (fg == FACE_TTY_DEFAULT_BG_COLOR) |
| 692 | fg = highlight ? FRAME_FOREGROUND_PIXEL (sf) : FRAME_BACKGROUND_PIXEL (sf); | 691 | fg = FRAME_BACKGROUND_PIXEL (sf); |
| 693 | if (bg == FACE_TTY_DEFAULT_COLOR || fg == FACE_TTY_DEFAULT_BG_COLOR) | 692 | if (bg == FACE_TTY_DEFAULT_COLOR || bg == FACE_TTY_DEFAULT_BG_COLOR) |
| 694 | bg = highlight || fp->tty_reverse_p ? FRAME_FOREGROUND_PIXEL (sf) | 693 | bg = FRAME_BACKGROUND_PIXEL (sf); |
| 695 | : FRAME_BACKGROUND_PIXEL (sf); | ||
| 696 | else if (bg == FACE_TTY_DEFAULT_FG_COLOR) | 694 | else if (bg == FACE_TTY_DEFAULT_FG_COLOR) |
| 697 | fg = highlight ? FRAME_BACKGROUND_PIXEL (sf) : FRAME_FOREGROUND_PIXEL (sf); | 695 | bg = FRAME_FOREGROUND_PIXEL (sf); |
| 696 | |||
| 697 | /* Make sure highlighted lines really stand out, come what may. */ | ||
| 698 | if ((highlight || fp->tty_reverse_p) | ||
| 699 | && (fg == FRAME_FOREGROUND_PIXEL (sf) | ||
| 700 | && bg == FRAME_BACKGROUND_PIXEL (sf))) | ||
| 701 | { | ||
| 702 | unsigned long tem = fg; | ||
| 703 | |||
| 704 | fg = bg; | ||
| 705 | bg = tem; | ||
| 706 | } | ||
| 698 | if (termscript) | 707 | if (termscript) |
| 699 | fprintf (termscript, "<FACE %d%s: %d/%d>", | 708 | fprintf (termscript, "<FACE %d%s: %d/%d[FG:%d/BG:%d]>", face, |
| 700 | face, highlight ? "H" : "", fp->foreground, fp->background); | 709 | highlight ? "H" : "", fp->foreground, fp->background, fg, bg); |
| 701 | if (fg >= 0 && fg < 16) | 710 | if (fg >= 0 && fg < 16) |
| 702 | { | 711 | { |
| 703 | ScreenAttrib &= 0xf0; | 712 | ScreenAttrib &= 0xf0; |
| @@ -734,7 +743,7 @@ IT_write_glyphs (struct glyph *str, int str_len) | |||
| 734 | = (NILP (current_buffer->enable_multibyte_characters) | 743 | = (NILP (current_buffer->enable_multibyte_characters) |
| 735 | && unibyte_display_via_language_environment); | 744 | && unibyte_display_via_language_environment); |
| 736 | 745 | ||
| 737 | if (str_len == 0) return; | 746 | if (str_len <= 0) return; |
| 738 | 747 | ||
| 739 | screen_buf = screen_bp = alloca (str_len * 2); | 748 | screen_buf = screen_bp = alloca (str_len * 2); |
| 740 | screen_buf_end = screen_buf + str_len * 2; | 749 | screen_buf_end = screen_buf + str_len * 2; |
| @@ -753,7 +762,7 @@ IT_write_glyphs (struct glyph *str, int str_len) | |||
| 753 | while (sl) | 762 | while (sl) |
| 754 | { | 763 | { |
| 755 | int cf, chlen, enclen; | 764 | int cf, chlen, enclen; |
| 756 | unsigned char workbuf[4], *buf; | 765 | unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *buf; |
| 757 | unsigned ch; | 766 | unsigned ch; |
| 758 | register GLYPH g = GLYPH_FROM_CHAR_GLYPH (*str); | 767 | register GLYPH g = GLYPH_FROM_CHAR_GLYPH (*str); |
| 759 | 768 | ||
| @@ -790,14 +799,6 @@ IT_write_glyphs (struct glyph *str, int str_len) | |||
| 790 | : MAKE_GLYPH (sf, '\177', GLYPH_FACE (sf, g)); | 799 | : MAKE_GLYPH (sf, '\177', GLYPH_FACE (sf, g)); |
| 791 | ch = FAST_GLYPH_CHAR (g); | 800 | ch = FAST_GLYPH_CHAR (g); |
| 792 | } | 801 | } |
| 793 | if (COMPOSITE_CHAR_P (ch)) | ||
| 794 | { | ||
| 795 | /* If CH is a composite character, we can display | ||
| 796 | only the first component. */ | ||
| 797 | g = cmpchar_table[COMPOSITE_CHAR_ID (ch)]->glyph[0], | ||
| 798 | ch = GLYPH_CHAR (sf, g); | ||
| 799 | cf = FAST_GLYPH_FACE (g); | ||
| 800 | } | ||
| 801 | 802 | ||
| 802 | /* If the face of this glyph is different from the current | 803 | /* If the face of this glyph is different from the current |
| 803 | screen face, update the screen attribute byte. */ | 804 | screen face, update the screen attribute byte. */ |
| @@ -806,8 +807,11 @@ IT_write_glyphs (struct glyph *str, int str_len) | |||
| 806 | IT_set_face (cf); /* handles invalid faces gracefully */ | 807 | IT_set_face (cf); /* handles invalid faces gracefully */ |
| 807 | 808 | ||
| 808 | if (GLYPH_SIMPLE_P (tbase, tlen, g)) | 809 | if (GLYPH_SIMPLE_P (tbase, tlen, g)) |
| 809 | /* We generate the multi-byte form of CH in BUF. */ | 810 | { |
| 810 | chlen = CHAR_STRING (ch, workbuf, buf); | 811 | /* We generate the multi-byte form of CH in WORKBUF. */ |
| 812 | chlen = CHAR_STRING (ch, workbuf); | ||
| 813 | buf = workbuf; | ||
| 814 | } | ||
| 811 | else | 815 | else |
| 812 | { | 816 | { |
| 813 | /* We have a string in Vglyph_table. */ | 817 | /* We have a string in Vglyph_table. */ |
| @@ -1444,7 +1448,9 @@ IT_set_frame_parameters (f, alist) | |||
| 1444 | unsigned long new_color = load_color (f, NULL, val, reverse | 1448 | unsigned long new_color = load_color (f, NULL, val, reverse |
| 1445 | ? LFACE_BACKGROUND_INDEX | 1449 | ? LFACE_BACKGROUND_INDEX |
| 1446 | : LFACE_FOREGROUND_INDEX); | 1450 | : LFACE_FOREGROUND_INDEX); |
| 1447 | if (new_color != ~0) | 1451 | if (new_color != FACE_TTY_DEFAULT_COLOR |
| 1452 | && new_color != FACE_TTY_DEFAULT_FG_COLOR | ||
| 1453 | && new_color != FACE_TTY_DEFAULT_BG_COLOR) | ||
| 1448 | { | 1454 | { |
| 1449 | if (reverse) | 1455 | if (reverse) |
| 1450 | /* FIXME: should the fore-/background of the default | 1456 | /* FIXME: should the fore-/background of the default |
| @@ -1463,7 +1469,9 @@ IT_set_frame_parameters (f, alist) | |||
| 1463 | unsigned long new_color = load_color (f, NULL, val, reverse | 1469 | unsigned long new_color = load_color (f, NULL, val, reverse |
| 1464 | ? LFACE_FOREGROUND_INDEX | 1470 | ? LFACE_FOREGROUND_INDEX |
| 1465 | : LFACE_BACKGROUND_INDEX); | 1471 | : LFACE_BACKGROUND_INDEX); |
| 1466 | if (new_color != ~0) | 1472 | if (new_color != FACE_TTY_DEFAULT_COLOR |
| 1473 | && new_color != FACE_TTY_DEFAULT_FG_COLOR | ||
| 1474 | && new_color != FACE_TTY_DEFAULT_BG_COLOR) | ||
| 1467 | { | 1475 | { |
| 1468 | if (reverse) | 1476 | if (reverse) |
| 1469 | FRAME_FOREGROUND_PIXEL (f) = new_color; | 1477 | FRAME_FOREGROUND_PIXEL (f) = new_color; |