diff options
| author | Po Lu | 2022-02-16 10:53:00 +0800 |
|---|---|---|
| committer | Po Lu | 2022-02-16 10:53:00 +0800 |
| commit | f1d535da1ed2e7a70c6cf28fdcdca31d3f86a3f5 (patch) | |
| tree | 75a6922c25dea7dd9d80f0e1b8b9dab55799b34a /src/keyboard.c | |
| parent | 0a9c8855b0ce9618219ef70bb489107ce7194ba1 (diff) | |
| download | emacs-f1d535da1ed2e7a70c6cf28fdcdca31d3f86a3f5.tar.gz emacs-f1d535da1ed2e7a70c6cf28fdcdca31d3f86a3f5.zip | |
Decode keyboard input as latin-1 whenever appropriate
* src/keyboard.c (kbd_buffer_get_event_1): Use `coding'
property if present.
* src/termhooks.h (enum event_kind): Document meaning of
`coding' property on text strings.
* src/xterm.c (handle_one_xevent): Set coding property on text
to latin-1 if it was obtained with XLookupString.
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 800632aa25d..0747ab48205 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -3838,7 +3838,12 @@ clear_event (struct input_event *event) | |||
| 3838 | static Lisp_Object | 3838 | static Lisp_Object |
| 3839 | kbd_buffer_get_event_1 (Lisp_Object arg) | 3839 | kbd_buffer_get_event_1 (Lisp_Object arg) |
| 3840 | { | 3840 | { |
| 3841 | return code_convert_string (arg, Vlocale_coding_system, | 3841 | Lisp_Object coding_system = Fget_text_property (make_fixnum (0), |
| 3842 | Qcoding, arg); | ||
| 3843 | |||
| 3844 | return code_convert_string (arg, (!NILP (coding_system) | ||
| 3845 | ? coding_system | ||
| 3846 | : Vlocale_coding_system), | ||
| 3842 | Qnil, 0, false, 0); | 3847 | Qnil, 0, false, 0); |
| 3843 | } | 3848 | } |
| 3844 | 3849 | ||
| @@ -12477,6 +12482,9 @@ See also `pre-command-hook'. */); | |||
| 12477 | DEFSYM (Qtouchscreen_end, "touchscreen-end"); | 12482 | DEFSYM (Qtouchscreen_end, "touchscreen-end"); |
| 12478 | DEFSYM (Qtouchscreen_update, "touchscreen-update"); | 12483 | DEFSYM (Qtouchscreen_update, "touchscreen-update"); |
| 12479 | DEFSYM (Qpinch, "pinch"); | 12484 | DEFSYM (Qpinch, "pinch"); |
| 12485 | |||
| 12486 | DEFSYM (Qcoding, "coding"); | ||
| 12487 | |||
| 12480 | Fset (Qecho_area_clear_hook, Qnil); | 12488 | Fset (Qecho_area_clear_hook, Qnil); |
| 12481 | 12489 | ||
| 12482 | DEFVAR_LISP ("lucid-menu-bar-dirty-flag", Vlucid_menu_bar_dirty_flag, | 12490 | DEFVAR_LISP ("lucid-menu-bar-dirty-flag", Vlucid_menu_bar_dirty_flag, |