all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: emacs-devel@gnu.org
Subject: Re: Android input methods
Date: Tue, 14 Feb 2023 16:32:40 +0200	[thread overview]
Message-ID: <83sff8co6v.fsf@gnu.org> (raw)
In-Reply-To: <87r0utuhyu.fsf@yahoo.com> (message from Po Lu on Tue, 14 Feb 2023 09:57:29 +0800)

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Tue, 14 Feb 2023 09:57:29 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > These commands don't insert text, so I'm unsure how they are
> > relevant.  The "mmm" is not inserted into a buffer, it is a series of
> > 3 commands.
> 
> Right, but if you type ``mmm'' while the IME is active, then the IME
> will try to insert ``mmm'' as text.

Which is why IME should be turned off in that case.  For comparison,
no one in their right mind will type "mmm" in that case while some
Leim input method is active, right?

> > This feature should be turned off.  It is incompatible with Emacs.  We
> > request users to turn off bidi reordering of terminal emulators for
> > similar reasons.  There's no way we can or should allow external
> > features do stuff like that, because they will never be as flexible as
> > Emacs features.
> >
> > At the very least we should disable them now.  Maybe later we will
> > find less drastic solutions (or maybe the input methods will grow up
> > and become friendlier to Emacs).
> 
> That is possible, but we will have to ask users to do that.

If there's no way to do that programmatically, yes.

> > I don't believe this is so easy.  We'd need a more flexible control on
> > when the input method is enabled and disabled.  Just the major mode is
> > not fine-grained enough.
> 
> Any ideas there?  I mean, under what precise circumstances should Emacs
> enable and/or disable the input method?

Don't know yet.  I suggest to have some variable that Lisp can bind to
control this.  Then we'll find the cases where it is needed as we go.

> > Btw, are you saying that the text should be encoded in UTF-16?  Is
> > that because it's Java?
> 
> Yes.  And instead of code points or bytes, the positions given to Emacs
> are in 16-bit short units, so to convert them to multibyte character
> positions in Emacs without stripping out both unencodable characters and
> those that require surrogate pairs will be nasty.

I wouldn't call that "nasty".  AFAIU, we will need a UTF-16 variant of
BYTES_BY_CHAR_HEAD (called, say, UNITS_BY_CHAR_HEAD), and the rest is
relatively simple, like what we do with our internal encoding.



  reply	other threads:[~2023-02-14 14:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-12 12:58 textconv.c Eli Zaretskii
2023-02-12 14:05 ` textconv.c Po Lu
2023-02-12 14:32   ` textconv.c Eli Zaretskii
2023-02-12 15:06     ` textconv.c Eli Zaretskii
2023-02-12 15:35       ` textconv.c Po Lu
2023-02-12 15:27     ` Android input methods (was: Re: textconv.c) Po Lu
2023-02-12 15:57       ` Eli Zaretskii
2023-02-13  2:21         ` Android input methods Po Lu
2023-02-13 13:49           ` Eli Zaretskii
2023-02-13 14:37             ` Po Lu
2023-02-13 15:17               ` Eli Zaretskii
2023-02-13 17:04                 ` Eli Zaretskii
2023-02-14  1:57                 ` Po Lu
2023-02-14 14:32                   ` Eli Zaretskii [this message]
2023-02-14 15:14                     ` Po Lu
2023-02-14 17:01                       ` Eli Zaretskii
2023-02-15  2:13                         ` Po Lu
2023-02-12 16:00       ` Android input methods (was: Re: textconv.c) Lynn Winebarger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83sff8co6v.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.