1 ;;; internal.el --- support for PC internal terminal
3 ;; Copyright (C) 1993-1994, 1998-1999, 2001-2016 Free Software
6 ;; Author: Morten Welinder <terra@diku.dk>
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/>.
27 ;; ---------------------------------------------------------------------------
28 (defvar msdos-key-remapping-map
29 (let ((map (make-sparse-keymap)))
30 ;; keyboard setup -- that's simple!
31 (define-key map
[M-backspace
] [?\M-\d
])
32 (define-key map
[M-delete
] [?\M-d
])
33 (define-key map
[M-tab
] [?\M-
\t])
34 (define-key map
[M-linefeed
] [?\M-
\n])
35 (define-key map
[M-clear
] [?\M-
\013])
36 (define-key map
[M-return
] [?\M-
\015])
37 (define-key map
[M-escape
] [?\M-\e
])
39 "Keymap for remapping special keys on MS-DOS keyboard.")
41 (defun msdos-setup-keyboard (frame)
42 "Setup `local-function-key-map' for MS-DOS keyboard."
43 ;; Don't do this twice on the same display, or it would break
44 ;; normal-erase-is-backspace-mode.
45 (unless (terminal-parameter frame
'msdos-setup-keyboard
)
46 ;; Map certain keypad keys into ASCII characters that people usually expect.
47 (with-selected-frame frame
48 (let ((map (copy-keymap msdos-key-remapping-map
)))
49 (set-keymap-parent map
(keymap-parent local-function-key-map
))
50 (set-keymap-parent local-function-key-map map
)))
51 (set-terminal-parameter frame
'msdos-setup-keyboard t
))
52 (set-input-mode nil nil
0))
54 ;; ----------------------------------------------------------------------
58 ;; DOS can only support a single font. On most systems (with the
59 ;; possible exception of Far Eastern DOS versions), this means that
60 ;; two character sets are available at any given time: the ASCII
61 ;; charset, and a single national charset, usually mapped to codes
62 ;; above 128 (i.e., with 8th bit set). Which national charset is
63 ;; supported depends on the codepage loaded by the system when it
64 ;; boots; usually, this codepage cannot be changed without
67 ;; Since each codepage can usually display character of a single
68 ;; MULE charset, Emacs can display a single MULE charset with the
69 ;; glyphs of the current codepage. When Emacs starts on DOS, it
70 ;; automatically sets its default coding systems for file I/O and
71 ;; terminal output according to the current DOS codepage, given by
72 ;; the `dos-codepage' variable.
74 ;; This leaves us with the problem of displaying character sets
75 ;; other than the one which maps directly into the current codepage.
76 ;; The following functions and variables handle this nuisance by
77 ;; defining a display table where each character that doesn't have a
78 ;; glyph in some codepage is mapped to a string which represents it.
79 ;; For example, a small c with cedilla is mapped to the string
80 ;; ",c". A nice feature of the display tables is that Emacs
81 ;; knows that the string represents a single character, and thus
82 ;; cursor motion works as you'd expect: a single `C-f' moves past
83 ;; the entire string which represents a single character.
84 ;; ----------------------------------------------------------------------
86 (defvar IT-unicode-translations
88 (160 563 ; first, last
89 [ 255 "!I" "|c" "Pd" "$$" "Ye" "|" "SE" "\"" "(c)" ; Latin-1
90 "_a" "<<" "~" "--" "(R)" "'-" "^o" "+-" "^2" "^3"
91 "'" "u" ".P" "^." "'," "^1" "_o" ">>" "1/4" "1/2"
92 "3/4" "?I" "`A" "A'" "A^" "~A" "\"A" "Ao" "AE" ",C"
93 "`E" "E'" "E^" "\"E" "`I" "I'" "I^" "\"I" "-D" "~N"
94 "`O" "O'" "O^" "~O" "\"O" "*x" "/O" "`U" "U'" "U^"
95 "\"U" "Y'" "-P" "ss" "`a" "a'" "a^" "~a" "\"a" "ao"
96 "ae" ",c" "`e" "e'" "e^" "\"e" "`i" "i'" "i^" "\"i"
97 "-d" "~n" "`o" "o'" "o^" "~o" "\"o" "-:" "/o" "`u"
98 "u'" "u^" "\"u" "y'" "-p" "\"y" ; 255
99 "A-" "a-" "A(" "a(" "A;" "a;" "C'" "c'" "C>" "c>" ; Latin Extended-A
100 "C." "c." "C<" "c<" "D<" "d<" "D/" "d/" "E-" "e-"
101 "E(" "e(" "E." "e." "E;" "e;" "E<" "e<" "G>" "g>"
102 "G(" "g(" "G." "g." "G," "g," "H>" "h>" "H/" "h/"
103 "I~" "i~" "I-" "i-" "I(" "i(" "I;" "i;" "I." "i."
104 "IJ" "ij" "J>" "j>" "K," "k," "kk" "L'" "l'" "L,"
105 "l," "L<" "l<" "L." "l." "L/" "l/" "N'" "n'" "N,"
106 "n," "N<" "n<" "'n" "NG" "ng" "O-" "o-" "O(" "o("
107 "O\"" "o\"" "OE" "oe" "R'" "r'" "R," "r," "R<" "r<"
108 "S'" "s'" "S>" "s>" "S," "s," "S<" "s<" "T," "t,"
109 "T<" "t<" "T/" "t/" "U~" "u~" "U-" "u-" "U(" "u("
110 "U0" "u0" "U\"" "u\"" "U;" "u;" "W>" "w>" "Y>" "y>"
111 "Y:" "Z'" "z'" "Z." "z." "Z<" "z<" "s1" ; 017f
112 "b/" "B2" "=B" "=b" "B6" "b6" "!C" "C2" "c2" "-D" ;Lat. Extended-B
113 "D2" "=D" "=d" "!d" "!E" "-E" "Eps" "F2" "f2" "G2"
114 "V0" "hv" "io" "-I" "K2" "k2" "-l" "la-" "!M" "2N"
115 "n_" "-O" "O9" "o9" "OI" "oi" "P2" "p2" "'R" "!S"
116 "!s" "Esh" "!esh" "t~" "T2" "t2" "T~" "U9" "u9" "Ups"
117 "V2" "Y2" "y2" "Z/" "z/" "ED" "!ED" "!ed" "ed;" "2/"
118 "5-" "_5-" "ts" "wn" "|_" "||" "|=" "!_" "DZ<" "Dz<"
119 "dz<" "LJ3" "Lj3" "lj3" "NJ3" "Nj3" "nj3" "A<" "a<" "I<"
120 "i<" "O<" "o<" "U<" "u<" "U:-" "u:-" "U:'" "u:'" "U:<"
121 "u:<" "U:!" "u:!" "e1" "A:-" "a:-" "A.-" "a.-" "AE-" "ae-"
122 "G/" "g/" "G<" "g<" "K<" "k<" "O;" "o;" "O1" "o1"
123 "EZ" "ez" "j<" "DZ3" "Dz3" "dz3" "G'" "g'" "Hv" "Wn"
124 "N`" "n`" "AA'" "aa'" "AE'" "ae'" "O/'" "o/'" "A!!" "a!!"
125 "A)" "a)" "E!!" "e!!" "E)" "e)" "I!!" "i!!" "I)" "i)"
126 "O!!" "o!!" "O)" "o)" "R!!" "r!!" "R)" "r)" "U!!" "u!!"
127 "U)" "u)" ",S" ",s" ",T" ",t" "'3" "'3_" "H<" "h<"
128 nil nil
"8" "8_" "Z2" "z2" "A." "a." "E," "e,"
129 "O:-" "o:-" "O~-" "o~-" "O." "o." "O.-" "o.-" "Y-" "y-"] ; 0x233
133 (884 1123 ; first, last
134 [ "'" "," nil nil nil nil
"j3" nil nil nil
; Greek
135 "?;" nil nil nil nil nil
"'*" "'%" "A%" ".*"
136 "E%" "Y%" "I%" nil
"O%" nil
"U%" "W%" "i3" "A*"
137 "B*" "G*" "D*" "E*" "Z*" "H*" "Th*" "I*" "K*" "L*"
138 "M*" "N*" "C*" "O*" "P*" "R*" nil
"S*" "T*" "U*"
139 "F*" "X*" "Q*" "W*" "J*" "V*" "a%" "e%" "y%" "i%"
140 "u3" "a*" "b*" "g*" "d*" "e*" "z*" "h*" "th*" "i*"
141 "k*" "l*" "m*" "n*" "c*" "o*" "p*" "r*" "*s" "s*"
142 "t*" "u*" "f*" "x*" "q*" "w*" "j*" "v*" "o%" "u%"
143 "w%" nil
"b3" "th%" "U2*" "'U2*" "U:2*" "ph*" "pi*" "ka*"
144 nil nil
"Sti" "sti" "Dig" "dig" "Kop" "kop" "Sam" "sam"
145 "She" "she" "Fei" "fei" "Khe" "khe" "Hor" "hor" "Gan" "gan"
146 "Shi" "shi" "Dei" "dei" "ka*" "rh*" "ls*" "yo*" nil nil
147 nil nil nil nil nil nil nil nil nil nil
148 "IE'" "E:" "D%" "G%" "IE" "DS" "II" "YI" "J%" "LJ" ; Cyrillic
149 "NJ" "Ts" "KJ" "`I=" "V%" "DZ" 65 "B=" 66 "G="
150 68 69 "Z%" 51 85 "J=" 75 "L=" 77 72
151 79 "P=" 80 67 84 89 "F=" 88 "C=" "C%"
152 "S%" "Sc" "=\"" "Y=" "%\"" "Ee" "JU" "JA" 97 "b="
153 98 "g=" 103 101 "z%" "z=" 117 "j=" 107 "l="
154 109 "n=" 111 "p=" 112 99 "t=" 121 "f=" 120
155 "c=" "c%" "s%" "sc" "='" "y=" "%'" "ee" "ju" "ja"
156 "ie'" "e:" "d%" "g%" "ie" "ds" "ii" "yi" "j%" "lj"
157 "nj" "ts" "kj" "v%" "`i=" "dz" "OM=" "om=" "Y3" "y3"] ; 0x463
160 (1454 1645 ; first, last
161 [ nil nil
":'" "v:" "-:" "-':" ".'" ".." "v'" "-'"
162 "-," "`." nil
"\\." "(.)" "|'" "`-" nil
"||" nil
163 nil
"::" nil nil nil nil nil nil nil nil
165 "A+" "B+" "G+" "D+" "H+" "W+" "Z+" "X+" "Tj" "J+" ; Hebrew
166 "K%" "K+" "L+" "M%" "M+" "N%" "N+" "S+" "E+" "P%"
167 "P+" "Zj" "ZJ" "Q+" "R+" "Sh" "T+" nil nil nil
168 nil nil
"WW+" "WJ+" "JJ+" "'+" "\"+" nil nil nil
169 nil nil nil nil nil nil nil nil nil nil
170 nil nil nil nil nil nil nil nil nil nil
171 ",+" nil nil nil nil nil nil nil nil nil
; Arabic
172 nil nil nil nil nil
";+" nil nil nil
"?+"
173 nil
"H'" "aM" "aH" "wH" "ah" "yH" "a+" "b+" "tm"
174 "t+" "tk" "g+" "hk" "x+" "d+" "dk" "r+" "z+" "s+"
175 "sn" "c+" "dd" "tj" "zH" "e+" "i+" nil nil nil
176 nil nil
"++" "f+" "q+" "k+" "l+" "m+" "n+" "h+"
177 "w+" "j+" "y+" ":+" "\"+" "=+" "/+" "'+" "1+" "3+"
178 "0+" nil nil nil nil nil nil nil nil nil
179 nil nil nil nil
"0a" "1a" "2a" "3a" "4a" "5a"
180 "6a" "7a" "8a" "9a" "a%" "a." "a," "a*" ]
183 (7680 9450 ; first, last
184 [ "A-0" "a-0" "B." "b." "B-." "b-." "B_" "b_" "C,'" "c,'" ; Lat Ext Add
185 "D." "d." "D-." "d-." "D_" "d_" "D," "d," "D->" "d->"
186 "E-!" "e-!" "E-'" "e-'" "E->" "e->" "E-?" "e-?" "E,(" "e,("
187 "F." "f." "G-" "g-" "H." "h." "H-." "h-." "H:" "h:"
188 "H," "h," "H-(" "h-(" "I-?" "i-?" "I:'" "i:'" "K'" "k'"
189 "K-." "k-." "K_" "k_" "L-." "l-." "_L-." "_l-." "L_" "l_"
190 "L->" "l->" "M'" "m'" "M." "m." "M-." "m-." "N." "n."
191 "N-." "n-." "N_" "n_" "N->" "n->" "O?'" "o?'" "O?:" "o?:"
192 "O-!" "o-!" "O-'" "o-'" "P'" "p'" "P." "p." "R." "r."
193 "R-." "r-." "_R-." "_r-." "R_" "r_" "S." "s." "S-." "s-."
194 "S'." "s'." "S<." "s<." ".S-." ".s-." "T." "t." "T-." "t-."
195 "T_" "t_" "T->" "t->" "U_:" "u_:" "U-?" "u-?" "U->" "u->"
196 "U?'" "u?'" "U-:" "u-:" "V?" "v?" "V-." "v-." "W!" "w!"
197 "W'" "w'" "W:" "w:" "W." "w." "W-." "w-." "X." "x."
198 "X:" "x:" "Y." "y." "Z>" "z>" "Z-." "z-." "Z_" "z_"
199 "h_" "t:" "w0" "y0" "a))" "s1." nil nil nil nil
200 "A-." "a-." "A2" "a2" "A>'" "a>'" "A>!" "a>!" "A>2" "a>2"
201 "A>~" "a>~" ".A>" ".a>" "A('" "a('" "A(!" "a(!" "A(2" "a(2"
202 "A(~" "a(~" ".A(" ".a(" "E-." "e-." "E2" "e2" "E~" "e~"
203 "E>'" "e>'" "E>!" "e>!" "E>2" "e>2" "E>~" "e>~" ".E>" ".e>"
204 "I2" "i2" "I-." "i-." "O-." "o-." "O2" "o2" "O>'" "o>'"
205 "O>!" "o>!" "O>2" "o>2" "O>~" "o>~" ".O>" ".o>" "O9'" "o9'"
206 "O9!" "o9!" "O92" "o92" "O9~" "o9~" ".O9" ".o9" "U-." "u-."
207 "U2" "u2" "U9'" "u9'" "U9!" "u9!" "U92" "u92" "U9~" "u9~"
208 ".U9" ".u9" "Y!" "y!" "Y-." "y-." "Y2" "y2" "Y~" "y~"
209 nil nil nil nil nil nil
"a*," "a*;" nil nil
; Greek Ext (0x1f00)
210 nil nil nil nil
"A*," "A*;" nil nil nil nil
211 nil nil
"e*," "e*;" nil nil nil nil nil nil
212 "E*," "E*;" nil nil nil nil nil nil
"y*," "y*;"
213 nil nil nil nil nil nil
"Y*," "Y*;" nil nil
214 nil nil nil nil
"i*," "i*;" nil nil nil nil
215 nil nil
"I*," "I*;" nil nil nil nil nil nil
216 "o*," "o*;" nil nil nil nil nil nil
"O*," "O*;"
217 nil nil nil nil nil nil
"u*," "u*;" nil nil
218 nil nil nil nil nil
"U*;" nil nil nil nil
219 nil nil
"w*," "w*;" nil nil nil nil nil nil
220 "W*," "W*;" nil nil nil nil nil nil
"a*!" "a*'"
221 "e*!" "e*'" "y*!" "y*'" "i*!" "i*'" "o*!" "o*'" "u*!" "u*'"
222 "w*!" "w*'" nil nil nil nil nil nil nil nil
223 nil nil nil nil nil nil nil nil nil nil
224 nil nil nil nil nil nil nil nil nil nil
225 nil nil nil nil nil nil nil nil nil nil
226 nil nil nil nil nil nil nil nil nil nil
227 nil nil
"a*(" "a*-" nil
"a*j" nil nil
"a*~" nil
228 "A*(" "A*-" "A*!" "A*'" "A*J" ")*" "J3" ",," "?*" "?:"
229 nil
"y*j" nil nil
"y*?" nil
"E*!" "E*'" "Y*!" "Y*'"
230 "Y*J" ",!" ",'" "?," "i*(" "i*-" nil nil nil nil
231 "i*?" nil
"I*(" "I*-" "I*!" "I*'" nil
";!" ";'" "?;"
232 "u*(" "u*-" nil nil
"r*," "r*;" "u*?" nil
"U*(" "U*-"
233 "U*!" "U*'" "R*;" "!:" ":'" "!*" nil nil nil
"w*j"
234 nil nil
"w*?" nil
"O*!" "O*'" "W*!" "W*'" "W*J" "/*"
235 ";;" nil nil nil
"1N" "1M" "3M" "4M" "6M" nil
; Gen Punct
236 nil
"1T" "1H" nil nil nil
"LRM" "RLM" "-" "-"
237 "-" "--" "---" "===" "!2" "=2" "'" "'" ".9" "9'"
238 "\"" "\"" ":9" "9``" "/-" "/=" "sb" "3b" nil
".."
239 "..." ".-" "LSep" "PSep" "LR[" "RL[" "PDF" "LRO" "RLO" 255
240 "%o" "%oo" "'" "''" "\"'" "`" "``" "```" ".^" "<,"
241 ",>" ":X" "!!" "?!" "'-" nil nil nil nil
"-b"
242 "/f" nil nil
"??" "?!" "!?" nil nil nil nil
243 nil nil nil nil nil nil nil nil nil nil
244 nil nil nil nil nil nil nil nil nil nil
245 nil nil nil nil nil nil nil nil nil nil
246 nil nil nil nil
"^0" nil nil nil
"^4" "^5"
247 "^6" "^7" "^8" "^9" "^+" "^-" "^=" "^(" "^)" "^n"
248 "_0" "_1" "_2" "_3" "_4" "_5" "_6" "_7" "_8" "_9"
249 "_+" "_-" "_=" "_(" "_)" nil nil nil nil nil
250 nil nil nil nil nil nil nil nil nil nil
251 nil nil nil nil nil
"Ff" "Li" nil nil
"Pt"
252 nil
"W=" "NIS" nil
"E=" nil nil nil nil nil
253 nil nil nil nil nil nil nil nil nil nil
254 nil nil nil nil nil nil nil nil nil nil
255 nil nil nil nil nil nil nil nil nil nil
256 nil nil nil nil nil nil nil nil nil nil
257 nil nil nil nil nil nil nil nil nil nil
258 nil nil nil nil nil nil nil nil nil nil
259 nil nil nil nil nil nil nil nil nil nil
260 nil nil nil nil nil nil nil nil
"a/c" "a/s"
261 nil
"oC" nil
"c/o" "c/u" "=e" nil
"oF" nil nil
262 nil nil
"-h" "=h" nil nil nil nil nil nil
263 "N0" "PO" nil nil nil nil
"Re" nil
"Rx" nil
264 "SM" "TEL" "TM" nil nil nil
"Om" nil nil nil
265 "oK" "AO" nil nil
"Est" nil nil nil nil nil
266 nil
"Aleph" "Bet" "Gimel" "Dalet" "=i=" nil nil nil nil
267 nil nil nil nil nil nil nil nil nil nil
268 nil nil nil nil nil nil nil nil
"1/7" "1/9"
269 "1/10" "1/3" "2/3" "1/5" "2/5" "3/5" "4/5" "1/6" "5/6" "1/8"
270 "3/8" "5/8" "7/8" "1/" ".I" "II" "III" "IV" ".V" "VI"
271 "VII" "VIII" "IX" "X" "XI" "XII" ".L" ".C" ".D" ".M"
272 ".i" "ii" "iii" "iv" ".v" "vi" "vii" "viii" "ix" ".x"
273 "xi" "xii" ".l" ".c" ".d" ".m" "CD" "DD" "CoD" "CI"
274 nil nil nil nil nil nil nil nil nil nil
275 nil nil
"<-" "|^" "->" "|v" "<->" "v|^" "^\\" "/^"
276 "\\v" "v/" "<-/" "/->" "<~" "~>" "<<-" "|^^" "->>" "|vv"
277 "<-<" ">->" "<-|" "_|^" "|->" "-|v" "_v|^" "<-?" "?->" "<-o"
278 "o->" "<~>" "<-/>" nil nil nil nil nil nil nil
279 nil nil nil nil nil nil nil nil nil nil
280 nil nil nil nil nil nil nil nil nil nil
281 nil nil nil
"<=/" "<=/>" "/=>" "<=" "||^" "=>" "||v"
282 "<=>" "v||^" "^\\\\" "//^" "\\\\v" "v//" "<-=" "=->" nil nil
283 nil nil
"<.." ":^" "..>" ":v" nil nil
"<::" "::^"
284 "::>" "::v" nil nil nil nil nil nil nil nil
285 nil nil nil nil nil nil nil nil nil nil
286 nil nil nil nil
"FA" "C." "dP" "TE" "~TE" "/0"
287 "DE" "NB" "(-" "~(-" "e-" "-)" "~-)" "-e" "QED" "*P"
288 nil
"+Z" "--" "-+" ".+" "./" ".\\" "*-" "Ob" "Sb"
289 "SQR" "CBR" nil
"0(" "00" "-L" "-V" nil nil
".|"
290 "~.|" "||" "/||" "AND" "OR" "(U" ")U" "In" "DI" nil
291 "Io" nil nil nil nil nil
".:" ":." ":R" "::"
292 ".-." "-:" ":-:" ":~:" "?~" "~?" "??" nil nil
"/~"
293 "-~" "~-" "/~-" "~=" "~/=" "/~=" "~~" "/~~" nil nil
294 "=?" ")(" "v^" "^_" ".=" "=;" ".=." nil
":=" "=:"
295 nil
"=o" "=)" "=^" "=v" "*=" "=<>" "=df" nil
"?="
296 "!=" "-=" "!-=" "==" "=<" ">=" nil nil nil nil
297 "<<" ">>" "()" "/)(" "!<" "!>" nil nil nil nil
298 nil nil nil nil nil nil
"<'" "`>" "=<'" "`>="
299 "~<'" "`>~" "/<'" "/`>" "(C" ")C" "/(C" "/)C" "(_" ")_"
300 "/(_" "/)_" nil nil nil nil nil nil nil nil
301 nil nil nil
"0+" "0-" "0x" "0/" "0." "0o" "0*"
302 "0=" "0_" nil nil nil nil
"|-" "-|" "-T" "_T"
303 nil nil nil nil nil nil nil nil nil nil
304 nil nil nil nil nil nil nil nil nil
"-,-"
305 nil
"XOR" "NAND" "NOR" nil nil nil nil nil nil
306 nil nil nil nil nil nil nil nil nil nil
307 nil nil nil nil nil nil nil nil
"<." ".>"
308 "<<<" ">>>" nil nil nil nil nil nil nil nil
309 nil nil nil nil nil nil nil nil nil nil
310 nil nil
":3" "..." nil nil nil nil nil nil
311 nil nil nil nil nil nil nil nil nil nil
312 nil nil
"Eh" nil nil nil nil nil
"<7" ">7"
313 "7<" "7>" nil nil nil nil
"~I" nil
"(A" nil
314 nil
"TR" nil
"=||" "88" nil nil nil nil nil
315 nil nil
"Iu" "Il" nil nil
"-^-" "-`-" "D->" nil
316 nil
"</" "/>" "<-D" nil nil nil nil nil nil
317 nil nil nil nil nil nil nil nil nil nil
318 nil nil nil nil nil nil nil nil nil nil
319 nil nil nil nil nil nil nil nil nil nil
320 nil nil nil nil nil nil nil nil nil nil
321 nil nil nil nil nil nil nil nil nil nil
322 nil nil nil nil nil nil nil nil nil nil
323 nil nil nil nil nil nil nil nil nil nil
324 nil nil nil nil nil nil nil nil nil nil
325 nil nil nil nil nil nil nil nil nil nil
326 nil nil nil nil nil nil nil nil nil nil
327 nil nil nil nil nil nil nil nil nil nil
328 nil nil nil nil nil nil nil nil nil nil
329 nil nil nil nil nil nil nil nil nil nil
330 nil nil nil nil nil nil nil nil nil nil
331 nil nil nil nil nil nil nil nil nil nil
332 nil nil nil nil nil nil nil nil nil nil
333 nil nil nil nil nil nil nil nil nil nil
334 nil nil nil nil nil nil nil nil nil nil
335 nil nil nil nil nil nil nil nil nil nil
336 nil nil nil nil nil nil nil nil nil nil
337 nil nil nil nil nil nil
"NUL" "SOH" "STX" "ETX"
338 "EOT" "ENQ" "ACK" "BEL" "BS" "HT" "LF" "VT" "FF" "CR"
339 "SS" "SI" "DLE" "DC1" "DC2" "DC3" "DC4" "NAK" "SYN" "ETB"
340 "CAN" "EM" "SUB" "ESC" "FS" "GS" "RS" "US" "SP" "DEL"
341 "b/" ",_," "NL" nil
"?^" nil nil nil nil nil
342 nil nil nil nil nil nil nil nil nil nil
343 nil nil nil nil nil nil nil nil nil nil
344 nil nil nil nil nil nil nil nil nil nil
345 nil nil nil nil nil nil nil nil nil nil
346 nil nil nil nil nil nil nil nil nil nil
347 nil nil
"1-o" "2-o" "3-o" "4-o" "5-o" "6-o" "7-o" "8-o"
348 "9-o" "10-o" "11-o" "12-o" "13-o" "14-o" "15-o" "16-o" "17-o" "18-o"
349 "19-o" "20-o" "(1)" "(2)" "(3)" "(4)" "(5)" "(6)" "(7)" "(8)"
350 "(9)" "(10)" "(11)" "(12)" "(13)" "(14)" "(15)" "(16)" "(17)" "(18)"
351 "(19)" "(20)" "1." "2." "3." "4." "5." "6." "7." "8."
352 "9." "10." "11." "12." "13." "14." "15." "16." "17." "18."
353 "19." "20." "(a)" "(b)" "(c)" "(d)" "(e)" "(f)" "(g)" "(h)"
354 "(i)" "(j)" "(k)" "(l)" "(m)" "(n)" "(o)" "(p)" "(q)" "(r)"
355 "(s)" "(t)" "(u)" "(v)" "(w)" "(x)" "(y)" "(z)" "A-o" "B-o"
356 "C-o" "D-o" "E-o" "F-o" "G-o" "H-o" "I-o" "J-o" "K-o" "L-o"
357 "M-o" "N-o" "O-o" "P-o" "Q-o" "R-o" "S-o" "T-o" "U-o" "V-o"
358 "W-o" "X-o" "Y-o" "Z-o" "a-o" "b-o" "c-o" "d-o" "e-o" "f-o"
359 "g-o" "h-o" "i-o" "j-o" "k-o" "l-o" "m-o" "n-o" "o-o" "p-o"
360 "q-o" "r-o" "s-o" "t-o" "u-o" "v-o" "w-o" "x-o" "y-o" "z-o" "0-o" ]
367 "A list of strings that should be used to represent Unicode
368 characters on a DOS terminal which does not have corresponding
369 glyphs built into the installed codepage.")
371 (defun IT-setup-unicode-display (coding &optional table
)
372 "Set up display table TABLE for displaying mule-unicode-* characters
373 on a DOS terminal whose codepage provides the coding-system CODING.
374 If TABLE is nil or omitted, `standard-display-table' is used."
375 (interactive "zCode page: ")
376 (let ((disp-tab (or table standard-display-table
))
377 (tail IT-unicode-translations
)
380 (setq translation
(car tail
) tail
(cdr tail
))
381 (let* ((first (car translation
))
382 (last (nth 1 translation
))
383 (table (nth 2 translation
))
387 (while (<= i
(- last first
))
388 (setq glyph
(aref table i
))
390 (unencodable-char-position 0 1 coding nil
(string this
)))
392 (vconcat (if (numberp glyph
)
395 (setq i
(1+ i
) this
(1+ this
)))))))
397 (defvar dos-codepage
)
398 (defvar dos-country-code
)
400 ;; The following alist was compiled from:
402 ;; Ralf Brown's Interrupt List. file INTERRUP.F, D-2138, Table 01400
403 ;; http://www.ethnologue.com/country_index.asp (official languages)
404 ;; http://unicode.org/onlinedat/languages.html
405 ;; http://unicode.org/onlinedat/countries.html
407 ;; Only the official languages listed for each country.
409 (defvar dos-locale-alist
412 ( 3 .
"es_MX") ; what the heck is "Latin America"?
574 "Alist of MS-DOS country codes and the corresponding locale names.")
576 (defun dos-codepage-setup ()
577 "Set up multilingual environment for the installed DOS codepage.
579 This function sets coding systems, display tables, and the language
580 environment options as appropriate for the current value of `dos-codepage'.
582 This function is automatically run at startup via the `after-init-hook'
583 list. You can (and should) also run it if and when the value of
584 `dos-codepage' changes."
586 (let ((locale (cdr (assq dos-country-code dos-locale-alist
)))
587 (coding (format "cp%s" dos-codepage
))
588 coding-dos coding-unix
)
589 (setq coding-dos
(intern (format "%s-dos" coding
))
590 coding-unix
(intern (format "%s-unix" coding
)))
591 (setq locale
(if locale
592 (format "%s.cp%s" locale dos-codepage
)
594 (set-locale-environment locale
)
595 (set-selection-coding-system coding-dos
)
596 (IT-setup-unicode-display coding-unix
)
597 (prefer-coding-system coding-dos
)
598 (and (default-value 'enable-multibyte-characters
)
599 (setq unibyte-display-via-language-environment t
))
600 ;; Some codepages have sporadic support for Latin-1, Greek, and
601 ;; symbol glyphs, which don't belong to their native character
602 ;; set. It's a nuisance to have all those glyphs here, for all
603 ;; the codepages (for starters, I don't even have references for
604 ;; all the codepages). So provide a hook for those who want to
605 ;; squeeze every bit of support out of their terminal/font.
606 (run-hooks 'dos-codepage-setup-hook
)
609 (provide 'term
/internal
)
611 ;;; internal.el ends here