emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Background mode


From: Juri Linkov
Subject: Re: Background mode
Date: Tue, 28 Jun 2005 02:55:48 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

I discovered another bug.  On non-window terminals when the background
color of some face is specified, but its foreground is not (and vice versa),
then the inverted face uses the wrong color.  These situations are described
by the following excerpts from the face customization buffer:

1.
             [X] Foreground: blue       (sample)
             [X] Background: unspecified-fg (sample)

Currently this sets the face background to blue, and the foreground
to unspecified-bg, i.e. it inverts the unspecified colors (function
toggle_highlight), but puts the specified color (blue) on the wrong
face attribute.

2.
             [X] Foreground: unspecified-bg (sample)
             [X] Background: blue       (sample)

This sets the foreground to blue, and the background to unspecified-fg.

The patch takes care of these cases and uses the correct colors.

Index: src/term.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/term.c,v
retrieving revision 1.162
diff -c -r1.162 term.c
*** src/term.c  17 Jun 2005 14:08:58 -0000      1.162
--- src/term.c  27 Jun 2005 23:27:14 -0000
***************
*** 2005,2018 ****
  
        if (fg >= 0 && TS_set_foreground)
        {
!         p = tparam (TS_set_foreground, NULL, 0, (int) fg);
          OUTPUT (p);
          xfree (p);
        }
  
        if (bg >= 0 && TS_set_background)
        {
!         p = tparam (TS_set_background, NULL, 0, (int) bg);
          OUTPUT (p);
          xfree (p);
        }
--- 2005,2024 ----
  
        if (fg >= 0 && TS_set_foreground)
        {
!         if (inverse_video || bg == FACE_TTY_DEFAULT_FG_COLOR)
!           p = tparam (TS_set_background, NULL, 0, (int) fg);
!         else
!           p = tparam (TS_set_foreground, NULL, 0, (int) fg);
          OUTPUT (p);
          xfree (p);
        }
  
        if (bg >= 0 && TS_set_background)
        {
!         if (inverse_video || fg == FACE_TTY_DEFAULT_BG_COLOR)
!           p = tparam (TS_set_foreground, NULL, 0, (int) bg);
!         else
!           p = tparam (TS_set_background, NULL, 0, (int) bg);
          OUTPUT (p);
          xfree (p);
        }

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]