diff options
| author | Po Lu | 2022-01-07 14:35:29 +0800 |
|---|---|---|
| committer | Po Lu | 2022-01-07 14:42:08 +0800 |
| commit | 751789471cf04916bcfad358472625f382e596d8 (patch) | |
| tree | 329fa13c0e4972b34a1c1b95fa398a708bb246c5 /src/pgtkterm.c | |
| parent | 48038cb2b2191980b3862be2c7d408e6ba6ee0d8 (diff) | |
| download | emacs-751789471cf04916bcfad358472625f382e596d8.tar.gz emacs-751789471cf04916bcfad358472625f382e596d8.zip | |
Display pre-edit information from X input methods
This also repurposes the `pgtk-preedit-text' event to be
meaningful on X, renames it `preedit-text', and documents it.
* doc/lispref/commands.texi (Misc Events): Document
`preedit-text'.
* lisp/term/pgtk-win.el (pgtk-preedit-text): Bind to
`preedit-text' instead.
* lisp/term/x-win.el (x-preedit-overlay): New variable.
(x-preedit-text): New command, bound as a special event to
`preedit-text'.
* src/keyboard.c (kbd_buffer_get_event):
(make_lispy_event): Rename PGTK_PREEDIT_TEXT_EVENT
PREEDIT_TEXT_EVENT.
(syms_of_keyboard): New defsym `preedit-text'.
* src/pgtkterm.c (pgtk_enqueue_preedit): Use PREEDIT_TEXT_EVENT
instead.
* src/termhooks.h (enum event_kind): Rename
`PGTK_PREEDIT_TEXT_EVENT' `PREEDIT_TEXT_EVENT'.
* src/xfns.c (Xxic_preedit_draw_callback):
(Xxic_preedit_caret_callback):
(Xxic_preedit_done_callback):
(Xxic_preedit_start_callback): New callback variables.
(STYLE_OFFTHESPOT, STYLE_OVERTHESPOT):
(STYLE_ROOT, STYLE_CALLBACK, STYLE_NONE): New macros.
(supported_xim_styles): Use reasonable values. This also serves
as a better fix for bug#10867.
(best_xim_style): Restore code deleted as part of the original
fix for bug#10867.
(create_frame_xic): Add preedit callbacks.
(xic_set_preeditarea): Add preedit callbacks.
(x_xic_to_frame):
(xic_preedit_start_callback):
(xic_preedit_caret_callback):
(xic_preedit_done_callback):
(x_xim_text_to_utf8_unix):
(xic_preedit_draw_callback): New functions.
* src/xterm.c (x_detect_focus_change): Fix type of XI event.
(x_free_frame_resources): Free preedit text buffer if still
present.
* src/xterm.h (struct x_output): New fields `preedit_size',
`preedit_chars' and `preedit_active'.
Diffstat (limited to 'src/pgtkterm.c')
| -rw-r--r-- | src/pgtkterm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pgtkterm.c b/src/pgtkterm.c index 736fce09c4a..1d301d11f6f 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c | |||
| @@ -5259,7 +5259,7 @@ pgtk_enqueue_preedit (struct frame *f, Lisp_Object preedit) | |||
| 5259 | { | 5259 | { |
| 5260 | union buffered_input_event inev; | 5260 | union buffered_input_event inev; |
| 5261 | EVENT_INIT (inev.ie); | 5261 | EVENT_INIT (inev.ie); |
| 5262 | inev.ie.kind = PGTK_PREEDIT_TEXT_EVENT; | 5262 | inev.ie.kind = PREEDIT_TEXT_EVENT; |
| 5263 | inev.ie.arg = preedit; | 5263 | inev.ie.arg = preedit; |
| 5264 | inev.ie.code = 0; | 5264 | inev.ie.code = 0; |
| 5265 | XSETFRAME (inev.ie.frame_or_window, f); | 5265 | XSETFRAME (inev.ie.frame_or_window, f); |