aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-08-11 01:18:29 +0000
committerRichard M. Stallman1997-08-11 01:18:29 +0000
commitc13c88d74dc71fe00c22eb81bf887cc7d193ce55 (patch)
treefe20c4dea91fb2360a060502183b84aa8eabf5e7
parent83d1d58cbfaa6ddcce035873a04646855f0eca98 (diff)
downloademacs-c13c88d74dc71fe00c22eb81bf887cc7d193ce55.tar.gz
emacs-c13c88d74dc71fe00c22eb81bf887cc7d193ce55.zip
(msdos-color-aliases): Remove color names which end with a number.
(msdos-color-translate): Handle color names which end with a number, like gray85 and purple3. (msdos-face-setup): Call `face-set-after-frame-default', so default faces are correctly set. Do not set background of the region face (it is set by `face-set-after-frame-default').
-rw-r--r--lisp/term/pc-win.el38
1 files changed, 27 insertions, 11 deletions
diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el
index 8ee6a0b88de..a29c14920bf 100644
--- a/lisp/term/pc-win.el
+++ b/lisp/term/pc-win.el
@@ -131,9 +131,6 @@
131 ("light gray" . "lightgray") 131 ("light gray" . "lightgray")
132 ("gray" . "darkgray") 132 ("gray" . "darkgray")
133 ("grey" . "darkgray") 133 ("grey" . "darkgray")
134 ("gray80" . "darkgray")
135 ("gray50" . "black")
136 ("gray90" . "darkgray")
137 ("khaki" . "green") 134 ("khaki" . "green")
138 ("maroon" . "red") 135 ("maroon" . "red")
139 ("orange" . "brown") 136 ("orange" . "brown")
@@ -165,7 +162,6 @@
165 ("greenyellow" . "yellow") 162 ("greenyellow" . "yellow")
166 ("purple" . "magenta") 163 ("purple" . "magenta")
167 ("royalblue" . "blue") 164 ("royalblue" . "blue")
168 ("grey40" . "darkgray")
169 ("rosybrown" . "brown") 165 ("rosybrown" . "brown")
170 ("rosy brown" . "brown") 166 ("rosy brown" . "brown")
171 ("beige" . "brown")) 167 ("beige" . "brown"))
@@ -200,7 +196,26 @@
200 (msdos-color-translate (substring name 4))) 196 (msdos-color-translate (substring name 4)))
201 (and (> len 5) 197 (and (> len 5)
202 (string= "dark " (substring name 0 5)) 198 (string= "dark " (substring name 0 5))
203 (msdos-color-translate (substring name 5)))))) 199 (msdos-color-translate (substring name 5)))
200 (and (> len 4) ;; gray shades: gray0 to gray100
201 (save-match-data
202 (and
203 (string-match "gr[ae]y[0-9]" name)
204 (string-match "[0-9]+\\'" name)
205 (let ((num (string-to-int
206 (substring name (match-beginning 0)))))
207 (msdos-color-translate
208 (cond
209 ((> num 90) "white")
210 ((> num 50) "lightgray")
211 ((> num 10) "darkgray")
212 (t "black")))))))
213 (and (> len 1) ;; purple1 to purple4 and the like
214 (save-match-data
215 (and
216 (string-match "[1-4]\\'" name)
217 (msdos-color-translate
218 (substring name 0 (match-beginning 0)))))))))
204;; --------------------------------------------------------------------------- 219;; ---------------------------------------------------------------------------
205;; We want to delay setting frame parameters until the faces are setup 220;; We want to delay setting frame parameters until the faces are setup
206(defvar default-frame-alist nil) 221(defvar default-frame-alist nil)
@@ -217,11 +232,16 @@
217(defun msdos-face-setup () 232(defun msdos-face-setup ()
218 (modify-frame-parameters terminal-frame default-frame-alist) 233 (modify-frame-parameters terminal-frame default-frame-alist)
219 234
235 (modify-frame-parameters terminal-frame
236 (list (cons 'background-mode
237 (msdos-bg-mode terminal-frame))
238 (cons 'display-type 'color)))
239 (face-set-after-frame-default terminal-frame)
240
220 (set-face-foreground 'bold "yellow" terminal-frame) 241 (set-face-foreground 'bold "yellow" terminal-frame)
221 (set-face-foreground 'italic "red" terminal-frame) 242 (set-face-foreground 'italic "red" terminal-frame)
222 (set-face-foreground 'bold-italic "lightred" terminal-frame) 243 (set-face-foreground 'bold-italic "lightred" terminal-frame)
223 (set-face-foreground 'underline "white" terminal-frame) 244 (set-face-foreground 'underline "white" terminal-frame)
224 (set-face-background 'region "green" terminal-frame)
225 245
226 (make-face 'msdos-menu-active-face) 246 (make-face 'msdos-menu-active-face)
227 (make-face 'msdos-menu-passive-face) 247 (make-face 'msdos-menu-passive-face)
@@ -230,11 +250,7 @@
230 (set-face-foreground 'msdos-menu-passive-face "lightgray" terminal-frame) 250 (set-face-foreground 'msdos-menu-passive-face "lightgray" terminal-frame)
231 (set-face-background 'msdos-menu-active-face "blue" terminal-frame) 251 (set-face-background 'msdos-menu-active-face "blue" terminal-frame)
232 (set-face-background 'msdos-menu-passive-face "blue" terminal-frame) 252 (set-face-background 'msdos-menu-passive-face "blue" terminal-frame)
233 (set-face-background 'msdos-menu-select-face "red" terminal-frame) 253 (set-face-background 'msdos-menu-select-face "red" terminal-frame))
234 (modify-frame-parameters terminal-frame
235 (list (cons 'background-mode
236 (msdos-bg-mode terminal-frame))
237 (cons 'display-type 'color))))
238 254
239;; We have only one font, so... 255;; We have only one font, so...
240(add-hook 'before-init-hook 'msdos-face-setup) 256(add-hook 'before-init-hook 'msdos-face-setup)