comparison lisp/startup.el @ 42745:00370dd7111e

(command-line): Register the default tty colors even if the terminal doesn't seem to support colors. <tty-long-option-alist>: New option --color. (tty-handle-args): Parse the --color arg.
author Eli Zaretskii <eliz@gnu.org>
date Mon, 14 Jan 2002 13:49:32 +0000
parents 3388d70b1a06
children 987fa2a733e0
comparison
equal deleted inserted replaced
42744:ecb614567352 42745:00370dd7111e
543 (setq submap (cdr submap)))) 543 (setq submap (cdr submap))))
544 (setq define-key-rebound-commands t)) 544 (setq define-key-rebound-commands t))
545 545
546 ;; Command-line options supported by tty's: 546 ;; Command-line options supported by tty's:
547 (defconst tty-long-option-alist 547 (defconst tty-long-option-alist
548 '(("--name" . "-name") 548 '(("--name" . "-name")
549 ("--title" . "-T") 549 ("--title" . "-T")
550 ("--reverse-video" . "-reverse") 550 ("--reverse-video" . "-reverse")
551 ("--foreground-color" . "-fg") 551 ("--foreground-color" . "-fg")
552 ("--background-color" . "-bg"))) 552 ("--background-color" . "-bg")
553 ("--color" . "-color")))
553 554
554 (defconst tool-bar-images-pixel-height 24 555 (defconst tool-bar-images-pixel-height 24
555 "Height in pixels of images in the tool bar.") 556 "Height in pixels of images in the tool bar.")
556 557
557 (defvar tool-bar-originally-present nil 558 (defvar tool-bar-originally-present nil
617 (string= this "-rv") 618 (string= this "-rv")
618 (string= this "-reverse")) 619 (string= this "-reverse"))
619 (setq default-frame-alist 620 (setq default-frame-alist
620 (cons '(reverse . t) 621 (cons '(reverse . t)
621 default-frame-alist))) 622 default-frame-alist)))
623 ((string= this "-color")
624 (if (null argval)
625 (setq argval 8)) ; default --color means 8 ANSI colors
626 (setq default-frame-alist
627 (cons (cons 'tty-color-mode
628 (cond
629 ((numberp argval) argval)
630 ((string-match "-?[0-9]+" argval)
631 (string-to-number argval))
632 (t (intern argval))))
633 default-frame-alist)))
622 (t (setq rest (cons this rest)))))) 634 (t (setq rest (cons this rest))))))
623 (nreverse rest))) 635 (nreverse rest)))
624 636
625 (defun command-line () 637 (defun command-line ()
626 (setq command-line-default-directory default-directory) 638 (setq command-line-default-directory default-directory)
816 (tooltip-mode 1)) 828 (tooltip-mode 1))
817 829
818 ;; Register default TTY colors for the case the terminal hasn't a 830 ;; Register default TTY colors for the case the terminal hasn't a
819 ;; terminal init file. 831 ;; terminal init file.
820 (or (memq window-system '(x w32)) 832 (or (memq window-system '(x w32))
821 (not (tty-display-color-p)) 833 ;; We do this regardles of whether the terminal supports colors
834 ;; or not, since they can switch that support on or off in
835 ;; mid-session by setting the tty-color-mode frame parameter.
822 (let* ((colors (cond ((eq window-system 'pc) 836 (let* ((colors (cond ((eq window-system 'pc)
823 msdos-color-values) 837 msdos-color-values)
824 ((eq system-type 'windows-nt) 838 ((eq system-type 'windows-nt)
825 w32-tty-standard-colors) 839 w32-tty-standard-colors)
826 (t tty-standard-colors))) 840 (t tty-standard-colors)))