Mercurial > emacs
annotate lisp/term/pc-win.el @ 24323:c1bb999de64e
(rmail-show-message): If an unseen message has a
Summary-line in its header, get past one more line before looking
for the X-Coding-System header.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 16 Feb 1999 01:05:33 +0000 |
parents | 2dd79725f0c5 |
children | 2ed76ce5608e |
rev | line source |
---|---|
17517 | 1 ;;; pc-win.el --- setup support for `PC windows' (whatever that is). |
9571 | 2 |
18770
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
3 ;; Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. |
9571 | 4 |
5 ;; Author: Morten Welinder <terra@diku.dk> | |
14734 | 6 ;; Maintainer: FSF |
9571 | 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 2, 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 | |
14170
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
14040
diff
changeset
|
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
14040
diff
changeset
|
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
14040
diff
changeset
|
23 ;; Boston, MA 02111-1307, USA. |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
14040
diff
changeset
|
24 |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
14040
diff
changeset
|
25 ;;; Code: |
23cc3f54e536
Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents:
14040
diff
changeset
|
26 |
9571 | 27 (load "term/internal" nil t) |
28 | |
15315
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
29 ;; Color translation -- doesn't really need to be fast. |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
30 ;; Colors listed here do not include the "light-", |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
31 ;; "medium-" and "dark-" prefixes that are accounted for |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
32 ;; by `msdos-color-translate', which see below). |
9571 | 33 |
34 (defvar msdos-color-aliases | |
15315
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
35 '(("snow" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
36 ("ghost white" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
37 ("ghostwhite" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
38 ("white smoke" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
39 ("whitesmoke" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
40 ("gainsboro" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
41 ("floral white" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
42 ("floralwhite" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
43 ("old lace" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
44 ("oldlace" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
45 ("linen" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
46 ("antique white" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
47 ("antiquewhite" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
48 ("papaya whip" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
49 ("papayawhip" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
50 ("blanched almond" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
51 ("blanchedalmond" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
52 ("bisque" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
53 ("peach puff" . "lightred") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
54 ("peachpuff" . "lightred") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
55 ("navajo white" . "lightred") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
56 ("navajowhite" . "lightred") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
57 ("moccasin" . "lightred") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
58 ("cornsilk" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
59 ("ivory" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
60 ("lemon chiffon" . "yellow") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
61 ("lemonchiffon" . "yellow") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
62 ("seashell" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
63 ("honeydew" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
64 ("mint cream" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
65 ("mintcream" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
66 ("azure" . "lightcyan") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
67 ("alice blue" . "lightcyan") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
68 ("aliceblue" . "lightcyan") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
69 ("lavender" . "lightcyan") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
70 ("lavender blush" . "lightcyan") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
71 ("lavenderblush" . "lightcyan") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
72 ("misty rose" . "lightred") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
73 ("mistyrose" . "lightred") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
74 ("aquamarine" . "blue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
75 ("cadet blue" . "blue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
76 ("cadetblue" . "blue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
77 ("cornflower blue" . "lightblue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
78 ("cornflowerblue" . "lightblue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
79 ("midnight blue" . "blue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
80 ("midnightblue" . "blue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
81 ("navy blue" . "cyan") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
82 ("navyblue" . "cyan") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
83 ("navy" . "cyan") |
19568
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
84 ("royalblue" . "blue") |
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
85 ("royal blue" . "blue") |
15315
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
86 ("sky blue" . "lightblue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
87 ("skyblue" . "lightblue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
88 ("dodger blue" . "blue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
89 ("dodgerblue" . "blue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
90 ("powder blue" . "lightblue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
91 ("powderblue" . "lightblue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
92 ("slate blue" . "cyan") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
93 ("slateblue" . "cyan") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
94 ("steel blue" . "blue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
95 ("steelblue" . "blue") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
96 ("coral" . "lightred") |
19568
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
97 ("tomato" . "lightred") |
15315
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
98 ("firebrick" . "red") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
99 ("gold" . "yellow") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
100 ("goldenrod" . "yellow") |
19568
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
101 ("goldenrod yellow" . "yellow") |
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
102 ("goldenrodyellow" . "yellow") |
15315
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
103 ("pale goldenrod" . "yellow") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
104 ("palegoldenrod" . "yellow") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
105 ("olive green" . "lightgreen") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
106 ("olivegreen" . "lightgreen") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
107 ("olive drab" . "green") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
108 ("olivedrab" . "green") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
109 ("forest green" . "green") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
110 ("forestgreen" . "green") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
111 ("lime green" . "lightgreen") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
112 ("limegreen" . "lightgreen") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
113 ("sea green" . "lightcyan") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
114 ("seagreen" . "lightcyan") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
115 ("spring green" . "green") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
116 ("springgreen" . "green") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
117 ("lawn green" . "lightgreen") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
118 ("lawngreen" . "lightgreen") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
119 ("chartreuse" . "yellow") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
120 ("yellow green" . "lightgreen") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
121 ("yellowgreen" . "lightgreen") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
122 ("green yellow" . "lightgreen") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
123 ("greenyellow" . "lightgreen") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
124 ("slate grey" . "lightgray") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
125 ("slategrey" . "lightgray") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
126 ("slate gray" . "lightgray") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
127 ("slategray" . "lightgray") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
128 ("dim grey" . "darkgray") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
129 ("dimgrey" . "darkgray") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
130 ("dim gray" . "darkgray") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
131 ("dimgray" . "darkgray") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
132 ("light grey" . "lightgray") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
133 ("lightgrey" . "lightgray") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
134 ("light gray" . "lightgray") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
135 ("gray" . "darkgray") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
136 ("grey" . "darkgray") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
137 ("khaki" . "green") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
138 ("maroon" . "red") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
139 ("orange" . "brown") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
140 ("orchid" . "brown") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
141 ("saddle brown" . "red") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
142 ("saddlebrown" . "red") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
143 ("peru" . "red") |
19568
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
144 ("burlywood" . "brown") |
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
145 ("sandy brown" . "brown") |
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
146 ("sandybrown" . "brown") |
15315
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
147 ("pink" . "lightred") |
19568
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
148 ("hotpink" . "lightred") |
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
149 ("hot pink" ."lightred") |
15315
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
150 ("plum" . "magenta") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
151 ("indian red" . "red") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
152 ("indianred" . "red") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
153 ("violet red" . "magenta") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
154 ("violetred" . "magenta") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
155 ("orange red" . "red") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
156 ("orangered" . "red") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
157 ("salmon" . "lightred") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
158 ("sienna" . "lightred") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
159 ("tan" . "lightred") |
19568
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
160 ("chocolate" . "brown") |
15315
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
161 ("thistle" . "magenta") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
162 ("turquoise" . "lightgreen") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
163 ("pale turquoise" . "cyan") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
164 ("paleturquoise" . "cyan") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
165 ("violet" . "magenta") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
166 ("blue violet" . "lightmagenta") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
167 ("blueviolet" . "lightmagenta") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
168 ("wheat" . "white") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
169 ("green yellow" . "yellow") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
170 ("greenyellow" . "yellow") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
171 ("purple" . "magenta") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
172 ("rosybrown" . "brown") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
173 ("rosy brown" . "brown") |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
174 ("beige" . "brown")) |
9571 | 175 "List of alternate names for colors.") |
176 | |
177 (defun msdos-color-translate (name) | |
24242
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
178 "Translate color specification in NAME into something DOS terminal groks." |
9571 | 179 (setq name (downcase name)) |
180 (let* ((len (length name)) | |
13924
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
181 (val (- (length x-colors) |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
182 (length (member name x-colors)))) |
9571 | 183 (try)) |
13924
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
184 (if (or (< val 0) (>= val (length x-colors))) (setq val nil)) |
9571 | 185 (or val |
186 (and (setq try (cdr (assoc name msdos-color-aliases))) | |
187 (msdos-color-translate try)) | |
188 (and (> len 5) | |
15315
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
189 (string= "light" (substring name 0 5)) |
9571 | 190 (setq try (msdos-color-translate (substring name 5))) |
191 (logior try 8)) | |
192 (and (> len 6) | |
15315
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
193 (string= "light " (substring name 0 6)) |
9571 | 194 (setq try (msdos-color-translate (substring name 6))) |
195 (logior try 8)) | |
19568
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
196 (and (> len 4) |
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
197 (string= "pale" (substring name 0 4)) |
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
198 (setq try (msdos-color-translate (substring name 4))) |
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
199 (logior try 8)) |
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
200 (and (> len 5) |
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
201 (string= "pale " (substring name 0 5)) |
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
202 (setq try (msdos-color-translate (substring name 5))) |
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
203 (logior try 8)) |
15315
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
204 (and (> len 6) |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
205 (string= "medium" (substring name 0 6)) |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
206 (msdos-color-translate (substring name 6))) |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
207 (and (> len 7) |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
208 (string= "medium " (substring name 0 7)) |
d46311cef590
(msdos-color-aliases): Define more colors. (msdos-color-translate):
Richard M. Stallman <rms@gnu.org>
parents:
14734
diff
changeset
|
209 (msdos-color-translate (substring name 7))) |
9571 | 210 (and (> len 4) |
19568
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
211 (or (string= "dark" (substring name 0 4)) |
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
212 (string= "deep" (substring name 0 4))) |
9571 | 213 (msdos-color-translate (substring name 4))) |
214 (and (> len 5) | |
19568
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
215 (or (string= "dark " (substring name 0 5)) |
fa099f73f994
(msdos-color-aliases): Add missing colors.
Eli Zaretskii <eliz@gnu.org>
parents:
19290
diff
changeset
|
216 (string= "deep " (substring name 0 5))) |
19290
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
217 (msdos-color-translate (substring name 5))) |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
218 (and (> len 4) ;; gray shades: gray0 to gray100 |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
219 (save-match-data |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
220 (and |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
221 (string-match "gr[ae]y[0-9]" name) |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
222 (string-match "[0-9]+\\'" name) |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
223 (let ((num (string-to-int |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
224 (substring name (match-beginning 0))))) |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
225 (msdos-color-translate |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
226 (cond |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
227 ((> num 90) "white") |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
228 ((> num 50) "lightgray") |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
229 ((> num 10) "darkgray") |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
230 (t "black"))))))) |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
231 (and (> len 1) ;; purple1 to purple4 and the like |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
232 (save-match-data |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
233 (and |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
234 (string-match "[1-4]\\'" name) |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
235 (msdos-color-translate |
24242
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
236 (substring name 0 (match-beginning 0)))))) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
237 (and (= len 7) ;; X-style "#XXYYZZ" color spec |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
238 (eq (aref name 0) ?#) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
239 (member (aref name 1) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
240 '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
241 ?A ?B ?C ?D ?E ?F ?a ?b ?c ?d ?e ?f)) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
242 (msdos-color-translate |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
243 (msdos-approximate-color (string-to-number |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
244 (substring name 1) 16))))))) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
245 |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
246 (defun msdos-approximate-color (num) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
247 "Return a DOS color name which is the best approximation for the number NUM." |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
248 (let ((color-values msdos-color-values) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
249 (candidate (car msdos-color-values)) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
250 (best-distance 16777216) ;; 0xFFFFFF + 1 |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
251 best-color) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
252 (while candidate |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
253 (let* ((values (cdr candidate)) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
254 (value (+ (lsh (car values) 16) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
255 (lsh (car (cdr values)) 8) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
256 (nth 2 values)))) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
257 (if (< (abs (- value num)) best-distance) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
258 (setq best-distance (abs (- value num)) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
259 best-color (car candidate)))) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
260 (setq color-values (cdr color-values)) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
261 (setq candidate (car color-values))) |
2dd79725f0c5
(msdos-approximate-color): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
23461
diff
changeset
|
262 best-color)) |
9571 | 263 ;; --------------------------------------------------------------------------- |
264 ;; We want to delay setting frame parameters until the faces are setup | |
265 (defvar default-frame-alist nil) | |
15397
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
266 (modify-frame-parameters terminal-frame default-frame-alist) |
9571 | 267 |
18770
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
268 (defun msdos-bg-mode (&optional frame) |
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
269 (let* ((frame (or frame (selected-frame))) |
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
270 (params (frame-parameters frame)) |
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
271 (bg (cdr (assq 'background-color params)))) |
23461
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
272 ;; The list of ``dark'' colors should be consistent with |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
273 ;; `x-color-values' (below) and the dark/light color |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
274 ;; decisions `frame-set-background-mode' in lisp/faces.el. |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
275 (if (member bg |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
276 '("black" "blue" "green" "red" "magenta" "brown" "darkgray")) |
18770
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
277 'dark |
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
278 'light))) |
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
279 |
9571 | 280 (defun msdos-face-setup () |
15397
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
281 (modify-frame-parameters terminal-frame default-frame-alist) |
9571 | 282 |
19290
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
283 (modify-frame-parameters terminal-frame |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
284 (list (cons 'background-mode |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
285 (msdos-bg-mode terminal-frame)) |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
286 (cons 'display-type 'color))) |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
287 (face-set-after-frame-default terminal-frame) |
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
288 |
15397
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
289 (set-face-foreground 'bold "yellow" terminal-frame) |
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
290 (set-face-foreground 'italic "red" terminal-frame) |
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
291 (set-face-foreground 'bold-italic "lightred" terminal-frame) |
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
292 (set-face-foreground 'underline "white" terminal-frame) |
9571 | 293 |
294 (make-face 'msdos-menu-active-face) | |
295 (make-face 'msdos-menu-passive-face) | |
296 (make-face 'msdos-menu-select-face) | |
15397
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
297 (set-face-foreground 'msdos-menu-active-face "white" terminal-frame) |
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
298 (set-face-foreground 'msdos-menu-passive-face "lightgray" terminal-frame) |
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
299 (set-face-background 'msdos-menu-active-face "blue" terminal-frame) |
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
300 (set-face-background 'msdos-menu-passive-face "blue" terminal-frame) |
19290
7fb99affa49a
(msdos-color-aliases): Remove color names which end with a number.
Richard M. Stallman <rms@gnu.org>
parents:
19211
diff
changeset
|
301 (set-face-background 'msdos-menu-select-face "red" terminal-frame)) |
9571 | 302 |
303 ;; We have only one font, so... | |
304 (add-hook 'before-init-hook 'msdos-face-setup) | |
15397
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
305 |
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
306 ;; We create frames as if we were a terminal, but with a twist. |
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
307 (defun make-msdos-frame (&optional parameters) |
18770
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
308 (let* ((parms |
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
309 (append initial-frame-alist default-frame-alist parameters nil)) |
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
310 (frame (make-terminal-frame parms))) |
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
311 (modify-frame-parameters frame |
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
312 (list (cons 'background-mode |
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
313 (msdos-bg-mode frame)) |
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
314 (cons 'display-type 'color))) |
94ca3c126cee
(msdos-bg-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents:
17517
diff
changeset
|
315 frame)) |
15397
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
316 |
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
317 (setq frame-creation-function 'make-msdos-frame) |
f95592fcdb1c
(msdos-face-setup): Use `terminal-frame' for initial frame setup.
Richard M. Stallman <rms@gnu.org>
parents:
15315
diff
changeset
|
318 |
9571 | 319 ;; --------------------------------------------------------------------------- |
14040 | 320 ;; More or less useful imitations of certain X-functions. A lot of the |
9571 | 321 ;; values returned are questionable, but usually only the form of the |
322 ;; returned value matters. Also, by the way, recall that `ignore' is | |
323 ;; a useful function for returning 'nil regardless of argument. | |
324 | |
325 ;; From src/xfns.c | |
13484
be831ed47a75
(x-display-color-p): Accept optional arg.
Richard M. Stallman <rms@gnu.org>
parents:
9571
diff
changeset
|
326 (defun x-display-color-p (&optional display) 't) |
19211
e83ac35f9bcb
(x-list-fonts): Return "default" when appropriate.
Richard M. Stallman <rms@gnu.org>
parents:
18770
diff
changeset
|
327 (defun x-list-fonts (pattern &optional face frame maximum width) |
e83ac35f9bcb
(x-list-fonts): Return "default" when appropriate.
Richard M. Stallman <rms@gnu.org>
parents:
18770
diff
changeset
|
328 (if (and (numberp width) (= width 1)) |
e83ac35f9bcb
(x-list-fonts): Return "default" when appropriate.
Richard M. Stallman <rms@gnu.org>
parents:
18770
diff
changeset
|
329 (list "default") |
e83ac35f9bcb
(x-list-fonts): Return "default" when appropriate.
Richard M. Stallman <rms@gnu.org>
parents:
18770
diff
changeset
|
330 (list "no-such-font"))) |
9571 | 331 (defun x-color-defined-p (color) (numberp (msdos-color-translate color))) |
14520
e46b1e676418
(x-display-pixel-height, x-display-pixel-width):
Richard M. Stallman <rms@gnu.org>
parents:
14170
diff
changeset
|
332 (defun x-display-pixel-width (&optional frame) (frame-width frame)) |
e46b1e676418
(x-display-pixel-height, x-display-pixel-width):
Richard M. Stallman <rms@gnu.org>
parents:
14170
diff
changeset
|
333 (defun x-display-pixel-height (&optional frame) (frame-height frame)) |
9571 | 334 (defun x-display-planes (&optional frame) 4) ; 3 for background, actually |
335 (defun x-display-color-cells (&optional frame) 16) ; ??? | |
336 (defun x-server-max-request-size (&optional frame) 1000000) ; ??? | |
337 (defun x-server-vendor (&optional frame) t "GNU") | |
338 (defun x-server-version (&optional frame) '(1 0 0)) | |
339 (defun x-display-screens (&optional frame) 1) | |
340 (defun x-display-mm-height (&optional frame) 200) ; Guess the size of my | |
341 (defun x-display-mm-width (&optional frame) 253) ; monitor, MW... | |
342 (defun x-display-backing-store (&optional frame) 'not-useful) | |
343 (defun x-display-visual-class (&optional frame) 'static-color) | |
344 (fset 'x-display-save-under 'ignore) | |
345 (fset 'x-get-resource 'ignore) | |
23461
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
346 ;;; |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
347 ;;; This is copied from etc/rgb.txt, except that some values were changed |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
348 ;;; a bit to make them consistent with DOS console colors. The order of |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
349 ;;; the colors is according to the PC text mode color codes. |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
350 ;;; |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
351 ;;; If you want to change the RGB values, keep in mind that various pieces |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
352 ;;; of Emacs think that a color whose RGB values add up to less than 0.6 of |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
353 ;;; the values for WHITE (i.e. less than 459) are ``dark'', otherwise the |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
354 ;;; color is ``light''; see `frame-set-background-mode' in lisp/faces.el for |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
355 ;;; an example. |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
356 (defvar msdos-color-values |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
357 '(("black" 0 0 0) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
358 ("blue" 0 0 255) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
359 ("green" 0 255 0) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
360 ("cyan" 0 255 255) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
361 ("red" 255 0 0) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
362 ("magenta" 139 0 139) ; dark magenta |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
363 ("brown" 165 42 42) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
364 ("lightgray" 211 211 211) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
365 ("darkgray" 102 102 102) ; gray40 |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
366 ("lightblue" 173 216 230) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
367 ("lightgreen" 144 238 144) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
368 ("lightcyan" 224 255 255) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
369 ("lightred" 255 52 179) ; maroon1 |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
370 ("lightmagenta" 238 0 238) ; magenta2 |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
371 ("yellow" 255 255 0) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
372 ("white" 255 255 255)) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
373 "A list of MS-DOS console colors and their RGB values.") |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
374 |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
375 (defun x-color-values (color &optional frame) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
376 "Return a description of the color named COLOR on frame FRAME.\n\ |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
377 The value is a list of integer RGB values--(RED GREEN BLUE).\n\ |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
378 These values range from 0 to 255; white is (255 255 255).\n\ |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
379 If FRAME is omitted or nil, use the selected frame." |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
380 (if (x-color-defined-p color) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
381 (let ((frame (or frame (selected-frame))) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
382 (color-code (msdos-color-translate color))) |
b84718f930f8
(msdos-color-values): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
21710
diff
changeset
|
383 (cdr (nth color-code msdos-color-values))))) |
9571 | 384 |
385 ;; From lisp/term/x-win.el | |
386 (setq x-display-name "pc") | |
387 (setq split-window-keep-point t) | |
13924
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
388 (defvar x-colors '("black" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
389 "blue" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
390 "green" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
391 "cyan" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
392 "red" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
393 "magenta" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
394 "brown" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
395 "lightgray" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
396 "darkgray" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
397 "lightblue" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
398 "lightgreen" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
399 "lightcyan" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
400 "lightred" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
401 "lightmagenta" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
402 "yellow" |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
403 "white") |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
404 "The list of colors available on a PC display under MS-DOS.") |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
405 (defun x-defined-colors (&optional frame) |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
406 "Return a list of colors supported for a particular frame. |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
407 The argument FRAME specifies which frame to try. |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
408 The value may be different for frames on different X displays." |
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
409 x-colors) |
17478
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
410 |
21710
70d6549a4105
(x-select-text, x-get-selection-value): Replace win16 with w16.
Eli Zaretskii <eliz@gnu.org>
parents:
20033
diff
changeset
|
411 ;; From lisp/term/w32-win.el |
13924
36aa12b0ea6a
(x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents:
13628
diff
changeset
|
412 ; |
17478
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
413 ;;;; Selections and cut buffers |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
414 ; |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
415 ;;; We keep track of the last text selected here, so we can check the |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
416 ;;; current selection against it, and avoid passing back our own text |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
417 ;;; from x-cut-buffer-or-selection-value. |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
418 (defvar x-last-selected-text nil) |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
419 |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
420 (defvar x-select-enable-clipboard t |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
421 "Non-nil means cutting and pasting uses the clipboard. |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
422 This is in addition to the primary selection.") |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
423 |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
424 (defun x-select-text (text &optional push) |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
425 (if x-select-enable-clipboard |
21710
70d6549a4105
(x-select-text, x-get-selection-value): Replace win16 with w16.
Eli Zaretskii <eliz@gnu.org>
parents:
20033
diff
changeset
|
426 (w16-set-clipboard-data text)) |
17478
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
427 (setq x-last-selected-text text)) |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
428 |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
429 ;;; Return the value of the current selection. |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
430 ;;; Consult the selection, then the cut buffer. Treat empty strings |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
431 ;;; as if they were unset. |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
432 (defun x-get-selection-value () |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
433 (if x-select-enable-clipboard |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
434 (let (text) |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
435 ;; Don't die if x-get-selection signals an error. |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
436 (condition-case c |
21710
70d6549a4105
(x-select-text, x-get-selection-value): Replace win16 with w16.
Eli Zaretskii <eliz@gnu.org>
parents:
20033
diff
changeset
|
437 (setq text (w16-get-clipboard-data)) |
70d6549a4105
(x-select-text, x-get-selection-value): Replace win16 with w16.
Eli Zaretskii <eliz@gnu.org>
parents:
20033
diff
changeset
|
438 (error (message "w16-get-clipboard-data:%s" c))) |
17478
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
439 (if (string= text "") (setq text nil)) |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
440 (cond |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
441 ((not text) nil) |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
442 ((eq text x-last-selected-text) nil) |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
443 ((string= text x-last-selected-text) |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
444 ;; Record the newer string, so subsequent calls can use the 'eq' test. |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
445 (setq x-last-selected-text text) |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
446 nil) |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
447 (t |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
448 (setq x-last-selected-text text)))))) |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
449 |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
450 ;;; Arrange for the kill and yank functions to set and check the clipboard. |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
451 (setq interprogram-cut-function 'x-select-text) |
14989cb202dc
* (x-select-enable-clipboard): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
16643
diff
changeset
|
452 (setq interprogram-paste-function 'x-get-selection-value) |
9571 | 453 |
13628
6da84b713ae7
(msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents:
13484
diff
changeset
|
454 ;; From lisp/faces.el: we only have one font, so always return |
6da84b713ae7
(msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents:
13484
diff
changeset
|
455 ;; it, no matter which variety they've asked for. |
6da84b713ae7
(msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents:
13484
diff
changeset
|
456 (defun x-frob-font-slant (font which) |
6da84b713ae7
(msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents:
13484
diff
changeset
|
457 font) |
6da84b713ae7
(msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents:
13484
diff
changeset
|
458 |
19211
e83ac35f9bcb
(x-list-fonts): Return "default" when appropriate.
Richard M. Stallman <rms@gnu.org>
parents:
18770
diff
changeset
|
459 ;; From src/fontset.c: |
e83ac35f9bcb
(x-list-fonts): Return "default" when appropriate.
Richard M. Stallman <rms@gnu.org>
parents:
18770
diff
changeset
|
460 (fset 'query-fontset 'ignore) |
e83ac35f9bcb
(x-list-fonts): Return "default" when appropriate.
Richard M. Stallman <rms@gnu.org>
parents:
18770
diff
changeset
|
461 |
16643
734b72203ac5
(iconify-or-deiconify-frame): Define to be a
Richard M. Stallman <rms@gnu.org>
parents:
15397
diff
changeset
|
462 ;; From lisp/term/x-win.el: make iconify-or-deiconify-frame a no-op. |
734b72203ac5
(iconify-or-deiconify-frame): Define to be a
Richard M. Stallman <rms@gnu.org>
parents:
15397
diff
changeset
|
463 (fset 'iconify-or-deiconify-frame 'ignore) |
734b72203ac5
(iconify-or-deiconify-frame): Define to be a
Richard M. Stallman <rms@gnu.org>
parents:
15397
diff
changeset
|
464 |
9571 | 465 ;; From lisp/frame.el |
466 (fset 'set-default-font 'ignore) | |
467 (fset 'set-mouse-color 'ignore) ; We cannot, I think. | |
468 (fset 'set-cursor-color 'ignore) ; Hardware determined by char under. | |
469 (fset 'set-border-color 'ignore) ; Not useful. | |
20033
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
470 |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
471 ;; From lisp/term/x-win.el: |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
472 (defconst x-long-option-alist |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
473 '(("--name" . "-name") |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
474 ("--title" . "-T") |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
475 ("--reverse-video" . "-reverse") |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
476 ("--foreground-color" . "-fg") |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
477 ("--background-color" . "-bg"))) |
9571 | 478 ;; --------------------------------------------------------------------------- |
20033
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
479 ;; Handle the X-like command line parameters "-fg", "-bg", "-name", etc. |
9571 | 480 (defun msdos-handle-args (args) |
481 (let ((rest nil)) | |
20033
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
482 (message "%s" args) |
9571 | 483 (while args |
20033
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
484 (let* ((this (car args)) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
485 (orig-this this) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
486 completion argval) |
9571 | 487 (setq args (cdr args)) |
20033
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
488 ;; Check for long options with attached arguments |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
489 ;; and separate out the attached option argument into argval. |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
490 (if (string-match "^--[^=]*=" this) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
491 (setq argval (substring this (match-end 0)) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
492 this (substring this 0 (1- (match-end 0))))) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
493 (setq completion (try-completion this x-long-option-alist)) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
494 (if (eq completion t) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
495 ;; Exact match for long option. |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
496 (setq this (cdr (assoc this x-long-option-alist))) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
497 (if (stringp completion) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
498 (let ((elt (assoc completion x-long-option-alist))) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
499 ;; Check for abbreviated long option. |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
500 (or elt |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
501 (error "Option `%s' is ambiguous" this)) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
502 (setq this (cdr elt))) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
503 ;; Check for a short option. |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
504 (setq argval nil this orig-this))) |
9571 | 505 (cond ((or (string= this "-fg") (string= this "-foreground")) |
20033
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
506 (or argval (setq argval (car args) args (cdr args))) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
507 (setq default-frame-alist |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
508 (cons (cons 'foreground-color argval) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
509 default-frame-alist))) |
9571 | 510 ((or (string= this "-bg") (string= this "-background")) |
20033
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
511 (or argval (setq argval (car args) args (cdr args))) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
512 (setq default-frame-alist |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
513 (cons (cons 'background-color argval) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
514 default-frame-alist))) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
515 ((or (string= this "-T") (string= this "-name")) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
516 (or argval (setq argval (car args) args (cdr args))) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
517 (setq default-frame-alist |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
518 (cons |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
519 (cons 'title |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
520 (if (stringp argval) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
521 argval |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
522 (let ((case-fold-search t) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
523 i) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
524 (setq argval (invocation-name)) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
525 |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
526 ;; Change any . or * characters in name to |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
527 ;; hyphens, so as to emulate behavior on X. |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
528 (while |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
529 (setq i (string-match "[.*]" argval)) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
530 (aset argval i ?-)) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
531 argval))) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
532 default-frame-alist))) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
533 ((or (string= this "-r") |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
534 (string= this "-rv") |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
535 (string= this "-reverse")) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
536 (setq default-frame-alist |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
537 (cons '(reverse . t) |
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
538 default-frame-alist))) |
9571 | 539 (t (setq rest (cons this rest)))))) |
20033
2c0e89d1488b
(x-long-option-alist): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
19568
diff
changeset
|
540 (nreverse rest))) |
9571 | 541 |
542 (setq command-line-args (msdos-handle-args command-line-args)) | |
543 ;; --------------------------------------------------------------------------- | |
17517 | 544 |
545 ;;; pc-win.el ends here |