diff options
| -rw-r--r-- | src/androidterm.c | 12 | ||||
| -rw-r--r-- | src/textconv.c | 43 |
2 files changed, 49 insertions, 6 deletions
diff --git a/src/androidterm.c b/src/androidterm.c index 77f2bd1c7a0..704ff5f5d85 100644 --- a/src/androidterm.c +++ b/src/androidterm.c | |||
| @@ -1053,12 +1053,12 @@ handle_one_android_event (struct android_display_info *dpyinfo, | |||
| 1053 | used to make Android run stuff. */ | 1053 | used to make Android run stuff. */ |
| 1054 | 1054 | ||
| 1055 | if (!event->xaction.window && !event->xaction.action) | 1055 | if (!event->xaction.window && !event->xaction.action) |
| 1056 | { | 1056 | /* Don't run queries here, as it may run inside editor |
| 1057 | /* Check for and run anything the UI thread wants to run on the main | 1057 | commands, which can expose an inconsistent view of buffer |
| 1058 | thread. */ | 1058 | contents to the input method during command execution. |
| 1059 | android_check_query (); | 1059 | |
| 1060 | goto OTHER; | 1060 | Instead, wait for Emacs to return to `android_select'. */ |
| 1061 | } | 1061 | goto OTHER; |
| 1062 | 1062 | ||
| 1063 | f = any; | 1063 | f = any; |
| 1064 | 1064 | ||
diff --git a/src/textconv.c b/src/textconv.c index 1161b781b6a..92d44fe2e66 100644 --- a/src/textconv.c +++ b/src/textconv.c | |||
| @@ -40,6 +40,24 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | /* Define debugging macros. */ | ||
| 44 | |||
| 45 | #if defined HAVE_ANDROID && !defined ANDROID_STUBIFY | ||
| 46 | #if 0 | ||
| 47 | #include <android/log.h> | ||
| 48 | |||
| 49 | #define TEXTCONV_DEBUG(fmt, ...) \ | ||
| 50 | __android_log_print (ANDROID_LOG_VERBOSE, "EmacsInputConnection", \ | ||
| 51 | "%s: " fmt, __func__, ## __VA_ARGS__) | ||
| 52 | #endif /* 0 */ | ||
| 53 | #endif /* defined HAVE_ANDROID && !defined ANDROID_STUBIFY */ | ||
| 54 | |||
| 55 | #ifndef TEXTCONV_DEBUG | ||
| 56 | #define TEXTCONV_DEBUG(...) ((void) 0) | ||
| 57 | #endif /* TEXTCONV_DEBUG */ | ||
| 58 | |||
| 59 | |||
| 60 | |||
| 43 | /* The window system's text conversion interface. NULL when the | 61 | /* The window system's text conversion interface. NULL when the |
| 44 | window system has not set up text conversion. */ | 62 | window system has not set up text conversion. */ |
| 45 | 63 | ||
| @@ -701,6 +719,10 @@ really_commit_text (struct frame *f, EMACS_INT position, | |||
| 701 | /* This should deactivate the mark. */ | 719 | /* This should deactivate the mark. */ |
| 702 | call0 (Qdeactivate_mark); | 720 | call0 (Qdeactivate_mark); |
| 703 | 721 | ||
| 722 | /* Print some debugging information. */ | ||
| 723 | TEXTCONV_DEBUG ("text inserted: %s, point now: %zd", | ||
| 724 | SSDATA (text), PT); | ||
| 725 | |||
| 704 | /* Update the ephemeral last point. */ | 726 | /* Update the ephemeral last point. */ |
| 705 | w = XWINDOW (selected_window); | 727 | w = XWINDOW (selected_window); |
| 706 | w->ephemeral_last_point = PT; | 728 | w->ephemeral_last_point = PT; |
| @@ -730,6 +752,8 @@ really_finish_composing_text (struct frame *f, bool update) | |||
| 730 | 752 | ||
| 731 | if (!NILP (f->conversion.compose_region_overlay)) | 753 | if (!NILP (f->conversion.compose_region_overlay)) |
| 732 | Fdelete_overlay (f->conversion.compose_region_overlay); | 754 | Fdelete_overlay (f->conversion.compose_region_overlay); |
| 755 | |||
| 756 | TEXTCONV_DEBUG ("conversion region removed"); | ||
| 733 | } | 757 | } |
| 734 | 758 | ||
| 735 | /* Set the composing text on F to TEXT. Then, move point to an | 759 | /* Set the composing text on F to TEXT. Then, move point to an |
| @@ -876,6 +900,13 @@ really_set_composing_text (struct frame *f, ptrdiff_t position, | |||
| 876 | w = XWINDOW (selected_window); | 900 | w = XWINDOW (selected_window); |
| 877 | w->ephemeral_last_point = PT; | 901 | w->ephemeral_last_point = PT; |
| 878 | 902 | ||
| 903 | if (SCHARS (text)) | ||
| 904 | TEXTCONV_DEBUG ("conversion region set to: %td %td", | ||
| 905 | marker_position (f->conversion.compose_region_start), | ||
| 906 | marker_position (f->conversion.compose_region_end)); | ||
| 907 | else | ||
| 908 | TEXTCONV_DEBUG ("conversion region removed; PT is now: %td", PT); | ||
| 909 | |||
| 879 | unbind_to (count, Qnil); | 910 | unbind_to (count, Qnil); |
| 880 | } | 911 | } |
| 881 | 912 | ||
| @@ -927,6 +958,9 @@ really_set_composing_region (struct frame *f, ptrdiff_t start, | |||
| 927 | make_fixnum (end), Qnil); | 958 | make_fixnum (end), Qnil); |
| 928 | sync_overlay (f); | 959 | sync_overlay (f); |
| 929 | 960 | ||
| 961 | TEXTCONV_DEBUG ("composing region set to: %td, %td; point is: %td", | ||
| 962 | start, end, PT); | ||
| 963 | |||
| 930 | /* Update the ephemeral last point. */ | 964 | /* Update the ephemeral last point. */ |
| 931 | w = XWINDOW (selected_window); | 965 | w = XWINDOW (selected_window); |
| 932 | w->ephemeral_last_point = PT; | 966 | w->ephemeral_last_point = PT; |
| @@ -1011,6 +1045,9 @@ really_delete_surrounding_text (struct frame *f, ptrdiff_t left, | |||
| 1011 | record_buffer_change (start, start, text); | 1045 | record_buffer_change (start, start, text); |
| 1012 | } | 1046 | } |
| 1013 | 1047 | ||
| 1048 | TEXTCONV_DEBUG ("deleted surrounding text: %td, %td; PT is now %td", | ||
| 1049 | left, right, PT); | ||
| 1050 | |||
| 1014 | /* if the mark is now equal to start, deactivate it. */ | 1051 | /* if the mark is now equal to start, deactivate it. */ |
| 1015 | 1052 | ||
| 1016 | if (get_mark () == PT) | 1053 | if (get_mark () == PT) |
| @@ -1093,6 +1130,9 @@ really_set_point_and_mark (struct frame *f, ptrdiff_t point, | |||
| 1093 | w = XWINDOW (selected_window); | 1130 | w = XWINDOW (selected_window); |
| 1094 | w->ephemeral_last_point = PT; | 1131 | w->ephemeral_last_point = PT; |
| 1095 | 1132 | ||
| 1133 | TEXTCONV_DEBUG ("set point and mark: %td %td", | ||
| 1134 | PT, get_mark ()); | ||
| 1135 | |||
| 1096 | unbind_to (count, Qnil); | 1136 | unbind_to (count, Qnil); |
| 1097 | } | 1137 | } |
| 1098 | 1138 | ||
| @@ -1727,6 +1767,9 @@ get_extracted_text (struct frame *f, ptrdiff_t n, | |||
| 1727 | *length = end - start; | 1767 | *length = end - start; |
| 1728 | *bytes = end_byte - start_byte; | 1768 | *bytes = end_byte - start_byte; |
| 1729 | 1769 | ||
| 1770 | TEXTCONV_DEBUG ("get_extracted_text: PT, mark, start: %td, %td, %td", | ||
| 1771 | PT, mark, start); | ||
| 1772 | |||
| 1730 | finish: | 1773 | finish: |
| 1731 | unbind_to (count, Qnil); | 1774 | unbind_to (count, Qnil); |
| 1732 | return buffer; | 1775 | return buffer; |