From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Android input methods Date: Tue, 14 Feb 2023 16:32:40 +0200 Message-ID: <83sff8co6v.fsf@gnu.org> References: <83r0uvghw7.fsf@gnu.org> <87k00nyo60.fsf@yahoo.com> <83ilg7gdjj.fsf@gnu.org> <87bklyzyyj.fsf_-_@yahoo.com> <83a61iho6r.fsf@gnu.org> <87ttzqxq3f.fsf@yahoo.com> <83cz6dfzet.fsf@gnu.org> <87edqtws0w.fsf@yahoo.com> <835yc5fvd1.fsf@gnu.org> <87r0utuhyu.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15044"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Feb 14 15:33:44 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pRwNL-0003hf-OE for ged-emacs-devel@m.gmane-mx.org; Tue, 14 Feb 2023 15:33:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRwMp-0007Z7-0b; Tue, 14 Feb 2023 09:33:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRwMi-0007Xq-N8 for emacs-devel@gnu.org; Tue, 14 Feb 2023 09:33:04 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRwMg-0005JH-GL; Tue, 14 Feb 2023 09:33:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=l9Da5rXHmk9HDqlgGcJ0jd2p11CiBKTUlPjHpmBIDhs=; b=n1B4qYSpnHwo 7OIF3TvVBLBw0orZ9T/XafzNZ5q+xMl+VzHMn2Vzk1v8zajdUJykNUAV0/ylnhvfkdcsOJTl2FZcZ iVSESXUWVUJraWA0Fk6EQloPxgg510s14fveHPBEY4q38DQFEAj0btgnp3eneF3pKJIX0CoAnFnvf EPpGZwXIt2X8CUZYS6Kcwbni0E7rGZUWjeBCXn1RqhcZSGQjwmBXHT4uoVT71mHwt0JSxeLw+7HTm dfy3+flA/CH+R+csqQbtH4uD+1BJmksSNrK3raG0djP4T5ntBghyLDEhkUDFB5OAUt6BfoYBHwLXM bw/NU/RcvGIwQq7IGC/Sdw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRwMf-00064E-5l; Tue, 14 Feb 2023 09:33:02 -0500 In-Reply-To: <87r0utuhyu.fsf@yahoo.com> (message from Po Lu on Tue, 14 Feb 2023 09:57:29 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303276 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Tue, 14 Feb 2023 09:57:29 +0800 > > Eli Zaretskii 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.