From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Martin Karlsson Newsgroups: gmane.emacs.help Subject: emacs -nw, xterm and 256 colors Date: Tue, 27 Mar 2007 16:54:16 +0200 Message-ID: <86vegmenzb.fsf@soeren.network.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1175087084 11314 80.91.229.12 (28 Mar 2007 13:04:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 28 Mar 2007 13:04:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 28 15:04:27 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HWXpD-0000iI-09 for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Mar 2007 15:04:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HWXrf-00058j-Nw for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Mar 2007 08:06:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HWDGb-0000qL-TD for help-gnu-emacs@gnu.org; Tue, 27 Mar 2007 11:07:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HWDGZ-0000po-NF for help-gnu-emacs@gnu.org; Tue, 27 Mar 2007 11:07:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HWDGZ-0000pj-JL for help-gnu-emacs@gnu.org; Tue, 27 Mar 2007 10:07:19 -0500 Original-Received: from mxfep04.bredband.com ([195.54.107.79]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HWDEC-0006SO-4j for help-gnu-emacs@gnu.org; Tue, 27 Mar 2007 11:04:52 -0400 Original-Received: from ironport.bredband.com ([195.54.107.82] [195.54.107.82]) by mxfep01.bredband.com with ESMTP id <20070327145352.MWNU3634.mxfep01.bredband.com@ironport.bredband.com> for ; Tue, 27 Mar 2007 16:53:52 +0200 Original-Received: from c-38c070d5.010-54-6f72652.cust.bredbandsbolaget.se (HELO soeren.network.lan) ([213.112.192.56]) by ironport.bredband.com with ESMTP/TLS/AES256-SHA; 27 Mar 2007 16:53:51 +0200 Original-Received: from soeren.network.lan (localhost.network.lan [127.0.0.1]) by soeren.network.lan (8.13.8/8.13.8) with ESMTP id l2REsGfa059022 for ; Tue, 27 Mar 2007 16:54:17 +0200 (CEST) (envelope-from martink@sdf.lonestar.org) Original-Received: (from martink@localhost) by soeren.network.lan (8.13.8/8.13.8/Submit) id l2REsGVB059021; Tue, 27 Mar 2007 16:54:16 +0200 (CEST) (envelope-from martink@sdf.lonestar.org) X-Authentication-Warning: soeren.network.lan: martink set sender to martink@sdf.lonestar.org using -f X-URL: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.93 (berkeley-unix) X-detected-kernel: Solaris 8 (1) X-Mailman-Approved-At: Wed, 28 Mar 2007 09:05:38 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:42238 Archived-At: Hello. I'm trying to get `emacs -nw' in xterm to display 256 colors, and so far it's not going well. I only get 8. This (or a very similar) problem was discussed in <87fzic4rqq.fsf@dazed.zeppelin.net> (October 2003, emacs-pretest-bugs@), and in (January 2005, help-gnu-emacs@). My environment: xterm% uname -psr ==> FreeBSD 6.2-RELEASE-p3 i386 xterm% $(which xterm) -v # /usr/ports/x11/xterm # with 256 colors enabled ==> X.Org 6.9.0(225) xterm% $(which emacs) --version | head -1 # /usr/ports/editors/emacs-devel ==> GNU Emacs 22.0.93.1 # linked against X and libXaw3d ; emacs -nw inside xterm system-uses-terminfo C-j ==> t (display-color-cells) C-j ==> 8 M-x list-colors-display RET ==> black black #000000 red red #cd0000 green green #00cd00 yellow yellow #cdcd00 blue blue #0000ee magenta magenta #cd00cd cyan cyan #00cdcd white white #e5e5e5 (getenv "TERMCAP") C-j ==> "xterm-256color|xterm alias 3:k1=\\EOP:k2=\\EOQ: [...]" xterm% echo $TERM ==> xterm-256color # set in ~/.Xdefaults # (XTerm*termName: xterm-256color) xterm% ./256colors2.pl # ==> (the "correct" output) xterm% infocmp xterm-256color # /usr/ports/devel/ncurses ==> # Reconstructed via infocmp from file: \ /usr/local/share/misc/terminfo.db xterm-256color|xterm with 256 colors, am, bce, ccc, km, mc5i, mir, msgr, npc, xenl, colors#256, cols#80, it#8, lines#24, pairs#32767, ... (weird spacing and line-breaks due to formatting for this message) On a whim, I changed line 373 of [...]/share/emacs/22.0.93/lisp/term/xterm.el(.gz) to read: "(let* ((ncolors 256)" and later to read: "(let* ((ncolors 88)" instead of: "(let* ((ncolors (display-color-cells))" In the 256-colors case, emacs tells me "Unsupported number of xterm colors (256)" in the echo area (and I'm not surprised, me and math don't mix very well, so the value 256 may very well be wrong). In the 88-colors case, `M-x list-colors-display' outputs: ==> black black 0000 red red #cd0000 green green #00cd00 yellow yellow #cdcd00 blue blue #0000ee magenta magenta #cd00cd cyan cyan #00cdcd white white #e5e5e5 brightblack brightblack #7f7f7f brightred brightred #ff0000 brightgreen brightgreen #00ff00 brightyellow brightyellow #ffff00 brightblue brightblue #5c5cff brightmagenta brightmagenta #ff00ff brightcyan brightcyan #00ffff brightwhite brightwhite #ffffff color-16 color-16 #000000 color-17 color-17 #00008b ... ... ... color-87 color-87 #e7e7e7 Only the "usual" colors (up to and including "white"), however, are actually colorized by emacs. For the 88-colors case, the output of "M-x open-termscript RET" followed by "M-x list-colors-display RET" can be found at I'm not at all sure what to make of all this. My working theory is that it's more of a user problem, than an emacs\|terminfo\|xterm problem -- in any case, I'd appreciate feedback and help. If the fix for my problem was mentioned in the the threads I mentioned above, I didn't understand it. My apologies. Regards, -- Martin Karlsson