From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Mode line faces on ttys Date: Wed, 17 Aug 2005 17:46:46 +0300 Organization: JURTA Message-ID: <87u0hoipt5.fsf@jurta.org> References: <878xz0u3ib.fsf@pacem.orebokech.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1124291536 9295 80.91.229.2 (17 Aug 2005 15:12:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 17 Aug 2005 15:12:16 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 17 17:12:13 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E5PZH-0002PC-LO for ged-emacs-devel@m.gmane.org; Wed, 17 Aug 2005 17:11:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E5Pck-0004lv-Vz for ged-emacs-devel@m.gmane.org; Wed, 17 Aug 2005 11:14:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E5PZ3-0002qa-UF for emacs-devel@gnu.org; Wed, 17 Aug 2005 11:10:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E5PZ1-0002pK-8W for emacs-devel@gnu.org; Wed, 17 Aug 2005 11:10:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E5PWF-0001H9-I8 for emacs-devel@gnu.org; Wed, 17 Aug 2005 11:07:55 -0400 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E5PUh-00015a-It for emacs-devel@gnu.org; Wed, 17 Aug 2005 11:06:19 -0400 Original-Received: from mail.neti.ee (80-235-37-17-dsl.mus.estpak.ee [80.235.37.17]) by Relayhost2.neti.ee (Postfix) with ESMTP id 5D2BE2023; Wed, 17 Aug 2005 17:49:55 +0300 (EEST) Original-To: Romain Francoise In-Reply-To: <878xz0u3ib.fsf@pacem.orebokech.com> (Romain Francoise's message of "Wed, 17 Aug 2005 14:55:24 +0200") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:42182 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:42182 > 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/