1626 |
(setq l (cons input-method (delete input-method l)))) |
(setq l (cons input-method (delete input-method l)))) |
1627 |
(insert ":\n") |
(insert ":\n") |
1628 |
(while l |
(while l |
1629 |
(when (string= language-name (nth 1 (car l))) |
(when (eq t (compare-strings language-name nil nil |
1630 |
|
(nth 1 (car l)) nil nil t)) |
1631 |
(insert " " (car (car l))) |
(insert " " (car (car l))) |
1632 |
(search-backward (car (car l))) |
(search-backward (car (car l))) |
1633 |
(help-xref-button 0 'help-input-method (car (car l))) |
(help-xref-button 0 'help-input-method (car (car l))) |
1886 |
(".*8859[-_]?14\\>" . "Latin-8") |
(".*8859[-_]?14\\>" . "Latin-8") |
1887 |
(".*8859[-_]?15\\>" . "Latin-9") |
(".*8859[-_]?15\\>" . "Latin-9") |
1888 |
(".*utf\\(-?8\\)\\>" . "UTF-8") |
(".*utf\\(-?8\\)\\>" . "UTF-8") |
1889 |
(".*@euro\\>" . "Latin-9"))) ; utf-8@euro exists, so put this last |
;; @euro actually indicates the monetary component, but it |
1890 |
|
;; probably implies a Latin-9 codeset component. |
1891 |
|
;; utf-8@euro exists, so put this last. |
1892 |
|
(".*@euro\\>" . "Latin-9"))) |
1893 |
"List of pairs of locale regexps and charset language names. |
"List of pairs of locale regexps and charset language names. |
1894 |
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 |
1895 |
specifies the language name whose charsets corresponds to that locale. |
specifies the language name whose charsets corresponds to that locale. |
1926 |
(setq alist (cdr alist))) |
(setq alist (cdr alist))) |
1927 |
(cdr element))) |
(cdr element))) |
1928 |
|
|
1929 |
|
(defun locale-charset-match-p (charset1 charset2) |
1930 |
|
"Whether charset names CHARSET1 and CHARSET2 are equivalent. |
1931 |
|
Matching is done ignoring case and any hyphens and underscores in the |
1932 |
|
names. E.g. `ISO_8859-1' and `iso88591' both match `iso-8859-1'." |
1933 |
|
(setq charset1 (replace-regexp-in-string "[-_]" "" charset1)) |
1934 |
|
(setq charset2 (replace-regexp-in-string "[-_]" "" charset2)) |
1935 |
|
(eq t (compare-strings charset1 nil nil charset2 nil nil t))) |
1936 |
|
|
1937 |
(defun set-locale-environment (&optional locale-name) |
(defun set-locale-environment (&optional locale-name) |
1938 |
"Set up multi-lingual environment for using LOCALE-NAME. |
"Set up multi-lingual environment for using LOCALE-NAME. |
1939 |
This sets the language environment, the coding system priority, |
This sets the language environment, the coding system priority, |
1940 |
the default input method and sometimes other things. |
the default input method and sometimes other things. |
1941 |
|
|
1942 |
LOCALE-NAME should be a string |
LOCALE-NAME should be a string which is the name of a locale supported |
1943 |
which is the name of a locale supported by the system; |
by the system; often it is of the form xx_XX.CODE, where xx is a |
1944 |
often it is of the form xx_XX.CODE, where xx is a language, |
language, XX is a country, and CODE specifies a character set and |
1945 |
XX is a country, and CODE specifies a character set and coding system. |
coding system. For example, the locale name \"ja_JP.EUC\" might name |
1946 |
For example, the locale name \"ja_JP.EUC\" might name a locale |
a locale for Japanese in Japan using the `japanese-iso-8bit' |
1947 |
for Japanese in Japan using the `japanese-iso-8bit' coding-system. |
coding-system. The name may also have a modifier suffix, e.g. `@euro' |
1948 |
|
or `@cyrillic'. |
1949 |
|
|
1950 |
If LOCALE-NAME is nil, its value is taken from the environment |
If LOCALE-NAME is nil, its value is taken from the environment |
1951 |
variables LC_ALL, LC_CTYPE and LANG (the first one that is set). |
variables LC_ALL, LC_CTYPE and LANG (the first one that is set). |
2045 |
|
|
2046 |
(when coding-system |
(when coding-system |
2047 |
(prefer-coding-system coding-system) |
(prefer-coding-system coding-system) |
2048 |
(setq locale-coding-system coding-system)))))) |
(setq locale-coding-system coding-system)) |
2049 |
|
(let ((codeset (langinfo 'codeset)) |
2050 |
|
(coding-system (car (coding-system-priority-list)))) |
2051 |
|
(when codeset |
2052 |
|
(unless (locale-charset-match-p (symbol-name coding-system) |
2053 |
|
(langinfo 'codeset)) |
2054 |
|
(message "\ |
2055 |
|
Warning: Default coding system `%s' doesn't agree with |
2056 |
|
the system code set `%s' for this locale." coding-system codeset)))))))))) |
2057 |
|
|
2058 |
;;; Character code property |
;;; Character code property |
2059 |
(put 'char-code-property-table 'char-table-extra-slots 0) |
(put 'char-code-property-table 'char-table-extra-slots 0) |