GNU bug report logs - #62190
30.0.50; analyze-text-conversion in Android

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Tue, 14 Mar 2023 17:30:02 UTC

Severity: normal

Found in version 30.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62190 in the body.
You can then email your comments to 62190 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to luangruo <at> yahoo.com, bug-gnu-emacs <at> gnu.org:
bug#62190; Package emacs. (Tue, 14 Mar 2023 17:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
New bug report received and forwarded. Copy sent to luangruo <at> yahoo.com, bug-gnu-emacs <at> gnu.org. (Tue, 14 Mar 2023 17:30:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; analyze-text-conversion in Android
Date: Tue, 14 Mar 2023 13:29:43 -0400
Package: Emacs
Version: 30.0.50


I tried out the Emacs distributed on F-Droid, which is apparently built
from our feature/android work, and I bumped into
`analyze-text-conversion`.  Currently, this breaks things like `ESC x`
(I don't have Meta/Alt on my keyboard) or `C-h l` because the second
event I get is not a letter (like `x` or `l`) but the event
`text-conversion`.  I guess this may depend on the keyboard, admittedly.

IIUC this is tied to the feature whereby you can "build" a word from the
keyboard before sending it "for real" to Emacs, but you get to see this
word in your buffer before it's "committed"?

Maybe `text-conversion` should not be generated when we're "in the
middle" of `read-key-sequence`?  Or maybe `text-conversion` should be
turned into a sequence of "normal" events via `input-decode-map`?
Or maybe more of the event processing should be done in ELisp and less
in C (i.e. the raw events would be exposed to ELisp and they'd be
processed a bit more like we do with our input-methods)?

I'm not very knowledgeable about this topic (under Android I use my
on-screen keyboards as if they were normal keyboards, very rarely even
making use of the predictive features).


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62190; Package emacs. (Wed, 15 Mar 2023 00:48:01 GMT) Full text and rfc822 format available.

Message #8 received at 62190 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 62190 <at> debbugs.gnu.org
Subject: Re: bug#62190: 30.0.50; analyze-text-conversion in Android
Date: Wed, 15 Mar 2023 08:47:16 +0800
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> Package: Emacs
> Version: 30.0.50
>
>
> I tried out the Emacs distributed on F-Droid, which is apparently built
> from our feature/android work, and I bumped into
> `analyze-text-conversion`.  Currently, this breaks things like `ESC x`
> (I don't have Meta/Alt on my keyboard) or `C-h l` because the second
> event I get is not a letter (like `x` or `l`) but the event
> `text-conversion`.  I guess this may depend on the keyboard, admittedly.

Stefan, this was already fixed on the feature/android months ago, by
disabling text conversion in the middle of `read-key-sequence'.  I
suggest you use (more) up-to-date prebuilts at:

  https://sourceforge.net/projects/android-ports-for-gnu-emacs/upload/

> IIUC this is tied to the feature whereby you can "build" a word from the
> keyboard before sending it "for real" to Emacs, but you get to see this
> word in your buffer before it's "committed"?

This is up to the input method, Emacs knows nothing about the input
method policy, only that it should perform edits and apply faces to the
buffer as instructed.

> Maybe `text-conversion` should not be generated when we're "in the
> middle" of `read-key-sequence`?  Or maybe `text-conversion` should be
> turned into a sequence of "normal" events via `input-decode-map`?
> Or maybe more of the event processing should be done in ELisp and less
> in C (i.e. the raw events would be exposed to ELisp and they'd be
> processed a bit more like we do with our input-methods)?
>
> I'm not very knowledgeable about this topic (under Android I use my
> on-screen keyboards as if they were normal keyboards, very rarely even
> making use of the predictive features).

Moving it to Lisp is unfortunately not possible, as Android input
methods require 150% obedience from Emacs that can only be accomplished
by hard wiring the logic in C.




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Wed, 15 Mar 2023 17:54:02 GMT) Full text and rfc822 format available.

Notification sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
bug acknowledged by developer. (Wed, 15 Mar 2023 17:54:02 GMT) Full text and rfc822 format available.

Message #13 received at 62190-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 62190-done <at> debbugs.gnu.org
Subject: Re: bug#62190: 30.0.50; analyze-text-conversion in Android
Date: Wed, 15 Mar 2023 13:52:51 -0400
> Stefan, this was already fixed on the feature/android months ago, by
> disabling text conversion in the middle of `read-key-sequence'.

Sorry, I didn't realize it was so old.

> I suggest you use (more) up-to-date prebuilts at:
>
>   https://sourceforge.net/projects/android-ports-for-gnu-emacs/upload/

Will take a look at it, thanks.

>> Maybe `text-conversion` should not be generated when we're "in the
>> middle" of `read-key-sequence`?  Or maybe `text-conversion` should be
>> turned into a sequence of "normal" events via `input-decode-map`?
>> Or maybe more of the event processing should be done in ELisp and less
>> in C (i.e. the raw events would be exposed to ELisp and they'd be
>> processed a bit more like we do with our input-methods)?
>>
>> I'm not very knowledgeable about this topic (under Android I use my
>> on-screen keyboards as if they were normal keyboards, very rarely even
>> making use of the predictive features).
>
> Moving it to Lisp is unfortunately not possible, as Android input
> methods require 150% obedience from Emacs that can only be accomplished
> by hard wiring the logic in C.

So maybe our best hope is to use `input-decode-map`?

Some aspects might seem tricky (e.g. the fact that it could affect
several buffers), but OTOH `input-decode-map` should simplify some of
the code by removing the ad-hoc handling of electric-pair and auto-fill.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62190; Package emacs. (Thu, 16 Mar 2023 00:39:01 GMT) Full text and rfc822 format available.

Message #16 received at 62190-done <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 62190-done <at> debbugs.gnu.org
Subject: Re: bug#62190: 30.0.50; analyze-text-conversion in Android
Date: Thu, 16 Mar 2023 08:38:38 +0800
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> Stefan, this was already fixed on the feature/android months ago, by
>> disabling text conversion in the middle of `read-key-sequence'.
>
> Sorry, I didn't realize it was so old.
>
>> I suggest you use (more) up-to-date prebuilts at:
>>
>>   https://sourceforge.net/projects/android-ports-for-gnu-emacs/upload/
>
> Will take a look at it, thanks.
>
>>> Maybe `text-conversion` should not be generated when we're "in the
>>> middle" of `read-key-sequence`?  Or maybe `text-conversion` should be
>>> turned into a sequence of "normal" events via `input-decode-map`?
>>> Or maybe more of the event processing should be done in ELisp and less
>>> in C (i.e. the raw events would be exposed to ELisp and they'd be
>>> processed a bit more like we do with our input-methods)?
>>>
>>> I'm not very knowledgeable about this topic (under Android I use my
>>> on-screen keyboards as if they were normal keyboards, very rarely even
>>> making use of the predictive features).
>>
>> Moving it to Lisp is unfortunately not possible, as Android input
>> methods require 150% obedience from Emacs that can only be accomplished
>> by hard wiring the logic in C.
>
> So maybe our best hope is to use `input-decode-map`?
>
> Some aspects might seem tricky (e.g. the fact that it could affect
> several buffers), but OTOH `input-decode-map` should simplify some of
> the code by removing the ad-hoc handling of electric-pair and auto-fill.

Unfortunately not, because the effect of an input method edit is already
performed prior to a `text-conversion' event being sent.  The edit may
also have been made to multiple frames, simultaneously.

I suggest looking at the code in textconv.c, the functions which are
decorated with `JNIEXPORT' in androidterm.c, and
java/org/gnu/emacs/EmacsInputConnection.java.  Thanks.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 13 Apr 2023 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 13 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.