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.") |
1883 |
|
|
1884 |
|
(defconst standard-keyboard-coding-systems |
1885 |
|
(purecopy |
1886 |
|
'(iso-latin-1 iso-latin-2 iso-latin-3 iso-latin-4 iso-latin-5 |
1887 |
|
iso-latin-6 iso-latin-7 iso-latin-8 iso-latin-9)) |
1888 |
|
"Coding systems that are commonly used for keyboards. |
1889 |
|
`set-locale-environment' will set the `keyboard-coding-system' if the |
1890 |
|
coding-system specified by the locale setting is a member of this list.") |
1891 |
|
|
1892 |
(defun locale-name-match (key alist) |
(defun locale-name-match (key alist) |
1893 |
"Search for KEY in ALIST, which should be a list of regexp-value pairs. |
"Search for KEY in ALIST, which should be a list of regexp-value pairs. |
1894 |
Return the value corresponding to the first regexp that matches the |
Return the value corresponding to the first regexp that matches the |
1895 |
start of KEY, or nil if there is no match." |
start of KEY, or nil if there is no match." |
1896 |
(let (element) |
(let (element) |
1897 |
(while (and alist (not element)) |
(while (and alist (not element)) |
1898 |
(if (string-match (concat "^\\(" (car (car alist)) "\\)") key) |
(if (string-match (concat "\\`\\(?:" (car (car alist)) "\\)") key) |
1899 |
(setq element (car alist))) |
(setq element (car alist))) |
1900 |
(setq alist (cdr alist))) |
(setq alist (cdr alist))) |
1901 |
(cdr element))) |
(cdr element))) |
1996 |
(when default-enable-multibyte-characters |
(when default-enable-multibyte-characters |
1997 |
(set-display-table-and-terminal-coding-system language-name)) |
(set-display-table-and-terminal-coding-system language-name)) |
1998 |
|
|
1999 |
|
;; Set the `keyboard-coding-system' if appropriate. |
2000 |
|
(let ((kcs (or coding-system |
2001 |
|
(car (get-language-info language-name |
2002 |
|
'coding-system))))) |
2003 |
|
(if (memq kcs standard-keyboard-coding-systems) |
2004 |
|
(set-keyboard-coding-system kcs))) |
2005 |
|
|
2006 |
(setq locale-coding-system |
(setq locale-coding-system |
2007 |
(car (get-language-info language-name 'coding-priority)))) |
(car (get-language-info language-name 'coding-priority)))) |
2008 |
|
|