aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2002-01-14 13:49:32 +0000
committerEli Zaretskii2002-01-14 13:49:32 +0000
commit8957d2bfe49acd3189ed81ae4f17e7cac2ab601b (patch)
tree9c6d3a3db3ad144587a80d09c813a2ae04d768e9
parentd20e1b1e77e5d0462d0c9773bb54f9fa6facd471 (diff)
downloademacs-8957d2bfe49acd3189ed81ae4f17e7cac2ab601b.tar.gz
emacs-8957d2bfe49acd3189ed81ae4f17e7cac2ab601b.zip
(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.
-rw-r--r--lisp/startup.el24
1 files changed, 19 insertions, 5 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index bc732deb8b5..1fccb6e8791 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -545,11 +545,12 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
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.")
@@ -619,6 +620,17 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
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
@@ -818,7 +830,9 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
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)