diff options
| author | Eli Zaretskii | 2008-10-01 16:23:28 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2008-10-01 16:23:28 +0000 |
| commit | 4009e4f837db0145a32c6d66a5862eb7adcb2a27 (patch) | |
| tree | 1641cc7b516d94f6c5cb55d53520dd4990f55ccf | |
| parent | 970c93912747b36cecfa7586ea2d08755061e534 (diff) | |
| download | emacs-4009e4f837db0145a32c6d66a5862eb7adcb2a27.tar.gz emacs-4009e4f837db0145a32c6d66a5862eb7adcb2a27.zip | |
(dos-locale-alist): New alist.
(dos-codepage-setup): Use it to compute a value of locale with which to call
set-locale-environment. Remove code to set terminal, keyboard, and
file-name encoding (done by set-locale-environment).
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/term/internal.el | 193 |
2 files changed, 191 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4c5fbe99dcd..28a7d514f4f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2008-10-01 Eli Zaretskii <eliz@gnu.org> | 1 | 2008-10-01 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * term/internal.el (dos-locale-alist): New alist. | ||
| 4 | (dos-codepage-setup): Use it to compute a value of locale with | ||
| 5 | which to call set-locale-environment. Remove code to set | ||
| 6 | terminal, keyboard, and file-name encoding (done by | ||
| 7 | set-locale-environment). | ||
| 8 | |||
| 3 | * international/mule-cmds.el | 9 | * international/mule-cmds.el |
| 4 | (set-language-environment-nonascii-translation): Fix nonascii | 10 | (set-language-environment-nonascii-translation): Fix nonascii |
| 5 | value for `pc' ``window-system''. | 11 | value for `pc' ``window-system''. |
diff --git a/lisp/term/internal.el b/lisp/term/internal.el index 3e053189d15..d6f9843cd97 100644 --- a/lisp/term/internal.el +++ b/lisp/term/internal.el | |||
| @@ -409,6 +409,183 @@ If TABLE is nil or omitted, `standard-display-table' is used." | |||
| 409 | (setq i (1+ i) this (1+ this))))))) | 409 | (setq i (1+ i) this (1+ this))))))) |
| 410 | 410 | ||
| 411 | (defvar dos-codepage) | 411 | (defvar dos-codepage) |
| 412 | (defvar dos-country-code) | ||
| 413 | |||
| 414 | ;; The following alist was compiled from: | ||
| 415 | ;; | ||
| 416 | ;; Ralf Brown's Interrupt List. file INTERRUP.F, D-2138, Table 01400 | ||
| 417 | ;; http://www.ethnologue.com/country_index.asp (official languages) | ||
| 418 | ;; http://unicode.org/onlinedat/languages.html | ||
| 419 | ;; http://unicode.org/onlinedat/countries.html | ||
| 420 | ;; | ||
| 421 | ;; Only the official languages listed for each country. | ||
| 422 | ;; | ||
| 423 | (defvar dos-locale-alist | ||
| 424 | '(( 1 . "en_US") | ||
| 425 | ( 2 . "fr_CA") | ||
| 426 | ( 3 . "es_MX") ; what the heck is "Latin America"? | ||
| 427 | ( 4 . "en_CA") | ||
| 428 | ( 7 . "ru_RU") | ||
| 429 | ( 20 . "ar_EG") | ||
| 430 | ( 27 . "af_ZA") | ||
| 431 | ( 30 . "el_GR") | ||
| 432 | ( 31 . "nl_NL") | ||
| 433 | ( 32 . "nl_BE") | ||
| 434 | ( 33 . "fr_FR") | ||
| 435 | ( 34 . "es_ES") | ||
| 436 | ( 35 . "bg_BG") | ||
| 437 | ( 36 . "hu_HU") | ||
| 438 | ( 38 . "sh_YU") | ||
| 439 | ( 39 . "it_IT") | ||
| 440 | ( 40 . "ro_RO") | ||
| 441 | ( 41 . "de_CH") | ||
| 442 | ( 42 . "cs_CZ") | ||
| 443 | ( 43 . "de_AT") | ||
| 444 | ( 44 . "en_UK") | ||
| 445 | ( 45 . "da_DK") | ||
| 446 | ( 46 . "sv_SE") | ||
| 447 | ( 47 . "no_NO") | ||
| 448 | ( 48 . "pl_PL") | ||
| 449 | ( 49 . "de_DE") | ||
| 450 | ( 51 . "es_PE") | ||
| 451 | ( 52 . "es_MX") | ||
| 452 | ( 53 . "es_CU") | ||
| 453 | ( 54 . "es_AR") | ||
| 454 | ( 55 . "pt_BR") | ||
| 455 | ( 56 . "es_CL") | ||
| 456 | ( 57 . "es_CO") | ||
| 457 | ( 58 . "es_VE") | ||
| 458 | ( 60 . "ms_MY") | ||
| 459 | ( 61 . "en_AU") | ||
| 460 | ( 62 . "id_ID") | ||
| 461 | ( 63 . "fil_PH") | ||
| 462 | ( 64 . "en_NZ") | ||
| 463 | ( 65 . "zh_SG") | ||
| 464 | ( 66 . "th_TH") | ||
| 465 | ( 81 . "ja_JP") | ||
| 466 | ( 82 . "ko_KR") | ||
| 467 | ( 84 . "vi_VN") | ||
| 468 | ( 86 . "zh_CN") | ||
| 469 | ( 88 . "zh_TW") | ||
| 470 | ( 90 . "tr_TR") | ||
| 471 | ( 91 . "hi_IN") | ||
| 472 | ( 92 . "ur_PK") | ||
| 473 | ( 93 . "ps_AF") | ||
| 474 | ( 94 . "si_LK") | ||
| 475 | ( 98 . "fa_IR") | ||
| 476 | ( 99 . "en" ) | ||
| 477 | (102 . "he_IL") | ||
| 478 | (112 . "be_BY") | ||
| 479 | (212 . "ar_MA") | ||
| 480 | (213 . "ar_DZ") | ||
| 481 | (216 . "ar_TN") | ||
| 482 | (218 . "ar_LY") | ||
| 483 | (220 . "en_GM") | ||
| 484 | (221 . "fr_SN") | ||
| 485 | (222 . "mey_MR") | ||
| 486 | (223 . "fr_ML") | ||
| 487 | (224 . "fr_GN") | ||
| 488 | (227 . "fr_NE") | ||
| 489 | (228 . "fr_TG") | ||
| 490 | (230 . "fr_MU") | ||
| 491 | (231 . "en_LR") | ||
| 492 | (232 . "en_SL") | ||
| 493 | (233 . "en_GH") | ||
| 494 | (234 . "en_NG") | ||
| 495 | (235 . "ar_TD") | ||
| 496 | (236 . "fr_CF") | ||
| 497 | (237 . "fr_CM") | ||
| 498 | (241 . "fr_GA") | ||
| 499 | (242 . "fr_CG") | ||
| 500 | (243 . "sw_ZR") | ||
| 501 | (244 . "pt_AO") | ||
| 502 | (245 . "pt_GW") | ||
| 503 | (249 . "ar_SD") | ||
| 504 | (250 . "fr_RW") | ||
| 505 | (251 . "am_ET") | ||
| 506 | (252 . "so_SO") | ||
| 507 | (253 . "fr_DJ") | ||
| 508 | (254 . "sw_KE") | ||
| 509 | (255 . "sw_TZ") | ||
| 510 | (256 . "en_UG") | ||
| 511 | (257 . "fr_BI") | ||
| 512 | (259 . "pt_MZ") | ||
| 513 | (260 . "en_ZM") | ||
| 514 | (261 . "mg_MG") | ||
| 515 | (263 . "en_ZW") | ||
| 516 | (264 . "en_NA") | ||
| 517 | (265 . "en_MW") | ||
| 518 | (266 . "st_LS") | ||
| 519 | (267 . "en_BW") | ||
| 520 | (268 . "en_SZ") | ||
| 521 | (299 . "kl_GL") | ||
| 522 | (350 . "en_GI") | ||
| 523 | (351 . "pt_PT") | ||
| 524 | (352 . "fr_LU") | ||
| 525 | (353 . "ga_IE") | ||
| 526 | (354 . "is_IS") | ||
| 527 | (355 . "sq_AL") | ||
| 528 | (356 . "mt_MT") | ||
| 529 | (357 . "gr_CY") | ||
| 530 | (358 . "fi_FI") | ||
| 531 | (359 . "bg_BG") | ||
| 532 | (370 . "lt_LT") | ||
| 533 | (371 . "lv_LV") | ||
| 534 | (372 . "et_EE") | ||
| 535 | (373 . "mo_MD") | ||
| 536 | (380 . "uk_UA") | ||
| 537 | (381 . "sr_RS") | ||
| 538 | (384 . "hr_HR") | ||
| 539 | (385 . "hr_HR") | ||
| 540 | (386 . "sl_SI") | ||
| 541 | (387 . "bs_BA") | ||
| 542 | (388 . "sr_BA") | ||
| 543 | (389 . "mk_MK") | ||
| 544 | (421 . "cs_CZ") | ||
| 545 | (422 . "sk_SK") | ||
| 546 | (502 . "es_GT") | ||
| 547 | (503 . "es_SV") | ||
| 548 | (504 . "es_HN") | ||
| 549 | (505 . "es_NI") | ||
| 550 | (506 . "es_CR") | ||
| 551 | (507 . "es_PA") | ||
| 552 | (509 . "ht_HT") | ||
| 553 | (590 . "fr_GP") | ||
| 554 | (591 . "es_BO") | ||
| 555 | (592 . "en_GY") | ||
| 556 | (593 . "es_EC") | ||
| 557 | (594 . "fr_GF") | ||
| 558 | (595 . "gn_PY") | ||
| 559 | (596 . "fr_MQ") | ||
| 560 | (597 . "nl_SR") | ||
| 561 | (598 . "es_UY") | ||
| 562 | (785 . "ar" ) | ||
| 563 | (804 . "uk_UA") | ||
| 564 | (850 . "ko_KP") | ||
| 565 | (855 . "km_KH") | ||
| 566 | (856 . "lo_LA") | ||
| 567 | (880 . "bn_BD") | ||
| 568 | (886 . "zh_TW") | ||
| 569 | (960 . "dv_MV") | ||
| 570 | (961 . "ar_LB") | ||
| 571 | (962 . "ar_JO") | ||
| 572 | (963 . "ar_SY") | ||
| 573 | (964 . "ar_IQ") | ||
| 574 | (965 . "ar_KW") | ||
| 575 | (966 . "ar_SA") | ||
| 576 | (967 . "ar_YE") | ||
| 577 | (968 . "ar_OM") | ||
| 578 | (969 . "ar_YE") | ||
| 579 | (971 . "ar_AE") | ||
| 580 | (972 . "he_IL") | ||
| 581 | (973 . "ar_BH") | ||
| 582 | (974 . "ar_QA") | ||
| 583 | (975 . "dz_BT") | ||
| 584 | (976 . "mn_MN") | ||
| 585 | (977 . "ne_NP") | ||
| 586 | (995 . "my_MM") | ||
| 587 | ) | ||
| 588 | "Alist of MS-DOS country codes and the corresponding locale names.") | ||
| 412 | 589 | ||
| 413 | (defun dos-codepage-setup () | 590 | (defun dos-codepage-setup () |
| 414 | "Set up multilingual environment for the installed DOS codepage. | 591 | "Set up multilingual environment for the installed DOS codepage. |
| @@ -417,19 +594,19 @@ This function sets coding systems, display tables, and the language | |||
| 417 | environment options as appropriate for the current value of `dos-codepage'. | 594 | environment options as appropriate for the current value of `dos-codepage'. |
| 418 | 595 | ||
| 419 | This function is automatically run at startup via the `after-init-hook' | 596 | This function is automatically run at startup via the `after-init-hook' |
| 420 | list. You can (and should) also run it whenever the value of | 597 | list. You can (and should) also run it if and when the value of |
| 421 | `dos-codepage' changes." | 598 | `dos-codepage' changes." |
| 422 | (interactive) | 599 | (interactive) |
| 423 | (let* ((coding (format "cp%s" dos-codepage)) | 600 | (let ((locale (cdr (assq dos-country-code dos-locale-alist))) |
| 424 | coding-dos coding-unix) | 601 | (coding (format "cp%s" dos-codepage)) |
| 602 | coding-dos coding-unix) | ||
| 425 | (setq coding-dos (intern (format "%s-dos" coding)) | 603 | (setq coding-dos (intern (format "%s-dos" coding)) |
| 426 | coding-unix (intern (format "%s-unix" coding))) | 604 | coding-unix (intern (format "%s-unix" coding))) |
| 427 | ;(set-language-environment lang) FIXME | 605 | (setq locale (if locale |
| 428 | (set-default-coding-systems coding-dos) | 606 | (format "%s.cp%s" locale dos-codepage) |
| 607 | "en_US.cp437")) | ||
| 608 | (set-locale-environment locale) | ||
| 429 | (set-selection-coding-system coding-dos) | 609 | (set-selection-coding-system coding-dos) |
| 430 | (setq file-name-coding-system coding-unix) | ||
| 431 | (set-terminal-coding-system | ||
| 432 | (setq default-terminal-coding-system coding-unix)) | ||
| 433 | (IT-setup-unicode-display coding-unix) | 610 | (IT-setup-unicode-display coding-unix) |
| 434 | (prefer-coding-system coding-dos) | 611 | (prefer-coding-system coding-dos) |
| 435 | (and default-enable-multibyte-characters | 612 | (and default-enable-multibyte-characters |