aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2022-10-06 10:55:25 +0800
committerPo Lu2022-10-06 10:56:27 +0800
commit8e8d37aa326870ebf0ff6c07b4e37ae6abcf79b6 (patch)
tree36f50fe87723e2d7b43ff0a25e0a085bb010ed13
parentc690d1f15d274d50ed21d4aa1b98a23de8d7e1e6 (diff)
downloademacs-8e8d37aa326870ebf0ff6c07b4e37ae6abcf79b6.tar.gz
emacs-8e8d37aa326870ebf0ff6c07b4e37ae6abcf79b6.zip
Minor fixes to IM locale handling
* lisp/term/x-win.el (x-get-input-coding-system): Translate locales. * src/xterm.c (x_term_init): If the X library doesn't support the current locale, don't set up input methods.
-rw-r--r--lisp/term/x-win.el2
-rw-r--r--src/xterm.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 57c6b785e73..62684f52cc9 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -1623,7 +1623,7 @@ found."
1623 (if (equal x-locale "C") 1623 (if (equal x-locale "C")
1624 ;; Treat the C locale specially, as it means "ascii" under X. 1624 ;; Treat the C locale specially, as it means "ascii" under X.
1625 'ascii 1625 'ascii
1626 (let ((locale (downcase x-locale))) 1626 (let ((locale (locale-translate (downcase x-locale))))
1627 (or (locale-name-match locale locale-preferred-coding-systems) 1627 (or (locale-name-match locale locale-preferred-coding-systems)
1628 (when locale 1628 (when locale
1629 (if (string-match "\\.\\([^@]+\\)" locale) 1629 (if (string-match "\\.\\([^@]+\\)" locale)
diff --git a/src/xterm.c b/src/xterm.c
index f3bfae457ba..37e7916486e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -29252,7 +29252,11 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
29252#endif 29252#endif
29253 29253
29254#ifdef HAVE_X_I18N 29254#ifdef HAVE_X_I18N
29255 xim_initialize (dpyinfo, resource_name); 29255 /* Avoid initializing input methods if the X library does not
29256 support Emacs's locale. When the current locale is not
29257 supported, decoding input method strings becomes undefined. */
29258 if (!XSupportsLocale ())
29259 xim_initialize (dpyinfo, resource_name);
29256#endif 29260#endif
29257 29261
29258 xsettings_initialize (dpyinfo); 29262 xsettings_initialize (dpyinfo);