aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert1999-10-22 22:51:33 +0000
committerPaul Eggert1999-10-22 22:51:33 +0000
commit6ececc4d6e09c44b6de22862081ba06d8432b871 (patch)
treed133242bb190a7a07199b423f7ac52a9f5af9504
parent0b61dad2f1d7a049f45e65b31718314f3428663e (diff)
downloademacs-6ececc4d6e09c44b6de22862081ba06d8432b871.tar.gz
emacs-6ececc4d6e09c44b6de22862081ba06d8432b871.zip
* (locale-language-names):
Use Latin-1 (not Latin-3) for Afrikaans, Galician. Use Latin-5 (not Cyrillic-ISO) for Byelorussian, Bulgarian, Macedonian, Russian, Ukrainian, Serbian (Cyrillic alphabet). Use Latin-8 for Welsh. Use Latin-1 for English if "en" is explicitly specified. Use Latin-1 for Scots Gaelic, Tagalog. Use Latin-1 (not Latin-4) for Greenlandic. Use Latin-1 (not Latin-2) for Albanian. (locale-preferred-coding-systems, locale-language-names): Remove generic ISO 8859 locales; locale-charset-language-names now does this. (locale-charset-language-names): New variable. (set-locale-environment): Use language name specified by locale-charset-language-names if its charsets disagree with the language name specified by locale-language-names.
-rw-r--r--lisp/international/mule-cmds.el93
1 files changed, 50 insertions, 43 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 353f09d0d77..775b5808a11 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1471,15 +1471,15 @@ of buffer-file-coding-system set by this function."
1471 ;; 1471 ;;
1472 ; aa Afar 1472 ; aa Afar
1473 ; ab Abkhazian 1473 ; ab Abkhazian
1474 ("af" . "Latin-3") ; Afrikaans 1474 ("af" . "Latin-1") ; Afrikaans
1475 ("am" . "Ethiopic") ; Amharic 1475 ("am" . "Ethiopic") ; Amharic
1476 ; ar Arabic 1476 ; ar Arabic
1477 ; as Assamese 1477 ; as Assamese
1478 ; ay Aymara 1478 ; ay Aymara
1479 ; az Azerbaijani 1479 ; az Azerbaijani
1480 ; ba Bashkir 1480 ; ba Bashkir
1481 ("be" . "Cyrillic-ISO") ; Byelorussian 1481 ("be" . "Latin-5") ; Byelorussian
1482 ("bg" . "Cyrillic-ISO") ; Bulgarian 1482 ("bg" . "Latin-5") ; Bulgarian
1483 ; bh Bihari 1483 ; bh Bihari
1484 ; bi Bislama 1484 ; bi Bislama
1485 ; bn Bengali, Bangla 1485 ; bn Bengali, Bangla
@@ -1488,12 +1488,13 @@ of buffer-file-coding-system set by this function."
1488 ("ca" . "Latin-1") ; Catalan 1488 ("ca" . "Latin-1") ; Catalan
1489 ; co Corsican 1489 ; co Corsican
1490 ("cs" . "Czech") 1490 ("cs" . "Czech")
1491 ; cy Welsh 1491 ("cy" . "Latin-8") ; Welsh
1492 ("da" . "Latin-1") ; Danish 1492 ("da" . "Latin-1") ; Danish
1493 ("de" . "German") 1493 ("de" . "German")
1494 ; dz Bhutani 1494 ; dz Bhutani
1495 ("el" . "Greek") 1495 ("el" . "Greek")
1496 ("en" . "English") 1496 ;; Users who specify "en" explicitly typically want Latin-1, not ASCII.
1497 ("en" . "Latin-1") ; English
1497 ("eo" . "Latin-3") ; Esperanto 1498 ("eo" . "Latin-3") ; Esperanto
1498 ("es" . "Latin-1") ; Spanish 1499 ("es" . "Latin-1") ; Spanish
1499 ("et" . "Latin-4") ; Estonian 1500 ("et" . "Latin-4") ; Estonian
@@ -1504,9 +1505,9 @@ of buffer-file-coding-system set by this function."
1504 ("fo" . "Latin-1") ; Faroese 1505 ("fo" . "Latin-1") ; Faroese
1505 ("fr" . "Latin-1") ; French 1506 ("fr" . "Latin-1") ; French
1506 ("fy" . "Latin-1") ; Frisian 1507 ("fy" . "Latin-1") ; Frisian
1507 ("ga" . "Latin-1") ; Irish 1508 ("ga" . "Latin-1") ; Irish Gaelic (new orthography)
1508 ; gd Scots Gaelic 1509 ("gd" . "Latin-1") ; Scots Gaelic
1509 ("gl" . "Latin-3") ; Galician 1510 ("gl" . "Latin-1") ; Galician
1510 ; gn Guarani 1511 ; gn Guarani
1511 ; gu Gujarati 1512 ; gu Gujarati
1512 ; ha Hausa 1513 ; ha Hausa
@@ -1526,7 +1527,7 @@ of buffer-file-coding-system set by this function."
1526 ; jw Javanese 1527 ; jw Javanese
1527 ; ka Georgian 1528 ; ka Georgian
1528 ; kk Kazakh 1529 ; kk Kazakh
1529 ("kl" . "Latin-4") ; Greenlandic 1530 ("kl" . "Latin-1") ; Greenlandic
1530 ; km Cambodian 1531 ; km Cambodian
1531 ; kn Kannada 1532 ; kn Kannada
1532 ("ko" . "Korean") 1533 ("ko" . "Korean")
@@ -1540,7 +1541,7 @@ of buffer-file-coding-system set by this function."
1540 ("lv" . "Latin-4") ; Latvian, Lettish 1541 ("lv" . "Latin-4") ; Latvian, Lettish
1541 ; mg Malagasy 1542 ; mg Malagasy
1542 ; mi Maori 1543 ; mi Maori
1543 ("mk" . "Cyrillic-ISO") ; Macedonian 1544 ("mk" . "Latin-5") ; Macedonian
1544 ; ml Malayalam 1545 ; ml Malayalam
1545 ; mn Mongolian 1546 ; mn Mongolian
1546 ; mo Moldavian 1547 ; mo Moldavian
@@ -1560,11 +1561,11 @@ of buffer-file-coding-system set by this function."
1560 ; ps Pashto, Pushto 1561 ; ps Pashto, Pushto
1561 ("pt" . "Latin-1") ; Portuguese 1562 ("pt" . "Latin-1") ; Portuguese
1562 ; qu Quechua 1563 ; qu Quechua
1563 ("rm" . "Latin-1") ; Rhaeto-Romance 1564 ("rm" . "Latin-1") ; Rhaeto-Romanic
1564 ; rn Kirundi 1565 ; rn Kirundi
1565 ("ro" . "Romanian") 1566 ("ro" . "Romanian")
1566 ("ru.*[_.]koi8" . "Cyrillic-KOI8") ; Russian 1567 ("ru.*[_.]koi8" . "Cyrillic-KOI8") ; Russian
1567 ("ru" . "Cyrillic-ISO") ; Russian 1568 ("ru" . "Latin-5") ; Russian
1568 ; rw Kinyarwanda 1569 ; rw Kinyarwanda
1569 ("sa" . "Devanagari") ; Sanskrit 1570 ("sa" . "Devanagari") ; Sanskrit
1570 ; sd Sindhi 1571 ; sd Sindhi
@@ -1576,7 +1577,7 @@ of buffer-file-coding-system set by this function."
1576 ; sm Samoan 1577 ; sm Samoan
1577 ; sn Shona 1578 ; sn Shona
1578 ; so Somali 1579 ; so Somali
1579 ("sq" . "Latin-2") ; Albanian 1580 ("sq" . "Latin-1") ; Albanian
1580 ("sr" . "Latin-2") ; Serbian (Latin alphabet) 1581 ("sr" . "Latin-2") ; Serbian (Latin alphabet)
1581 ; ss Siswati 1582 ; ss Siswati
1582 ; st Sesotho 1583 ; st Sesotho
@@ -1589,7 +1590,7 @@ of buffer-file-coding-system set by this function."
1589 ("th" . "Thai") 1590 ("th" . "Thai")
1590 ; ti Tigrinya 1591 ; ti Tigrinya
1591 ; tk Turkmen 1592 ; tk Turkmen
1592 ; tl Tagalog 1593 ("tl" . "Latin-1") ; Tagalog
1593 ; tn Setswana 1594 ; tn Setswana
1594 ; to Tonga 1595 ; to Tonga
1595 ("tr" . "Latin-5") ; Turkish 1596 ("tr" . "Latin-5") ; Turkish
@@ -1597,7 +1598,7 @@ of buffer-file-coding-system set by this function."
1597 ; tt Tatar 1598 ; tt Tatar
1598 ; tw Twi 1599 ; tw Twi
1599 ; ug Uighur 1600 ; ug Uighur
1600 ("uk" . "Cyrillic-ISO") ; Ukrainian 1601 ("uk" . "Latin-5") ; Ukrainian
1601 ; ur Urdu 1602 ; ur Urdu
1602 ; uz Uzbek 1603 ; uz Uzbek
1603 ("vi" . "Vietnamese") 1604 ("vi" . "Vietnamese")
@@ -1617,15 +1618,6 @@ of buffer-file-coding-system set by this function."
1617 ("c$" . "ASCII") 1618 ("c$" . "ASCII")
1618 ("posix$" . "ASCII") 1619 ("posix$" . "ASCII")
1619 1620
1620 ;; generic ISO 8859 locales
1621 (".*8859[-_]?1" . "Latin-1")
1622 (".*8859[-_]?2" . "Latin-2")
1623 (".*8859[-_]?3" . "Latin-3")
1624 (".*8859[-_]?4" . "Latin-4")
1625 (".*8859[-_]?9" . "Latin-5")
1626 (".*8859[-_]?14" . "Latin-8")
1627 (".*8859[-_]?15" . "Latin-9")
1628
1629 ;; The "IPA" Emacs language environment does not correspond 1621 ;; The "IPA" Emacs language environment does not correspond
1630 ;; to any ISO 639 code, so let it stand for itself. 1622 ;; to any ISO 639 code, so let it stand for itself.
1631 ("ipa$" . "IPA") 1623 ("ipa$" . "IPA")
@@ -1634,32 +1626,38 @@ of buffer-file-coding-system set by this function."
1634 ("cz" . "Czech") ; e.g. Solaris 2.6 1626 ("cz" . "Czech") ; e.g. Solaris 2.6
1635 ("ee" . "Latin-4") ; Estonian, e.g. X11R6.4 1627 ("ee" . "Latin-4") ; Estonian, e.g. X11R6.4
1636 ("iw" . "Hebrew") ; e.g. X11R6.4 1628 ("iw" . "Hebrew") ; e.g. X11R6.4
1637 ("sp" . "Cyrillic-ISO") ; Serbian (Cyrillic alphabet), e.g. X11R6.4 1629 ("sp" . "Latin-5") ; Serbian (Cyrillic alphabet), e.g. X11R6.4
1638 ("su" . "Latin-1") ; Finnish, e.g. Solaris 2.6 1630 ("su" . "Latin-1") ; Finnish, e.g. Solaris 2.6
1639 ) 1631 )
1640 "List of pairs of locale regexps and language names. 1632 "List of pairs of locale regexps and language names.
1641The first element whose locale regexp matches the start of a downcased 1633The first element whose locale regexp matches the start of a downcased locale
1642locale specifies the language name corresponding to that locale. 1634specifies the language name corresponding to that locale.
1643If the language name is nil, there is no corresponding language environment.") 1635If the language name is nil, there is no corresponding language environment.")
1644 1636
1637(defvar locale-charset-language-names
1638 '((".*8859[-_]?1\\>" . "Latin-1")
1639 (".*8859[-_]?2\\>" . "Latin-2")
1640 (".*8859[-_]?3\\>" . "Latin-3")
1641 (".*8859[-_]?4\\>" . "Latin-4")
1642 (".*8859[-_]?9\\>" . "Latin-5")
1643 (".*8859[-_]?14\\>" . "Latin-8")
1644 (".*8859[-_]?15\\>" . "Latin-9")
1645 )
1646 "List of pairs of locale regexps and charset language names.
1647The first element whose locale regexp matches the start of a downcased locale
1648specifies the language name whose charsets corresponds to that locale.
1649This language name is used if its charsets disagree with the charsets of
1650the language name that would otherwise be used for this locale.")
1651
1645(defvar locale-preferred-coding-systems 1652(defvar locale-preferred-coding-systems
1646 '(("ja.*[._]euc" . japanese-iso-8bit) 1653 '(("ja.*[._]euc" . japanese-iso-8bit)
1647 ("ja.*[._]jis7" . iso-2022-jp) 1654 ("ja.*[._]jis7" . iso-2022-jp)
1648 ("ja.*[._]pck" . japanese-shift-jis) 1655 ("ja.*[._]pck" . japanese-shift-jis)
1649 ("ja.*[._]sjis" . japanese-shift-jis) 1656 ("ja.*[._]sjis" . japanese-shift-jis)
1650 (".*[._].*8859[-_]?1" . iso-8859-1)
1651 (".*[._].*8859[-_]?2" . iso-8859-2)
1652 (".*[._].*8859[-_]?3" . iso-8859-3)
1653 (".*[._].*8859[-_]?4" . iso-8859-4)
1654 (".*[._].*8859[-_]?5" . iso-8859-5)
1655 (".*[._].*8859[-_]?7" . iso-8859-7)
1656 (".*[._].*8859[-_]?8" . iso-8859-8)
1657 (".*[._].*8859[-_]?9" . iso-8859-9)
1658 ) 1657 )
1659 "List of pairs of locale regexps and coding systems. 1658 "List of pairs of locale regexps and preferred coding systems.
1660The first element whose locale regexp matches the start of a downcased 1659The first element whose locale regexp matches the start of a downcased locale
1661locale specifies the coding system to prefer when using that locale. 1660specifies the coding system to prefer when using that locale.")
1662If the coding system is nil, there is no special preference.")
1663 1661
1664(defun locale-name-match (key alist) 1662(defun locale-name-match (key alist)
1665 "Search for KEY in ALIST, which should be a list of regexp-value pairs. 1663 "Search for KEY in ALIST, which should be a list of regexp-value pairs.
@@ -1707,10 +1705,19 @@ directory named `/usr/share/locale' or `/usr/lib/locale'."
1707 1705
1708 (setq locale-name (downcase locale-name)) 1706 (setq locale-name (downcase locale-name))
1709 1707
1710 (let ((language-name (locale-name-match 1708 (let ((language-name
1711 locale-name locale-language-names)) 1709 (locale-name-match locale-name locale-language-names))
1712 (coding-system (locale-name-match 1710 (charset-language-name
1713 locale-name locale-preferred-coding-systems))) 1711 (locale-name-match locale-name locale-charset-language-names))
1712 (coding-system
1713 (locale-name-match locale-name locale-preferred-coding-systems)))
1714
1715 (if (and charset-language-name
1716 (not
1717 (equal (get-language-info language-name 'charset)
1718 (get-language-info charset-language-name 'charset))))
1719 (setq language-name charset-language-name))
1720
1714 (when language-name 1721 (when language-name
1715 1722
1716 ;; Set up for this character set. This is now the right way 1723 ;; Set up for this character set. This is now the right way