diff options
| author | Po Lu | 2024-03-26 10:11:26 +0800 |
|---|---|---|
| committer | Po Lu | 2024-03-26 10:11:26 +0800 |
| commit | 728bf2c9e5353e68b16808ae455223549c16efc6 (patch) | |
| tree | ce2a4aaf1081bab52fb7b4f2e6b7a312ce9da5ba /src | |
| parent | 7fba25cf5344f5c3507aedf59e6ae099e7662508 (diff) | |
| download | emacs-728bf2c9e5353e68b16808ae455223549c16efc6.tar.gz emacs-728bf2c9e5353e68b16808ae455223549c16efc6.zip | |
Prevent passwords from being recorded during text conversion
* doc/lispref/commands.texi (Misc Events): Document new value of
text-conversion-style.
* java/org/gnu/emacs/EmacsService.java (EmacsService)
<IC_MODE_PASSWORD>: New constant.
* java/org/gnu/emacs/EmacsView.java (onCreateInputConnection):
Set TYPE_TEXT_VARIATION_PASSWORD and IME_FLAG_FORCE_ASII if mode
is IC_MODE_PASSWORD.
* lisp/subr.el (read-passwd): Set text-conversion-style to
`password'.
* src/androidgui.h (enum android_ic_mode): New value
ANDROID_IC_MODE_PASSWORD.
* src/androidterm.c (android_reset_conversion): Handle
`password'.
* src/buffer.c (syms_of_buffer)
<&BVAR (current_buffer, text_conversion_style)>: Update doc
string.
* src/textconv.c (syms_of_textconv) <Qpassword>: New DEFSYM.
<Vtext_conversion_edits>: Fix typos in doc string.
Diffstat (limited to 'src')
| -rw-r--r-- | src/androidgui.h | 7 | ||||
| -rw-r--r-- | src/androidterm.c | 2 | ||||
| -rw-r--r-- | src/buffer.c | 7 | ||||
| -rw-r--r-- | src/textconv.c | 3 |
4 files changed, 15 insertions, 4 deletions
diff --git a/src/androidgui.h b/src/androidgui.h index d89aee51055..f941c7cc577 100644 --- a/src/androidgui.h +++ b/src/androidgui.h | |||
| @@ -618,9 +618,10 @@ enum android_lookup_status | |||
| 618 | 618 | ||
| 619 | enum android_ic_mode | 619 | enum android_ic_mode |
| 620 | { | 620 | { |
| 621 | ANDROID_IC_MODE_NULL = 0, | 621 | ANDROID_IC_MODE_NULL = 0, |
| 622 | ANDROID_IC_MODE_ACTION = 1, | 622 | ANDROID_IC_MODE_ACTION = 1, |
| 623 | ANDROID_IC_MODE_TEXT = 2, | 623 | ANDROID_IC_MODE_TEXT = 2, |
| 624 | ANDROID_IC_MODE_PASSWORD = 3, | ||
| 624 | }; | 625 | }; |
| 625 | 626 | ||
| 626 | enum android_stack_mode | 627 | enum android_stack_mode |
diff --git a/src/androidterm.c b/src/androidterm.c index ba9b6d3b8a9..c920375fdbe 100644 --- a/src/androidterm.c +++ b/src/androidterm.c | |||
| @@ -6276,6 +6276,8 @@ android_reset_conversion (struct frame *f) | |||
| 6276 | 6276 | ||
| 6277 | if (NILP (style) || conversion_disabled_p ()) | 6277 | if (NILP (style) || conversion_disabled_p ()) |
| 6278 | mode = ANDROID_IC_MODE_NULL; | 6278 | mode = ANDROID_IC_MODE_NULL; |
| 6279 | else if (EQ (style, Qpassword)) | ||
| 6280 | mode = ANDROID_IC_MODE_PASSWORD; | ||
| 6279 | else if (EQ (style, Qaction) || EQ (f->selected_window, | 6281 | else if (EQ (style, Qaction) || EQ (f->selected_window, |
| 6280 | f->minibuffer_window)) | 6282 | f->minibuffer_window)) |
| 6281 | mode = ANDROID_IC_MODE_ACTION; | 6283 | mode = ANDROID_IC_MODE_ACTION; |
diff --git a/src/buffer.c b/src/buffer.c index 07d19dfc078..9f954e1aba9 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5900,12 +5900,19 @@ Use Custom to set this variable and update the display. */); | |||
| 5900 | text_conversion_style), | 5900 | text_conversion_style), |
| 5901 | Qnil, | 5901 | Qnil, |
| 5902 | doc: /* How the on screen keyboard's input method should insert in this buffer. | 5902 | doc: /* How the on screen keyboard's input method should insert in this buffer. |
| 5903 | |||
| 5903 | When nil, the input method will be disabled and an ordinary keyboard | 5904 | When nil, the input method will be disabled and an ordinary keyboard |
| 5904 | will be displayed in its place. | 5905 | will be displayed in its place. |
| 5906 | |||
| 5905 | When the symbol `action', the input method will insert text directly, but | 5907 | When the symbol `action', the input method will insert text directly, but |
| 5906 | will send `return' key events instead of inserting new line characters. | 5908 | will send `return' key events instead of inserting new line characters. |
| 5907 | Any other value means that the input method will insert text directly. | 5909 | Any other value means that the input method will insert text directly. |
| 5908 | 5910 | ||
| 5911 | When the symbol `password', an input method capable of ASCII input will | ||
| 5912 | be enabled, and will not save entered text where it will be retrieved | ||
| 5913 | for text suggestions or other features not suited to handling sensitive | ||
| 5914 | information, in addition to reporting `return' as when `action'. | ||
| 5915 | |||
| 5909 | If you need to make non-buffer local changes to this variable, use | 5916 | If you need to make non-buffer local changes to this variable, use |
| 5910 | `overriding-text-conversion-style', which see. | 5917 | `overriding-text-conversion-style', which see. |
| 5911 | 5918 | ||
diff --git a/src/textconv.c b/src/textconv.c index 0941848dd09..9625c884e16 100644 --- a/src/textconv.c +++ b/src/textconv.c | |||
| @@ -2318,6 +2318,7 @@ void | |||
| 2318 | syms_of_textconv (void) | 2318 | syms_of_textconv (void) |
| 2319 | { | 2319 | { |
| 2320 | DEFSYM (Qaction, "action"); | 2320 | DEFSYM (Qaction, "action"); |
| 2321 | DEFSYM (Qpassword, "password"); | ||
| 2321 | DEFSYM (Qtext_conversion, "text-conversion"); | 2322 | DEFSYM (Qtext_conversion, "text-conversion"); |
| 2322 | DEFSYM (Qpush_mark, "push-mark"); | 2323 | DEFSYM (Qpush_mark, "push-mark"); |
| 2323 | DEFSYM (Qunderline, "underline"); | 2324 | DEFSYM (Qunderline, "underline"); |
| @@ -2325,7 +2326,7 @@ syms_of_textconv (void) | |||
| 2325 | "overriding-text-conversion-style"); | 2326 | "overriding-text-conversion-style"); |
| 2326 | 2327 | ||
| 2327 | DEFVAR_LISP ("text-conversion-edits", Vtext_conversion_edits, | 2328 | DEFVAR_LISP ("text-conversion-edits", Vtext_conversion_edits, |
| 2328 | doc: /* List of buffers that were last edited as result of text conversion. | 2329 | doc: /* List of buffers last edited as a result of text conversion. |
| 2329 | 2330 | ||
| 2330 | This list can be used while handling a `text-conversion' event to | 2331 | This list can be used while handling a `text-conversion' event to |
| 2331 | determine which changes have taken place. | 2332 | determine which changes have taken place. |