diff options
| author | Po Lu | 2023-02-15 22:51:44 +0800 |
|---|---|---|
| committer | Po Lu | 2023-02-15 22:51:44 +0800 |
| commit | cf24b61985c26cbf2e5a24cb0b64a8528aa3a9cc (patch) | |
| tree | b69f8dbb50e3e2f6f09caa05aecbee5241876f62 /src/buffer.c | |
| parent | dd7066901f67233c09f3b0409a57db7686c7ea5b (diff) | |
| download | emacs-cf24b61985c26cbf2e5a24cb0b64a8528aa3a9cc.tar.gz emacs-cf24b61985c26cbf2e5a24cb0b64a8528aa3a9cc.zip | |
Update Android port
* doc/emacs/input.texi (On-Screen Keyboards):
* doc/lispref/commands.texi (Misc Events): Improve documentation
of text conversion stuff.
* java/org/gnu/emacs/EmacsInputConnection.java (beginBatchEdit)
(endBatchEdit, commitCompletion, commitText, deleteSurroundingText)
(finishComposingText, getSelectedText, getTextAfterCursor)
(EmacsInputConnection, setComposingRegion, performEditorAction)
(getExtractedText): Condition debug code on DEBUG_IC.
* java/org/gnu/emacs/EmacsService.java (EmacsService, updateIC):
Likewise.
* lisp/bindings.el (global-map):
* lisp/electric.el (global-map): Make `text-conversion'
`analyze-text-conversion'.
* lisp/progmodes/prog-mode.el (prog-mode): Enable text
conversion in input methods.
* lisp/simple.el (analyze-text-conversion): New function.
* lisp/textmodes/text-mode.el (text-conversion-style)
(text-mode): Likewise.
* src/androidterm.c (android_handle_ime_event): Handle
set_point_and_mark.
(android_sync_edit): Give Emacs 100 ms instead.
(android_perform_conversion_query): Skip the active region, not
the conversion region.
(getSelectedText): Implement properly.
(android_update_selection): Expose mark to input methods.
(android_reset_conversion): Handle `text-conversion-style'.
* src/buffer.c (init_buffer_once, syms_of_buffer): Add buffer
local variable `text-conversion-style'.
* src/buffer.h (struct buffer, bset_text_conversion_style): New
fields.
* src/emacs.c (android_emacs_init): Call syms_of_textconv.
* src/frame.h (enum text_conversion_operation): Rename
TEXTCONV_SET_POINT.
* src/lisp.h: Export syms_of_textconv.
* src/marker.c (set_marker_internal): Force redisplay when the
mark is set and the buffer is visible on builds that use text
conversion. Explain why.
* src/textconv.c (copy_buffer): Fix copying past gap.
(get_mark): New function.
(textconv_query): Implement new flag.
(sync_overlay): New function. Display conversion text in an
overlay.
(record_buffer_change, really_commit_text)
(really_set_composing_text, really_set_composing_region)
(really_delete_surrounding_text, really_set_point)
(handle_pending_conversion_events_1, decrement_inside)
(handle_pending_conversion_events, textconv_set_point)
(get_extracted_text, register_textconv_interface): Various fixes
and improvements.
* src/textconv.h (struct textconv_interface): Update
documentation.
* src/window.h (GCALIGNED_STRUCT): New field `prev_mark'.
* src/xdisp.c (mark_window_display_accurate_1): Handle
prev_mark.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c index 38648519ba0..af4aa583c96 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -4710,6 +4710,7 @@ init_buffer_once (void) | |||
| 4710 | #ifdef HAVE_TREE_SITTER | 4710 | #ifdef HAVE_TREE_SITTER |
| 4711 | XSETFASTINT (BVAR (&buffer_local_flags, ts_parser_list), idx); ++idx; | 4711 | XSETFASTINT (BVAR (&buffer_local_flags, ts_parser_list), idx); ++idx; |
| 4712 | #endif | 4712 | #endif |
| 4713 | XSETFASTINT (BVAR (&buffer_local_flags, text_conversion_style), idx); ++idx; | ||
| 4713 | XSETFASTINT (BVAR (&buffer_local_flags, cursor_in_non_selected_windows), idx); ++idx; | 4714 | XSETFASTINT (BVAR (&buffer_local_flags, cursor_in_non_selected_windows), idx); ++idx; |
| 4714 | 4715 | ||
| 4715 | /* buffer_local_flags contains no pointers, so it's safe to treat it | 4716 | /* buffer_local_flags contains no pointers, so it's safe to treat it |
| @@ -4781,6 +4782,9 @@ init_buffer_once (void) | |||
| 4781 | #ifdef HAVE_TREE_SITTER | 4782 | #ifdef HAVE_TREE_SITTER |
| 4782 | bset_ts_parser_list (&buffer_defaults, Qnil); | 4783 | bset_ts_parser_list (&buffer_defaults, Qnil); |
| 4783 | #endif | 4784 | #endif |
| 4785 | #ifdef HAVE_TEXT_CONVERSION | ||
| 4786 | bset_text_conversion_style (&buffer_defaults, Qnil); | ||
| 4787 | #endif | ||
| 4784 | bset_cursor_in_non_selected_windows (&buffer_defaults, Qt); | 4788 | bset_cursor_in_non_selected_windows (&buffer_defaults, Qt); |
| 4785 | 4789 | ||
| 4786 | bset_enable_multibyte_characters (&buffer_defaults, Qt); | 4790 | bset_enable_multibyte_characters (&buffer_defaults, Qt); |
| @@ -5852,6 +5856,22 @@ If t, displays a cursor related to the usual cursor type | |||
| 5852 | You can also specify the cursor type as in the `cursor-type' variable. | 5856 | You can also specify the cursor type as in the `cursor-type' variable. |
| 5853 | Use Custom to set this variable and update the display. */); | 5857 | Use Custom to set this variable and update the display. */); |
| 5854 | 5858 | ||
| 5859 | /* While this is defined here, each *term.c module must implement | ||
| 5860 | the logic itself. */ | ||
| 5861 | |||
| 5862 | DEFVAR_PER_BUFFER ("text-conversion-style", &BVAR (current_buffer, | ||
| 5863 | text_conversion_style), | ||
| 5864 | Qnil, | ||
| 5865 | "How the on screen keyboard's input method should insert in this buffer.\n\ | ||
| 5866 | When nil, the input method will be disabled and an ordinary keyboard\n\ | ||
| 5867 | will be displayed in its place.\n\ | ||
| 5868 | When the symbol `action', the input method will insert text directly, but\n\ | ||
| 5869 | will send `return' key events instead of inserting new line characters.\n\ | ||
| 5870 | Any other value means that the input method will insert text directly.\n\ | ||
| 5871 | \n\ | ||
| 5872 | This variable does not take immediate effect when set; rather, it takes\n\ | ||
| 5873 | effect upon the next redisplay after the selected window or buffer changes."); | ||
| 5874 | |||
| 5855 | DEFVAR_LISP ("kill-buffer-query-functions", Vkill_buffer_query_functions, | 5875 | DEFVAR_LISP ("kill-buffer-query-functions", Vkill_buffer_query_functions, |
| 5856 | doc: /* List of functions called with no args to query before killing a buffer. | 5876 | doc: /* List of functions called with no args to query before killing a buffer. |
| 5857 | The buffer being killed will be current while the functions are running. | 5877 | The buffer being killed will be current while the functions are running. |