> Lately I've been seeing some strange behavior of the mode line on ttys, > apparently when you set the foreground of a face to a specific color the > background gets changed but the foreground remains unchanged. > > For example, if you start emacs with `emacs -q -nw' then eval this: > > (set-face-foreground 'mode-line "red") > > then the background of the mode line will go red, but the foreground > will remain black.
This is correct. Since mode-line has the non-nil :inverse-video attribute, its foreground and background colors should be inverted. To see that this behavior is correct, you can try to set both foreground and background colors in an old Emacs, e.g.: (set-face-foreground 'mode-line "red") (set-face-background 'mode-line "green") and see that the mode line is displayed in inverted colors: red is applied to the background, and green - to the foreground. > In the past (try in Emacs 21.4), the background would remain > unchanged and only the foreground would change. > I have an old Emacs image from June 10th where it still works, so the > change happened sometime between then and now... Old Emacs versions were inconsistent: when both foreground and background colors were specified, they became inverted. But when only one of either foreground or background color was specified and another color kept its default color value, colors remained not inverted. The 2005-06-30 change fixes this inconsistency: if one of either foreground or background color is not specified, Emacs now uses the same logic of inversion as in the case if both colors are specified. This fix also provides the behavior for ttys equivalent to X. You can try to eval on X (no matter in an old or new Emacs version): (set-face-inverse-video-p 'mode-line t) (set-face-foreground 'mode-line "red") and see that this behavior is exactly the same as on ttys now. Since this change causes questions, maybe it should be mentioned in etc/NEWS? -- Juri Linkov http://www.jurta.org/emacs/ _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel