diff options
author | Po Lu <luangruo@yahoo.com> | 2022-10-03 20:18:22 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-10-03 20:18:37 +0800 |
commit | da02b9edadbc809b25ac83eccf64089f1cf3b160 (patch) | |
tree | 084641cd35e268b195b51ba7d09352207c52eb16 /src/xterm.h | |
parent | e245c4f226979ccb717cccc8f82b2b0a0f96bdac (diff) | |
download | emacs-da02b9edadbc809b25ac83eccf64089f1cf3b160.tar.gz |
Fix coding systems used for X input methods
* doc/emacs/mule.texi (International): Refer to X Coding as
well.
(Communication Coding): Document that locale-coding-system is
not always used on X to decode keyboard input.
(X Coding): New node.
* etc/NEWS: Announce change to input method coding resolution.
* lisp/term/x-win.el (x-get-input-coding-system): New function.
* src/coding.c (syms_of_coding): Update doc string of
locale-coding-system.
* src/xfns.c (struct x_xim_text_conversion_data)
(x_xim_text_to_utf8_unix_1, x_xim_text_to_utf8_unix_2)
(x_xim_text_to_utf8_unix): Accept dpyinfo. Use the coding
system specified inside if possible.
(xic_preedit_draw_callback): Pass dpyinfo.
* src/xterm.c (handle_one_xevent): Use XIM coding system for IM
input.
(xim_open_dpy): Try to determine the input method coding system.
(mark_xterm): Mark `xim_coding'.
(syms_of_xterm): New variable `x-input-coding-system'.
* src/xterm.h (struct x_display_info): New field `xim_coding'.
(FRAME_X_XIM_CODING): New macro.
Diffstat (limited to 'src/xterm.h')
-rw-r--r-- | src/xterm.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xterm.h b/src/xterm.h index f3791aa8df9..b68a234faa5 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -580,6 +580,9 @@ struct x_display_info XIMStyles *xim_styles; struct xim_inst_t *xim_callback_data; XIMStyle preferred_xim_style; + + /* The named coding system to use for this input method. */ + Lisp_Object xim_coding; #endif /* A cache mapping color names to RGB values. */ @@ -1348,6 +1351,12 @@ extern void x_mark_frame_dirty (struct frame *f); #define FRAME_X_XIM_STYLES(f) (FRAME_DISPLAY_INFO (f)->xim_styles) #define FRAME_XIC_STYLE(f) ((f)->output_data.x->xic_style) #define FRAME_XIC_FONTSET(f) ((f)->output_data.x->xic_xfs) +#define FRAME_X_XIM_CODING(f) \ + (SYMBOLP (Vx_input_coding_system) \ + ? Vx_input_coding_system \ + : (!NILP (FRAME_DISPLAY_INFO (f)->xim_coding) \ + ? FRAME_DISPLAY_INFO(f)->xim_coding \ + : Vlocale_coding_system)) /* X-specific scroll bar stuff. */ |