]> git.eshelyaron.com Git - emacs.git/commit
Don't decode text within XIM callbacks or handle_one_xevent
authorPo Lu <luangruo@yahoo.com>
Wed, 16 Feb 2022 02:10:13 +0000 (10:10 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 16 Feb 2022 02:10:13 +0000 (10:10 +0800)
commit0a9c8855b0ce9618219ef70bb489107ce7194ba1
tree518257b7f796e8245977343e54115555c96fc54e
parent2d573afecb69c7638991c49dad39e414585db13f
Don't decode text within XIM callbacks or handle_one_xevent

* src/keyboard.c (kbd_buffer_get_event_1):
(kbd_buffer_get_event_2): New functions.
(kbd_buffer_get_event): Accept a new meaning of
MULTIBYTE_CHAR_KEYSTROKE_EVENT where .arg can be a unibyte
string to be decoded in the locale coding system.

* src/termhooks.h (enum event_kind): Document new meaning of
.arg in a multibyte keystroke event.

* src/xfns.c (struct x_xim_text_conversion_data): New struct.
(x_xim_text_to_utf8_unix_1):
(x_xim_text_to_utf8_unix_2): New functions.
(x_xim_text_to_utf8_unix): Handle decode failure correctly.
(xic_preedit_draw_callback): Abort IM context if text could not
be decoded correctly.

* src/xterm.c (handle_one_xevent): Utilize new meaning of
MULTIBYTE_CHAR_KEYSTROKE_EVENT.
src/keyboard.c
src/termhooks.h
src/xfns.c
src/xterm.c