diff options
| author | Jason Rumney | 2007-11-21 03:33:25 +0000 |
|---|---|---|
| committer | Jason Rumney | 2007-11-21 03:33:25 +0000 |
| commit | 2097e21d6957dc17f5aca8173218ab24ddf32bb9 (patch) | |
| tree | 177433326809567cdb37404705b8d0632a946c0e | |
| parent | e8ffb999b95ca059dc97343a2c3571eb493255b8 (diff) | |
| download | emacs-2097e21d6957dc17f5aca8173218ab24ddf32bb9.tar.gz emacs-2097e21d6957dc17f5aca8173218ab24ddf32bb9.zip | |
New term init file for w32 console.
| -rw-r--r-- | lisp/term/w32console.el | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/lisp/term/w32console.el b/lisp/term/w32console.el new file mode 100644 index 00000000000..cf193e1617b --- /dev/null +++ b/lisp/term/w32console.el | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | ;;; w32console.el -- Setup w32 console keys and colors. | ||
| 2 | |||
| 3 | ;; Copyright (C) 2007 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: FSF | ||
| 6 | ;; Keywords: terminals | ||
| 7 | |||
| 8 | ;; This file is part of GNU Emacs. | ||
| 9 | |||
| 10 | ;; GNU Emacs is free software; you can redistribute it and/or modify | ||
| 11 | ;; it under the terms of the GNU General Public License as published by | ||
| 12 | ;; the Free Software Foundation; either version 3, or (at your option) | ||
| 13 | ;; any later version. | ||
| 14 | |||
| 15 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | ;; GNU General Public License for more details. | ||
| 19 | |||
| 20 | ;; You should have received a copy of the GNU General Public License | ||
| 21 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | ||
| 22 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| 23 | ;; Boston, MA 02110-1301, USA. | ||
| 24 | |||
| 25 | ;;; Commentary: | ||
| 26 | |||
| 27 | ;;; Code: | ||
| 28 | |||
| 29 | ;; W32 uses different color indexes than standard: | ||
| 30 | |||
| 31 | (defvar w32-tty-standard-colors | ||
| 32 | '(("black" 0 0 0 0) | ||
| 33 | ("blue" 1 0 0 52480) ; MediumBlue | ||
| 34 | ("green" 2 8704 35584 8704) ; ForestGreen | ||
| 35 | ("cyan" 3 0 52736 53504) ; DarkTurquoise | ||
| 36 | ("red" 4 45568 8704 8704) ; FireBrick | ||
| 37 | ("magenta" 5 35584 0 35584) ; DarkMagenta | ||
| 38 | ("brown" 6 40960 20992 11520) ; Sienna | ||
| 39 | ("lightgray" 7 48640 48640 48640) ; Gray | ||
| 40 | ("darkgray" 8 26112 26112 26112) ; Gray40 | ||
| 41 | ("lightblue" 9 0 0 65535) ; Blue | ||
| 42 | ("lightgreen" 10 0 65535 0) ; Green | ||
| 43 | ("lightcyan" 11 0 65535 65535) ; Cyan | ||
| 44 | ("lightred" 12 65535 0 0) ; Red | ||
| 45 | ("lightmagenta" 13 65535 0 65535) ; Magenta | ||
| 46 | ("yellow" 14 65535 65535 0) ; Yellow | ||
| 47 | ("white" 15 65535 65535 65535)) | ||
| 48 | "A list of VGA console colors, their indices and 16-bit RGB values.") | ||
| 49 | |||
| 50 | (defun terminal-init-w32console () | ||
| 51 | "Terminal initialization function for w32 console." | ||
| 52 | ;; Share function key initialization with w32 gui frames | ||
| 53 | (x-setup-function-keys (selected-frame)) | ||
| 54 | (let* ((colors w32-tty-standard-colors) | ||
| 55 | (color (car colors))) | ||
| 56 | (tty-color-clear) | ||
| 57 | (while colors | ||
| 58 | (tty-color-define (car color) (cadr color) (cddr color)) | ||
| 59 | (setq colors (cdr colors) | ||
| 60 | color (car colors)))) | ||
| 61 | (clear-face-cache) | ||
| 62 | (tty-set-up-initial-frame-faces) | ||
| 63 | (run-hooks 'terminal-init-w32-hook)) | ||