aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2023-11-03 11:32:17 +0800
committerPo Lu2023-11-03 11:34:40 +0800
commite06e61f45615f66d5e32fa23ea7ede7c4da77fda (patch)
treec45227d99ca50adeadcaba167f367d4d46f6e14f /src
parentfc8d225328d41c180b6997f6c25f904ca66211ac (diff)
downloademacs-e06e61f45615f66d5e32fa23ea7ede7c4da77fda.tar.gz
emacs-e06e61f45615f66d5e32fa23ea7ede7c4da77fda.zip
Avoid moving point while analyzing text conversion
* lisp/simple.el (analyze-text-conversion): If neither calling p-s-i-h nor calling p-t-c-h yields a change to point, return it to its location before analyze-text-conversion was called. * src/keyboard.c (kbd_buffer_get_event): See that text conversion events are uniformly delivered prior to keyboard events arriving in unison.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 003340c3e58..13cb7835dff 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3993,6 +3993,19 @@ kbd_buffer_get_event (KBOARD **kbp,
3993 if (CONSP (Vunread_command_events)) 3993 if (CONSP (Vunread_command_events))
3994 break; 3994 break;
3995 3995
3996#ifdef HAVE_TEXT_CONVERSION
3997 /* That text conversion events take priority over keyboard
3998 events, since input methods frequently send them immediately
3999 after edits, with the assumption that this order of events
4000 will be observed. */
4001
4002 if (detect_conversion_events ())
4003 {
4004 had_pending_conversion_events = true;
4005 break;
4006 }
4007#endif /* HAVE_TEXT_CONVERSION */
4008
3996 if (kbd_fetch_ptr != kbd_store_ptr) 4009 if (kbd_fetch_ptr != kbd_store_ptr)
3997 break; 4010 break;
3998 if (some_mouse_moved ()) 4011 if (some_mouse_moved ())
@@ -4021,13 +4034,6 @@ kbd_buffer_get_event (KBOARD **kbp,
4021 break; 4034 break;
4022 } 4035 }
4023#endif 4036#endif
4024#ifdef HAVE_TEXT_CONVERSION
4025 if (detect_conversion_events ())
4026 {
4027 had_pending_conversion_events = true;
4028 break;
4029 }
4030#endif
4031 if (end_time) 4037 if (end_time)
4032 { 4038 {
4033 struct timespec now = current_timespec (); 4039 struct timespec now = current_timespec ();