Switch to recommended form of GPLv3 permissions notice.
[emacs.git] / lisp / term / w32console.el
blob22fe44fb570bba240f0e763cb8c5c7324d2ace19
1 ;;; w32console.el -- Setup w32 console keys and colors.
3 ;; Copyright (C) 2007, 2008 Free Software Foundation, Inc.
5 ;; Author: FSF
6 ;; Keywords: terminals
8 ;; This file is part of GNU Emacs.
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 of the License, or
13 ;; (at your option) any later version.
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.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23 ;;; Commentary:
25 ;;; Code:
27 ;; W32 uses different color indexes than standard:
29 (defvar w32-tty-standard-colors
30 '(("black" 0 0 0 0)
31 ("blue" 1 0 0 52480) ; MediumBlue
32 ("green" 2 8704 35584 8704) ; ForestGreen
33 ("cyan" 3 0 52736 53504) ; DarkTurquoise
34 ("red" 4 45568 8704 8704) ; FireBrick
35 ("magenta" 5 35584 0 35584) ; DarkMagenta
36 ("brown" 6 40960 20992 11520) ; Sienna
37 ("lightgray" 7 48640 48640 48640) ; Gray
38 ("darkgray" 8 26112 26112 26112) ; Gray40
39 ("lightblue" 9 0 0 65535) ; Blue
40 ("lightgreen" 10 0 65535 0) ; Green
41 ("lightcyan" 11 0 65535 65535) ; Cyan
42 ("lightred" 12 65535 0 0) ; Red
43 ("lightmagenta" 13 65535 0 65535) ; Magenta
44 ("yellow" 14 65535 65535 0) ; Yellow
45 ("white" 15 65535 65535 65535))
46 "A list of VGA console colors, their indices and 16-bit RGB values.")
48 (defun terminal-init-w32console ()
49 "Terminal initialization function for w32 console."
50 ;; Share function key initialization with w32 gui frames
51 (x-setup-function-keys (selected-frame))
52 (let* ((colors w32-tty-standard-colors)
53 (color (car colors)))
54 (tty-color-clear)
55 (while colors
56 (tty-color-define (car color) (cadr color) (cddr color))
57 (setq colors (cdr colors)
58 color (car colors))))
59 (clear-face-cache)
60 (tty-set-up-initial-frame-faces)
61 (run-hooks 'terminal-init-w32-hook))
63 ;; arch-tag: 3195fd5e-ab86-4a46-b1dc-4f7a8c8deff3