From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: emacs -q -nw --color=never Date: Wed, 24 Sep 2003 08:47:04 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200309211848.h8LImLn02488@raven.dms.auburn.edu> <2914-Mon22Sep2003184812+0300-eliz@elta.co.il> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1064407787 23997 80.91.224.253 (24 Sep 2003 12:49:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 24 Sep 2003 12:49:47 +0000 (UTC) Cc: teirllm@dms.auburn.edu, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Sep 24 14:49:44 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A295U-00057e-00 for ; Wed, 24 Sep 2003 14:49:44 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1A29CD-0004PY-00 for ; Wed, 24 Sep 2003 14:56:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A293f-0003Ix-AC for emacs-devel@quimby.gnus.org; Wed, 24 Sep 2003 08:47:51 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 1A293a-0003If-Fv for emacs-devel@gnu.org; Wed, 24 Sep 2003 08:47:46 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 1A293Z-0003IJ-19 for emacs-devel@gnu.org; Wed, 24 Sep 2003 08:47:45 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A293Y-0003IA-R9 for emacs-devel@gnu.org; Wed, 24 Sep 2003 08:47:44 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.20) id 1A292u-0004V3-FS; Wed, 24 Sep 2003 08:47:04 -0400 Original-To: Eli Zaretskii In-reply-to: <2914-Mon22Sep2003184812+0300-eliz@elta.co.il> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:16600 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16600 I did debug this a bit. AFAICS, this happens because this code in line 2130 of term.c: NATNUMP (color_mode) evaluates to zero (i.e. false) when the value of color_mode is -1. I see you made some changes that would fix this bug, but there are other bugs too. What do you think of this version? void set_tty_color_mode (f, val) struct frame *f; Lisp_Object val; { Lisp_Object color_mode_spec, current_mode_spec; Lisp_Object color_mode, current_mode; int mode, old_mode; extern Lisp_Object Qtty_color_mode; Lisp_Object tty_color_mode_alist; tty_color_mode_alist = Fintern_soft (build_string ("tty-color-mode-alist"), Qnil); if (INTEGERP (val)) color_mode = val; else { if (NILP (tty_color_mode_alist)) color_mode_spec = Qnil; else color_mode_spec = Fassq (val, XSYMBOL (tty_color_mode_alist)->value); if (CONSP (color_mode_spec)) color_mode = XCDR (color_mode_spec); else color_mode = Qnil; } current_mode_spec = assq_no_quit (Qtty_color_mode, f->param_alist); if (CONSP (current_mode_spec)) current_mode = XCDR (current_mode_spec); else current_mode = Qnil; if (INTEGERP (color_mode)) mode = XINT (color_mode); else mode = 0; /* meaning default */ /* Canonicalize negative numbers to -1. */ if (mode < 0) mode = -1; if (INTEGERP (current_mode)) old_mode = XINT (current_mode); else old_mode = 0; if (mode != old_mode) { tty_setup_colors (mode); /* This recomputes all the faces given the new color definitions. */ call0 (intern ("tty-set-up-initial-frame-faces")); redraw_frame (f); } }