aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/international/mule-cmds.el17
1 files changed, 16 insertions, 1 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 05b2cdbd65f..c5a540650e2 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1881,13 +1881,21 @@ the language name that would otherwise be used for this locale.")
1881The first element whose locale regexp matches the start of a downcased locale 1881The first element whose locale regexp matches the start of a downcased locale
1882specifies the coding system to prefer when using that locale.") 1882specifies the coding system to prefer when using that locale.")
1883 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
1890coding-system specified by the locale setting is a member of this list.")
1891
1884(defun locale-name-match (key alist) 1892(defun locale-name-match (key alist)
1885 "Search for KEY in ALIST, which should be a list of regexp-value pairs. 1893 "Search for KEY in ALIST, which should be a list of regexp-value pairs.
1886Return the value corresponding to the first regexp that matches the 1894Return the value corresponding to the first regexp that matches the
1887start of KEY, or nil if there is no match." 1895start of KEY, or nil if there is no match."
1888 (let (element) 1896 (let (element)
1889 (while (and alist (not element)) 1897 (while (and alist (not element))
1890 (if (string-match (concat "^\\(" (car (car alist)) "\\)") key) 1898 (if (string-match (concat "\\`\\(?:" (car (car alist)) "\\)") key)
1891 (setq element (car alist))) 1899 (setq element (car alist)))
1892 (setq alist (cdr alist))) 1900 (setq alist (cdr alist)))
1893 (cdr element))) 1901 (cdr element)))
@@ -1988,6 +1996,13 @@ See also `locale-charset-language-names', `locale-language-names',
1988 (when default-enable-multibyte-characters 1996 (when default-enable-multibyte-characters
1989 (set-display-table-and-terminal-coding-system language-name)) 1997 (set-display-table-and-terminal-coding-system language-name))
1990 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
1991 (setq locale-coding-system 2006 (setq locale-coding-system
1992 (car (get-language-info language-name 'coding-priority)))) 2007 (car (get-language-info language-name 'coding-priority))))
1993 2008