diff options
| author | Eli Zaretskii | 1998-10-14 15:11:12 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 1998-10-14 15:11:12 +0000 |
| commit | a0c712aea8b4860e7912b558ee4a0fd4ac736704 (patch) | |
| tree | cb3252ff3f700c9d040641ea23d33ed0da55547a | |
| parent | bbce7d721d8256f13bcff25553f4412ca912a18c (diff) | |
| download | emacs-a0c712aea8b4860e7912b558ee4a0fd4ac736704.tar.gz emacs-a0c712aea8b4860e7912b558ee4a0fd4ac736704.zip | |
(msdos-color-values): New variable.
(x-color-values): New function, emulates its namesake from src/xfns.c.
(msdos-bg-mode): Add all dark colors to those which return "dark".
| -rw-r--r-- | lisp/term/pc-win.el | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el index 161ab146f1d..2a20dea4527 100644 --- a/lisp/term/pc-win.el +++ b/lisp/term/pc-win.el | |||
| @@ -242,7 +242,11 @@ | |||
| 242 | (let* ((frame (or frame (selected-frame))) | 242 | (let* ((frame (or frame (selected-frame))) |
| 243 | (params (frame-parameters frame)) | 243 | (params (frame-parameters frame)) |
| 244 | (bg (cdr (assq 'background-color params)))) | 244 | (bg (cdr (assq 'background-color params)))) |
| 245 | (if (member bg '("black" "blue" "darkgray" "green")) | 245 | ;; The list of ``dark'' colors should be consistent with |
| 246 | ;; `x-color-values' (below) and the dark/light color | ||
| 247 | ;; decisions `frame-set-background-mode' in lisp/faces.el. | ||
| 248 | (if (member bg | ||
| 249 | '("black" "blue" "green" "red" "magenta" "brown" "darkgray")) | ||
| 246 | 'dark | 250 | 'dark |
| 247 | 'light))) | 251 | 'light))) |
| 248 | 252 | ||
| @@ -312,6 +316,44 @@ | |||
| 312 | (defun x-display-visual-class (&optional frame) 'static-color) | 316 | (defun x-display-visual-class (&optional frame) 'static-color) |
| 313 | (fset 'x-display-save-under 'ignore) | 317 | (fset 'x-display-save-under 'ignore) |
| 314 | (fset 'x-get-resource 'ignore) | 318 | (fset 'x-get-resource 'ignore) |
| 319 | ;;; | ||
| 320 | ;;; This is copied from etc/rgb.txt, except that some values were changed | ||
| 321 | ;;; a bit to make them consistent with DOS console colors. The order of | ||
| 322 | ;;; the colors is according to the PC text mode color codes. | ||
| 323 | ;;; | ||
| 324 | ;;; If you want to change the RGB values, keep in mind that various pieces | ||
| 325 | ;;; of Emacs think that a color whose RGB values add up to less than 0.6 of | ||
| 326 | ;;; the values for WHITE (i.e. less than 459) are ``dark'', otherwise the | ||
| 327 | ;;; color is ``light''; see `frame-set-background-mode' in lisp/faces.el for | ||
| 328 | ;;; an example. | ||
| 329 | (defvar msdos-color-values | ||
| 330 | '(("black" 0 0 0) | ||
| 331 | ("blue" 0 0 255) | ||
| 332 | ("green" 0 255 0) | ||
| 333 | ("cyan" 0 255 255) | ||
| 334 | ("red" 255 0 0) | ||
| 335 | ("magenta" 139 0 139) ; dark magenta | ||
| 336 | ("brown" 165 42 42) | ||
| 337 | ("lightgray" 211 211 211) | ||
| 338 | ("darkgray" 102 102 102) ; gray40 | ||
| 339 | ("lightblue" 173 216 230) | ||
| 340 | ("lightgreen" 144 238 144) | ||
| 341 | ("lightcyan" 224 255 255) | ||
| 342 | ("lightred" 255 52 179) ; maroon1 | ||
| 343 | ("lightmagenta" 238 0 238) ; magenta2 | ||
| 344 | ("yellow" 255 255 0) | ||
| 345 | ("white" 255 255 255)) | ||
| 346 | "A list of MS-DOS console colors and their RGB values.") | ||
| 347 | |||
| 348 | (defun x-color-values (color &optional frame) | ||
| 349 | "Return a description of the color named COLOR on frame FRAME.\n\ | ||
| 350 | The value is a list of integer RGB values--(RED GREEN BLUE).\n\ | ||
| 351 | These values range from 0 to 255; white is (255 255 255).\n\ | ||
| 352 | If FRAME is omitted or nil, use the selected frame." | ||
| 353 | (if (x-color-defined-p color) | ||
| 354 | (let ((frame (or frame (selected-frame))) | ||
| 355 | (color-code (msdos-color-translate color))) | ||
| 356 | (cdr (nth color-code msdos-color-values))))) | ||
| 315 | 357 | ||
| 316 | ;; From lisp/term/x-win.el | 358 | ;; From lisp/term/x-win.el |
| 317 | (setq x-display-name "pc") | 359 | (setq x-display-name "pc") |