annotate lisp/term/w32console.el @ 94373:f9bcef02655f

New version 11.0.
author Vinicius Jose Latorre <viniciusjl@ig.com.br>
date Sat, 26 Apr 2008 11:38:50 +0000
parents b9e8ab94c460
children f3ab0c2464f5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
86266
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
1 ;;; w32console.el -- Setup w32 console keys and colors.
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
2
87665
b9e8ab94c460 Add 2008 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 86274
diff changeset
3 ;; Copyright (C) 2007, 2008 Free Software Foundation, Inc.
86266
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
4
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
5 ;; Author: FSF
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
6 ;; Keywords: terminals
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
7
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
9
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
12 ;; the Free Software Foundation; either version 3, or (at your option)
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
13 ;; any later version.
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
14
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
18 ;; GNU General Public License for more details.
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
19
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
23 ;; Boston, MA 02110-1301, USA.
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
24
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
25 ;;; Commentary:
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
26
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
27 ;;; Code:
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
28
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
29 ;; W32 uses different color indexes than standard:
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
30
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
31 (defvar w32-tty-standard-colors
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
32 '(("black" 0 0 0 0)
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
33 ("blue" 1 0 0 52480) ; MediumBlue
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
34 ("green" 2 8704 35584 8704) ; ForestGreen
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
35 ("cyan" 3 0 52736 53504) ; DarkTurquoise
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
36 ("red" 4 45568 8704 8704) ; FireBrick
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
37 ("magenta" 5 35584 0 35584) ; DarkMagenta
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
38 ("brown" 6 40960 20992 11520) ; Sienna
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
39 ("lightgray" 7 48640 48640 48640) ; Gray
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
40 ("darkgray" 8 26112 26112 26112) ; Gray40
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
41 ("lightblue" 9 0 0 65535) ; Blue
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
42 ("lightgreen" 10 0 65535 0) ; Green
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
43 ("lightcyan" 11 0 65535 65535) ; Cyan
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
44 ("lightred" 12 65535 0 0) ; Red
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
45 ("lightmagenta" 13 65535 0 65535) ; Magenta
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
46 ("yellow" 14 65535 65535 0) ; Yellow
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
47 ("white" 15 65535 65535 65535))
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
48 "A list of VGA console colors, their indices and 16-bit RGB values.")
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
49
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
50 (defun terminal-init-w32console ()
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
51 "Terminal initialization function for w32 console."
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
52 ;; Share function key initialization with w32 gui frames
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
53 (x-setup-function-keys (selected-frame))
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
54 (let* ((colors w32-tty-standard-colors)
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
55 (color (car colors)))
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
56 (tty-color-clear)
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
57 (while colors
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
58 (tty-color-define (car color) (cadr color) (cddr color))
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
59 (setq colors (cdr colors)
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
60 color (car colors))))
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
61 (clear-face-cache)
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
62 (tty-set-up-initial-frame-faces)
20c1649756b5 New term init file for w32 console.
Jason Rumney <jasonr@gnu.org>
parents:
diff changeset
63 (run-hooks 'terminal-init-w32-hook))
86274
860b7eb2a46f Add arch tagline
Miles Bader <miles@gnu.org>
parents: 86266
diff changeset
64
860b7eb2a46f Add arch tagline
Miles Bader <miles@gnu.org>
parents: 86266
diff changeset
65 ;; arch-tag: 3195fd5e-ab86-4a46-b1dc-4f7a8c8deff3