all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: teirllm@dms.auburn.edu, emacs-devel@gnu.org
Subject: Re: emacs -q -nw --color=never
Date: Wed, 24 Sep 2003 08:47:04 -0400	[thread overview]
Message-ID: <E1A292u-0004V3-FS@fencepost.gnu.org> (raw)
In-Reply-To: <2914-Mon22Sep2003184812+0300-eliz@elta.co.il>

    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);
    }
}

  parent reply	other threads:[~2003-09-24 12:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-21 18:48 emacs -q -nw --color=never Luc Teirlinck
2003-09-21 19:31 ` emacs and libxml2 (for emacs w3) Nic Ferrier
2003-09-22  9:05   ` Richard Stallman
2003-09-23 11:05     ` Nic Ferrier
2003-09-24  8:41       ` Richard Stallman
2003-09-24 11:14         ` James Clark
2003-09-24 12:42           ` Stefan Monnier
2003-09-24 19:35           ` Nic Ferrier
2003-09-25  5:31             ` James Clark
2003-09-25 23:45   ` Alex Schroeder
2003-09-21 23:02 ` emacs -q -nw --color=never Robert J. Chassell
2003-09-22  9:05 ` Richard Stallman
2003-09-22 16:48   ` Eli Zaretskii
2003-09-22 17:04     ` Eli Zaretskii
2003-09-22 16:47       ` Luc Teirlinck
2003-09-24 12:47     ` Richard Stallman [this message]
2003-09-24 18:35       ` Eli Zaretskii
2003-09-25 23:20         ` Richard Stallman
2003-09-27 12:18           ` Eli Zaretskii
2003-09-28 15:34             ` Richard Stallman
2003-09-28 21:50               ` Eli Zaretskii
2003-09-29 19:31                 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1A292u-0004V3-FS@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=teirllm@dms.auburn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.