diff options
| author | Richard M. Stallman | 1996-01-02 23:04:42 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-01-02 23:04:42 +0000 |
| commit | bb3a4574664d9dd50cd701cc9c0a6acdce7c9c5d (patch) | |
| tree | 2917fe596d00486f45d3e696d99a49dc6e43a4d6 | |
| parent | cb5bec6ebb7075c351cdaf612114ce24c9d4b3f2 (diff) | |
| download | emacs-bb3a4574664d9dd50cd701cc9c0a6acdce7c9c5d.tar.gz emacs-bb3a4574664d9dd50cd701cc9c0a6acdce7c9c5d.zip | |
(x-colors): New variable, a list of colors
supported by PC color displays under MS-DOS.
(msdos-color-translate): Use `x-colors'.
(x-defined-colors): New alternate definition.
| -rw-r--r-- | lisp/term/pc-win.el | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el index 95b8cfc0c31..c11634c15a5 100644 --- a/lisp/term/pc-win.el +++ b/lisp/term/pc-win.el | |||
| @@ -36,6 +36,8 @@ | |||
| 36 | ("darkgoldenrod" . "brown") | 36 | ("darkgoldenrod" . "brown") |
| 37 | ("goldenrod" . "yellow") | 37 | ("goldenrod" . "yellow") |
| 38 | ("grey40" . "darkgray") | 38 | ("grey40" . "darkgray") |
| 39 | ("dark gray" . "darkgray") | ||
| 40 | ("light gray" . "lightgray") | ||
| 39 | ("rosybrown" . "brown") | 41 | ("rosybrown" . "brown") |
| 40 | ("blue" . "lightblue") ;; from here: for Enriched Text | 42 | ("blue" . "lightblue") ;; from here: for Enriched Text |
| 41 | ("darkslategray" . "darkgray") | 43 | ("darkslategray" . "darkgray") |
| @@ -54,24 +56,10 @@ | |||
| 54 | (defun msdos-color-translate (name) | 56 | (defun msdos-color-translate (name) |
| 55 | (setq name (downcase name)) | 57 | (setq name (downcase name)) |
| 56 | (let* ((len (length name)) | 58 | (let* ((len (length name)) |
| 57 | (val (cdr (assoc name | 59 | (val (- (length x-colors) |
| 58 | '(("black" . 0) | 60 | (length (member name x-colors)))) |
| 59 | ("blue" . 1) | ||
| 60 | ("green" . 2) | ||
| 61 | ("cyan" . 3) | ||
| 62 | ("red" . 4) | ||
| 63 | ("magenta" . 5) | ||
| 64 | ("brown" . 6) | ||
| 65 | ("lightgray" . 7) ("light gray" . 7) | ||
| 66 | ("darkgray" . 8) ("dark gray" . 8) | ||
| 67 | ("lightblue" . 9) | ||
| 68 | ("lightgreen" . 10) | ||
| 69 | ("lightcyan" . 11) | ||
| 70 | ("lightred" . 12) | ||
| 71 | ("lightmagenta" . 13) | ||
| 72 | ("yellow" . 14) | ||
| 73 | ("white" . 15))))) | ||
| 74 | (try)) | 61 | (try)) |
| 62 | (if (or (< val 0) (>= val (length x-colors))) (setq val nil)) | ||
| 75 | (or val | 63 | (or val |
| 76 | (and (setq try (cdr (assoc name msdos-color-aliases))) | 64 | (and (setq try (cdr (assoc name msdos-color-aliases))) |
| 77 | (msdos-color-translate try)) | 65 | (msdos-color-translate try)) |
| @@ -143,7 +131,29 @@ | |||
| 143 | ;; From lisp/term/x-win.el | 131 | ;; From lisp/term/x-win.el |
| 144 | (setq x-display-name "pc") | 132 | (setq x-display-name "pc") |
| 145 | (setq split-window-keep-point t) | 133 | (setq split-window-keep-point t) |
| 146 | 134 | (defvar x-colors '("black" | |
| 135 | "blue" | ||
| 136 | "green" | ||
| 137 | "cyan" | ||
| 138 | "red" | ||
| 139 | "magenta" | ||
| 140 | "brown" | ||
| 141 | "lightgray" | ||
| 142 | "darkgray" | ||
| 143 | "lightblue" | ||
| 144 | "lightgreen" | ||
| 145 | "lightcyan" | ||
| 146 | "lightred" | ||
| 147 | "lightmagenta" | ||
| 148 | "yellow" | ||
| 149 | "white") | ||
| 150 | "The list of colors available on a PC display under MS-DOS.") | ||
| 151 | (defun x-defined-colors (&optional frame) | ||
| 152 | "Return a list of colors supported for a particular frame. | ||
| 153 | The argument FRAME specifies which frame to try. | ||
| 154 | The value may be different for frames on different X displays." | ||
| 155 | x-colors) | ||
| 156 | ; | ||
| 147 | ;; From lisp/select.el | 157 | ;; From lisp/select.el |
| 148 | (defun x-get-selection (&rest rest) "") | 158 | (defun x-get-selection (&rest rest) "") |
| 149 | (fset 'x-set-selection 'ignore) | 159 | (fset 'x-set-selection 'ignore) |