From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: xterm-256color and face colors Date: Sat, 12 Dec 2009 18:51:33 -0800 (PST) Message-ID: <200912130251.nBD2pXY6009864@godzilla.ics.uci.edu> References: <87638bai90.fsf@kobe.laptop> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1260672818 26469 80.91.229.12 (13 Dec 2009 02:53:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Dec 2009 02:53:38 +0000 (UTC) Cc: emacs-devel@gnu.org To: Giorgos Keramidas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 13 03:53:31 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NJeaQ-0005Zt-8c for ged-emacs-devel@m.gmane.org; Sun, 13 Dec 2009 03:53:31 +0100 Original-Received: from localhost ([127.0.0.1]:54081 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJeaP-0005XL-Jq for ged-emacs-devel@m.gmane.org; Sat, 12 Dec 2009 21:53:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NJeaL-0005We-7m for emacs-devel@gnu.org; Sat, 12 Dec 2009 21:53:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NJeaG-0005TC-Pe for emacs-devel@gnu.org; Sat, 12 Dec 2009 21:53:24 -0500 Original-Received: from [199.232.76.173] (port=45193 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJeaG-0005T3-Gb for emacs-devel@gnu.org; Sat, 12 Dec 2009 21:53:20 -0500 Original-Received: from paul-mcgann-v0.ics.uci.edu ([128.195.1.147]:33590) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NJeaF-0000PW-U6 for emacs-devel@gnu.org; Sat, 12 Dec 2009 21:53:20 -0500 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by paul-mcgann-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id nBD2pYkv010803 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 12 Dec 2009 18:51:34 -0800 Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id nBD2pXY6009864; Sat, 12 Dec 2009 18:51:33 -0800 (PST) In-Reply-To: <87638bai90.fsf@kobe.laptop> (Giorgos Keramidas's message of "Sun, 13 Dec 2009 01:24:11 +0200") Original-Lines: 75 X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: nBD2pYkv010803 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:118580 Archived-At: Giorgos Keramidas writes: > Hi all, > > The version of Emacs I am currently running is ``GNU Emacs 23.1.90.1 > (i386-unknown-freebsd9.0, GTK+ Version 2.18.4) of 2009-12-11 on kobe'', > built from a Git snapshot a couple of days ago. > > A recent update to FreeBSD synchronized our termcap database entries for > "xterm*" terminals with the one in xterm's source distribution. This > was the first step towards making Emacs really support more than 8 color > cells in xterm windows under FreeBSD. > > Unfortunately this seems to have broken many face-colors that use X11 > names in their face attributes. With the current termcap database of > FreeBSD using a TERM value of "xterm" causes Emacs to fall back to 8 > color cells, but most of the faces map into these color cells correctly. > The result is similar to the attached "emacs-23-xterm.png" screenshot, > also available at: > > http://people.freebsd.org/~keramida/emacs-xterm256/emacs-23-xterm.png > > Using a TERM value of "xterm-256color", on the other hand, causes Emacs > to have 256 color cells, but font-locking fails to pick up the color > definitions of many font faces, resulting in no color at all for those > faces. For example the same `M-x ielm' session does not highlight > strings with any color at all. The result is similar to the attached > "emacs-23-xterm-256color.png" screenshot, also available at: > > http://people.freebsd.org/~keramida/emacs-xterm256/emacs-23-xterm-256color.png Emacs considers xterm to have a light background by default, and it chooses face colors based on that. So first step in getting this solved you want to start "xterm -bg white -fg black". > Trying `M-x customize-face RET font-lock-string-face RET' shows that > strings should be using "LightSalmon" as their color, but the sample > text near the color definition uses no color at all. The screenshot > attached as "emacs-23-xterm-256color-string-face.png" shows this, and is > also available online at: > > http://people.freebsd.org/~keramida/emacs-xterm256/emacs-23-xterm-256color-string-face.png This looks like a problem with xterm or the termcap/terminfo settings. Emacs things that there are 256 colors, but when it tries to use them they don't work correctly. Check if xterm is compiled with 256 colors support, there's a script in the xterm sources called 256colors2.pl, run it and see if you can get many colors displayed. Also try $ tput setaf 21 it should change the foreground to blue #0000ff $ tput setab 196 it should change the background to red #ff0000 > The list of face-colors from `M-x list-colors-display' shows 256 colors > when TERM="xterm-256color" but the colors upwards of slot 16 are all > unnamed, as in the attached "emacs-23-xterm-256color-list.png" > screenshot, also available at: > > http://people.freebsd.org/~keramida/emacs-xterm256/emacs-23-xterm-256color-list.png > > I see that `color-name-rgb-alist' is populated with a list of X11 color > names, but these names are not used at all for face colors in xterm > windows that have TERM="xterm-256color". Any ideas how I can make Emacs > use the already loaded colors from `color-name-rgb-alist' to populate > the 256 available color cells? That's not done. But faces can still use any color name in `color-name-rgb-alist', and the color get mapped to one of the 256 colors available.