167 |
;; but it won't be used that frequently. |
;; but it won't be used that frequently. |
168 |
(define-key global-map "\C-\\" 'toggle-input-method) |
(define-key global-map "\C-\\" 'toggle-input-method) |
169 |
|
|
170 |
;;; This is no good because people often type Shift-SPC |
;; This is no good because people often type Shift-SPC |
171 |
;;; meaning to type SPC. -- rms. |
;; meaning to type SPC. -- rms. |
172 |
;;; ;; Here's an alternative key binding for X users (Shift-SPACE). |
;; ;; Here's an alternative key binding for X users (Shift-SPACE). |
173 |
;;; (define-key global-map [?\S- ] 'toggle-input-method) |
;; (define-key global-map [?\S- ] 'toggle-input-method) |
174 |
|
|
175 |
;;; Mule related hyperlinks. |
;;; Mule related hyperlinks. |
176 |
(defconst help-xref-mule-regexp-template |
(defconst help-xref-mule-regexp-template |
1155 |
(activate-input-method current)) |
(activate-input-method current)) |
1156 |
(error |
(error |
1157 |
(activate-input-method current) |
(activate-input-method current) |
1158 |
(with-output-to-temp-buffer "*Help*" |
(help-setup-xref (list #'describe-input-method input-method) |
1159 |
|
(interactive-p)) |
1160 |
|
(with-output-to-temp-buffer (help-buffer) |
1161 |
(let ((elt (assoc input-method input-method-alist))) |
(let ((elt (assoc input-method input-method-alist))) |
1162 |
(princ (format |
(princ (format |
1163 |
"Input method: %s (`%s' in mode line) for %s\n %s\n" |
"Input method: %s (`%s' in mode line) for %s\n %s\n" |
1391 |
;; Don't alter the terminal and keyboard coding systems here. |
;; Don't alter the terminal and keyboard coding systems here. |
1392 |
;; The terminal still supports the same coding system |
;; The terminal still supports the same coding system |
1393 |
;; that it supported a minute ago. |
;; that it supported a minute ago. |
1394 |
;;; (set-terminal-coding-system-internal nil) |
;; (set-terminal-coding-system-internal nil) |
1395 |
;;; (set-keyboard-coding-system-internal nil) |
;; (set-keyboard-coding-system-internal nil) |
1396 |
|
|
1397 |
(setq nonascii-translation-table nil |
(setq nonascii-translation-table nil |
1398 |
nonascii-insert-offset 0)) |
nonascii-insert-offset 0)) |
1428 |
(let ((func (get-language-info current-language-environment |
(let ((func (get-language-info current-language-environment |
1429 |
'exit-function))) |
'exit-function))) |
1430 |
(run-hooks 'exit-language-environment-hook) |
(run-hooks 'exit-language-environment-hook) |
1431 |
(if (fboundp func) (funcall func)))) |
(if (functionp func) (funcall func)))) |
1432 |
(let ((default-eol-type (coding-system-eol-type |
(let ((default-eol-type (coding-system-eol-type |
1433 |
default-buffer-file-coding-system))) |
default-buffer-file-coding-system))) |
1434 |
(reset-language-environment) |
(reset-language-environment) |
1488 |
(require (car required-features)) |
(require (car required-features)) |
1489 |
(setq required-features (cdr required-features)))) |
(setq required-features (cdr required-features)))) |
1490 |
(let ((func (get-language-info language-name 'setup-function))) |
(let ((func (get-language-info language-name 'setup-function))) |
1491 |
(if (fboundp func) |
(if (functionp func) |
1492 |
(funcall func))) |
(funcall func))) |
1493 |
(run-hooks 'set-language-environment-hook) |
(run-hooks 'set-language-environment-hook) |
1494 |
(force-mode-line-update t)) |
(force-mode-line-update t)) |
1509 |
(aset standard-display-table 2208 [32]) ; Latin-1 NBSP |
(aset standard-display-table 2208 [32]) ; Latin-1 NBSP |
1510 |
;; Most Windows programs send out apostrophes as \222. Most X fonts |
;; Most Windows programs send out apostrophes as \222. Most X fonts |
1511 |
;; don't contain a character at that position. Map it to the ASCII |
;; don't contain a character at that position. Map it to the ASCII |
1512 |
;; apostrophe. [This is actually RIGHT SINGLE QUOTATION MARK |
;; apostrophe. [This is actually RIGHT SINGLE QUOTATION MARK, |
1513 |
;; from the cp1252, aka Windows-1252 character set. --fx] |
;; U+2019, normally from the windows-1252 character set. XFree 4 |
1514 |
|
;; fonts probably have the appropriate glyph at this position, |
1515 |
|
;; so they could use standard-display-8bit. It's better to use a |
1516 |
|
;; proper windows-1252 coding system. --fx] |
1517 |
(aset standard-display-table 146 [39])))) |
(aset standard-display-table 146 [39])))) |
1518 |
|
|
1519 |
(defun set-language-environment-coding-systems (language-name |
(defun set-language-environment-coding-systems (language-name |
1653 |
(defvar locale-translation-file-name nil |
(defvar locale-translation-file-name nil |
1654 |
"File name for the system's file of locale-name aliases, or nil if none.") |
"File name for the system's file of locale-name aliases, or nil if none.") |
1655 |
|
|
1656 |
(defvar locale-language-names |
;; The following definitions might as well be marked as constants and |
1657 |
'( |
;; purecopied, since they're normally used on startup, and probably |
1658 |
;; UTF-8 is not yet implemented. |
;; should reflect the facilities of the base Emacs. |
1659 |
;; Put this first, so that e.g. "ko.UTF-8" does not match "ko" below. |
(defconst locale-language-names |
1660 |
(".*[._]utf" . nil) |
(purecopy |
1661 |
|
'( |
1662 |
|
;; UTF-8 is not yet implemented. |
1663 |
|
;; Put this first, so that e.g. "ko.UTF-8" does not match "ko" below. |
1664 |
|
(".*[._]utf" . nil) |
1665 |
|
|
1666 |
;; Locale names of the form LANGUAGE[_TERRITORY][.CODESET][@MODIFIER] |
;; Locale names of the form LANGUAGE[_TERRITORY][.CODESET][@MODIFIER] |
1667 |
;; as specified in the Single Unix Spec, Version 2. |
;; as specified in the Single Unix Spec, Version 2. |
1668 |
;; LANGUAGE is a language code taken from ISO 639:1988 (E/F) |
;; LANGUAGE is a language code taken from ISO 639:1988 (E/F) |
1669 |
;; with additions from ISO 639/RA Newsletter No.1/1989; |
;; with additions from ISO 639/RA Newsletter No.1/1989; |
1670 |
;; see Internet RFC 2165 (1997-06). |
;; see Internet RFC 2165 (1997-06) and |
1671 |
;; TERRITORY is a country code taken from ISO 3166. |
;; http://www.evertype.com/standards/iso639/iso639-en.html |
1672 |
|
;; TERRITORY is a country code taken from ISO 3166 |
1673 |
|
;; http://www.din.de/gremien/nas/nabd/iso3166ma/codlstp1/en_listp1.html. |
1674 |
;; CODESET and MODIFIER are implementation-dependent. |
;; CODESET and MODIFIER are implementation-dependent. |
1675 |
;; |
|
1676 |
; aa Afar |
; aa Afar |
1677 |
; ab Abkhazian |
; ab Abkhazian |
1678 |
("af" . "Latin-1") ; Afrikaans |
("af" . "Latin-1") ; Afrikaans |
1679 |
("am" . "Ethiopic") ; Amharic |
("am" . "Ethiopic") ; Amharic |
1680 |
; ar Arabic |
; ar Arabic glibc uses 8859-6 |
1681 |
; as Assamese |
; as Assamese |
1682 |
; ay Aymara |
; ay Aymara |
1683 |
; az Azerbaijani |
; az Azerbaijani |
1714 |
("gl" . "Latin-1") ; Galician |
("gl" . "Latin-1") ; Galician |
1715 |
; gn Guarani |
; gn Guarani |
1716 |
; gu Gujarati |
; gu Gujarati |
1717 |
|
("gv" . "Latin-8") ; Manx Gaelic |
1718 |
; ha Hausa |
; ha Hausa |
1719 |
("he" . "Hebrew") |
("he" . "Hebrew") |
1720 |
("hi" . "Devanagari") ; Hindi |
("hi" . "Devanagari") ; Hindi glibc uses utf-8 |
1721 |
("hr" . "Latin-2") ; Croatian |
("hr" . "Latin-2") ; Croatian |
1722 |
("hu" . "Latin-2") ; Hungarian |
("hu" . "Latin-2") ; Hungarian |
1723 |
; hy Armenian |
; hy Armenian |
1738 |
("ko" . "Korean") |
("ko" . "Korean") |
1739 |
; ks Kashmiri |
; ks Kashmiri |
1740 |
; ku Kurdish |
; ku Kurdish |
1741 |
|
("kw" . "Latin-1") ; Cornish |
1742 |
; ky Kirghiz |
; ky Kirghiz |
1743 |
("la" . "Latin-1") ; Latin |
("la" . "Latin-1") ; Latin |
1744 |
|
("lb" . "Latin-1") ; Luxemburgish |
1745 |
; ln Lingala |
; ln Lingala |
1746 |
("lo" . "Lao") ; Laothian |
("lo" . "Lao") ; Laothian |
1747 |
("lt" . "Latin-4") ; Lithuanian |
("lt" . "Latin-4") ; Lithuanian |
1748 |
("lv" . "Latin-4") ; Latvian, Lettish |
("lv" . "Latin-4") ; Latvian, Lettish |
1749 |
; mg Malagasy |
; mg Malagasy |
1750 |
; mi Maori |
("mi" . "Latin-7") ; Maori |
1751 |
("mk" . "Latin-5") ; Macedonian |
("mk" . "Latin-5") ; Macedonian |
1752 |
; ml Malayalam |
; ml Malayalam |
1753 |
; mn Mongolian |
; mn Mongolian |
1754 |
; mo Moldavian |
; mo Moldavian |
1755 |
("mr" . "Devanagari") ; Marathi |
("mr" . "Devanagari") ; Marathi glibc uses utf-8 |
1756 |
; ms Malay |
("ms" . "Latin-1") ; Malay |
1757 |
("mt" . "Latin-3") ; Maltese |
("mt" . "Latin-3") ; Maltese |
1758 |
; my Burmese |
; my Burmese |
1759 |
; na Nauru |
; na Nauru |
1760 |
("ne" . "Devanagari") ; Nepali |
("ne" . "Devanagari") ; Nepali |
1761 |
("nl" . "Dutch") |
("nl" . "Dutch") |
1762 |
("no" . "Latin-1") ; Norwegian |
("no" . "Latin-1") ; Norwegian |
1763 |
; oc Occitan |
("oc" . "Latin-1") ; Occitan |
1764 |
; om (Afan) Oromo |
; om (Afan) Oromo |
1765 |
; or Oriya |
; or Oriya |
1766 |
; pa Punjabi |
; pa Punjabi |
1776 |
; rw Kinyarwanda |
; rw Kinyarwanda |
1777 |
("sa" . "Devanagari") ; Sanskrit |
("sa" . "Devanagari") ; Sanskrit |
1778 |
; sd Sindhi |
; sd Sindhi |
1779 |
|
; se Northern Sami |
1780 |
; sg Sangho |
; sg Sangho |
1781 |
("sh" . "Latin-2") ; Serbo-Croatian |
("sh" . "Latin-2") ; Serbo-Croatian |
1782 |
; si Sinhalese |
; si Sinhalese |
1792 |
; su Sundanese |
; su Sundanese |
1793 |
("sv" . "Latin-1") ; Swedish |
("sv" . "Latin-1") ; Swedish |
1794 |
("sw" . "Latin-1") ; Swahili |
("sw" . "Latin-1") ; Swahili |
1795 |
; ta Tamil |
; ta Tamil glibc uses utf-8 |
1796 |
; te Telugu |
; te Telugu glibc uses utf-8 |
1797 |
; tg Tajik |
; tg Tajik "Cyrillic-KOI8-T" |
1798 |
("th" . "Thai") |
("th" . "Thai") |
1799 |
; ti Tigrinya |
; ti Tigrinya |
1800 |
; tk Turkmen |
; tk Turkmen |
1807 |
; tw Twi |
; tw Twi |
1808 |
; ug Uighur |
; ug Uighur |
1809 |
("uk" . "Latin-5") ; Ukrainian |
("uk" . "Latin-5") ; Ukrainian |
1810 |
; ur Urdu |
; ur Urdu glibc uses utf-8 |
1811 |
; uz Uzbek |
("uz" . "Latin-1") ; Uzbek |
1812 |
("vi" . "Vietnamese") |
("vi" . "Vietnamese") ; glibc uses utf-8 |
1813 |
; vo Volapuk |
; vo Volapuk |
1814 |
; wo Wolof |
; wo Wolof |
1815 |
; xh Xhosa |
; xh Xhosa |
1816 |
; yi Yiddish |
; yi Yiddish |
1817 |
; yo Yoruba |
; yo Yoruba |
1818 |
; za Zhuang |
; za Zhuang |
1819 |
|
|
1820 |
|
; glibc: |
1821 |
|
; zh_CN.GB18030/GB18030 \ |
1822 |
|
; zh_CN.GBK/GBK \ |
1823 |
|
; zh_HK/BIG5-HKSCS \ |
1824 |
|
; zh_TW/BIG5 \ |
1825 |
|
; zh_TW.EUC-TW/EUC-TW \ |
1826 |
|
|
1827 |
("zh.*[._]big5" . "Chinese-BIG5") |
("zh.*[._]big5" . "Chinese-BIG5") |
1828 |
("zh.*[._]gbk" . nil) ; Solaris 2.7; has gbk-0 as well as GB 2312.1980-0 |
("zh.*[._]gbk" . nil) ; Solaris 2.7; has gbk-0 as well as GB 2312.1980-0 |
1829 |
("zh_tw" . "Chinese-CNS") |
("zh_tw" . "Chinese-CNS") |
1853 |
specifies the language name corresponding to that locale. |
specifies the language name corresponding to that locale. |
1854 |
If the language name is nil, there is no corresponding language environment.") |
If the language name is nil, there is no corresponding language environment.") |
1855 |
|
|
1856 |
(defvar locale-charset-language-names |
(defconst locale-charset-language-names |
1857 |
'((".*8859[-_]?1\\>" . "Latin-1") |
(purecopy |
1858 |
(".*8859[-_]?2\\>" . "Latin-2") |
'((".*8859[-_]?1\\>" . "Latin-1") |
1859 |
(".*8859[-_]?3\\>" . "Latin-3") |
(".*8859[-_]?2\\>" . "Latin-2") |
1860 |
(".*8859[-_]?4\\>" . "Latin-4") |
(".*8859[-_]?3\\>" . "Latin-3") |
1861 |
(".*8859[-_]?9\\>" . "Latin-5") |
(".*8859[-_]?4\\>" . "Latin-4") |
1862 |
(".*8859[-_]?14\\>" . "Latin-8") |
(".*8859[-_]?9\\>" . "Latin-5") |
1863 |
(".*8859[-_]?15\\>" . "Latin-9") |
(".*8859[-_]?14\\>" . "Latin-8") |
1864 |
(".*@euro\\>" . "Latin-9") |
(".*8859[-_]?15\\>" . "Latin-9") |
1865 |
) |
(".*@euro\\>" . "Latin-9") |
1866 |
|
)) |
1867 |
"List of pairs of locale regexps and charset language names. |
"List of pairs of locale regexps and charset language names. |
1868 |
The first element whose locale regexp matches the start of a downcased locale |
The first element whose locale regexp matches the start of a downcased locale |
1869 |
specifies the language name whose charsets corresponds to that locale. |
specifies the language name whose charsets corresponds to that locale. |
1870 |
This language name is used if its charsets disagree with the charsets of |
This language name is used if its charsets disagree with the charsets of |
1871 |
the language name that would otherwise be used for this locale.") |
the language name that would otherwise be used for this locale.") |
1872 |
|
|
1873 |
(defvar locale-preferred-coding-systems |
(defconst locale-preferred-coding-systems |
1874 |
'(("ja.*[._]euc" . japanese-iso-8bit) |
(purecopy |
1875 |
("ja.*[._]jis7" . iso-2022-jp) |
'(("ja.*[._]euc" . japanese-iso-8bit) |
1876 |
("ja.*[._]pck" . japanese-shift-jis) |
("ja.*[._]jis7" . iso-2022-jp) |
1877 |
("ja.*[._]sjis" . japanese-shift-jis) |
("ja.*[._]pck" . japanese-shift-jis) |
1878 |
) |
("ja.*[._]sjis" . japanese-shift-jis) |
1879 |
|
)) |
1880 |
"List of pairs of locale regexps and preferred coding systems. |
"List of pairs of locale regexps and preferred coding systems. |
1881 |
The first element whose locale regexp matches the start of a downcased locale |
The first element whose locale regexp matches the start of a downcased locale |
1882 |
specifies the coding system to prefer when using that locale.") |
specifies the coding system to prefer when using that locale.") |
1969 |
(coding-system |
(coding-system |
1970 |
(locale-name-match locale locale-preferred-coding-systems))) |
(locale-name-match locale locale-preferred-coding-systems))) |
1971 |
|
|
1972 |
|
;; Give preference to charset-language-name over language-name. |
1973 |
(if (and charset-language-name |
(if (and charset-language-name |
1974 |
(not |
(not |
1975 |
(equal (get-language-info language-name 'charset) |
(equal (get-language-info language-name 'charset) |