# HG changeset patch # User Eli Zaretskii # Date 1011016172 0 # Node ID 00370dd7111e94fd803133b07f6c339d8f15e27a # Parent ecb61456735208aec9433da05e00be8e77d021c2 (command-line): Register the default tty colors even if the terminal doesn't seem to support colors. : New option --color. (tty-handle-args): Parse the --color arg. diff -r ecb614567352 -r 00370dd7111e lisp/startup.el --- a/lisp/startup.el Mon Jan 14 13:47:56 2002 +0000 +++ b/lisp/startup.el Mon Jan 14 13:49:32 2002 +0000 @@ -545,11 +545,12 @@ ;; Command-line options supported by tty's: (defconst tty-long-option-alist - '(("--name" . "-name") - ("--title" . "-T") - ("--reverse-video" . "-reverse") + '(("--name" . "-name") + ("--title" . "-T") + ("--reverse-video" . "-reverse") ("--foreground-color" . "-fg") - ("--background-color" . "-bg"))) + ("--background-color" . "-bg") + ("--color" . "-color"))) (defconst tool-bar-images-pixel-height 24 "Height in pixels of images in the tool bar.") @@ -619,6 +620,17 @@ (setq default-frame-alist (cons '(reverse . t) default-frame-alist))) + ((string= this "-color") + (if (null argval) + (setq argval 8)) ; default --color means 8 ANSI colors + (setq default-frame-alist + (cons (cons 'tty-color-mode + (cond + ((numberp argval) argval) + ((string-match "-?[0-9]+" argval) + (string-to-number argval)) + (t (intern argval)))) + default-frame-alist))) (t (setq rest (cons this rest)))))) (nreverse rest))) @@ -818,7 +830,9 @@ ;; Register default TTY colors for the case the terminal hasn't a ;; terminal init file. (or (memq window-system '(x w32)) - (not (tty-display-color-p)) + ;; We do this regardles of whether the terminal supports colors + ;; or not, since they can switch that support on or off in + ;; mid-session by setting the tty-color-mode frame parameter. (let* ((colors (cond ((eq window-system 'pc) msdos-color-values) ((eq system-type 'windows-nt)