From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: textconv.c Date: Sun, 12 Feb 2023 23:35:58 +0800 Message-ID: <877cwmzyjl.fsf@yahoo.com> References: <83r0uvghw7.fsf@gnu.org> <87k00nyo60.fsf@yahoo.com> <83ilg7gdjj.fsf@gnu.org> <83bklyhqi5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31034"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 12 16:39:12 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 1pRERb-0007qh-Uh for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Feb 2023 16:39:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRER2-0001GP-1g; Sun, 12 Feb 2023 10:38:36 -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 1pREQr-0001Ag-34 for emacs-devel@gnu.org; Sun, 12 Feb 2023 10:38:25 -0500 Original-Received: from sonic314-47.consmr.mail.ne1.yahoo.com ([66.163.189.173]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pREQo-0003IF-GR for emacs-devel@gnu.org; Sun, 12 Feb 2023 10:38:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676216299; bh=NjFBAV+stK5ymY/Z/VVWARHvQyHy/A4HzxZRNhFnItk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=PwBQ2ddVDu/8NnCQEPLNtkrOTwnfV1PtRAsgiKVNGAlbTAto5vIVCYXRooLylQG+QmRq8/tTWxruBFWjSJDyEoBvNLlsnDSOj3R/0RxngnT+qks1l1Aev8wVWGvd1auGublVUrqqLdGMh2IWjM8d1fOwXvysRDrs8Tz39Aj0SZph6lo+6HkV1npxZQ816QbCnklASBkYXwQT/lX+bO95EhBE37x8gEV2t7jFLdMV3Y51i9tjgi3MXOBLDoOVT5lj3eIPTgT3jq8vF2qNtWH4ppz1mtVjlwSYhLY6rLgBe6ynfKoxezr195DpgPQbWOjf512Mjt6FhUQF0RxINKa8HA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676216299; bh=69Ek64MyjXo/lHVuKI9K73HLfmJvBYcAmEw/P/I3uEU=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=fJRoEbdL1YhanVAuxOfPQOe/ZECTzUHnF2uQeGsXGFkH23YG4Q3EVYMyMDGG89tGKJtqbuo7FSIb6N5IwX8Xw4MTbKzfAmIilQOi1PePEnt12Afmppi88AEVuY9vyFa1D5cMvqKsc07kolrE7+gtWf5o1UIYmTMFfoEEK+o0kQ32pNNUJg4ZDqTyxviXnEMCmprIhg25WnkHVSbXllMPKzFSNcJcUDrE4CdjcGaAygfunufNTtvnxvRHOVsqcu9pdRsK2bLI0WNhnqqUSPK7K9w8zrTk3HBF9DJJrgS/CuFQEaa/1Q0hKYi/L6YbGqE50/Zoy9B1nZDc1H9i/cYffQ== X-YMail-OSG: nrOucL4VM1naq3JcncEHX0XHocoVojbqDpRKgoLRK7jTZ_Rz7VR7FcNE1idB2fn V_R6aT7HXFS.vKWSUBKiIUxkLh78tqRKt_7M2RLQ0cW1_N4L13VXSuY8LSFAuOOLMPEI7ex0rw32 rDp1yZyqrBkqJbjDSnLs56w6vSn9CeZ2r6WAF0juK5A9bm_LKVcXfy6JN3wGVIYaGtgvDaxOAtKF 99q11EUGGTEfPQBh2vmSB57FJZz.ZPNjiLc8MykRaWQZLlD2NuH2urFGp8MjFq65E0.zznTBhgCt JD_u9dcR2FjYyDJUevRoEptHBc7t_SfEutKMtCVbJ4LpSSPzUg4Y8s5Xjv7Ri2vEHkt.1ngF_Ypy yE2cr_WK0f_LDgrEswuk7F7NgasTwr5XRQCbMWUaNXbJbBSWPw6oZbXNfqRi42zxnpm3vl32OpuC CErzNnSFMleKmnvlolbcOesZ0HLfwjpV_AVme.wMGy9P3EqxT9INbaXVrd5iO8RKUzP9KhW.5yVz .p65MtUQkKiW2gtgnQ5kZZjqeBynZhxCtf.7Y727kRu4kkQGnvwDbCGta2vVq8cdHivBUBhOX73H QdmmWmjZCvYHbjgNp4zB.Qh0zTrq9tQoA.tdguLV899H0DqBEOPq2_KGU3SA6e7Jg4kgU9BfEnJL QN0D5MHkdK0vIgjWXK0PoflV0rINuddz9R5Bkjwf88cVP5qyzJx27Q6_eTOrfUWS_TDC6jlJxROr Y3oKMX_ckdUxD8bfruqI2Rc6RwMox023uNywuJ0F9KM_B_ajPmikHCyTMsoyAp6QFXNhBROWK0Rg LhV4dvajblu.tCwhfaRhaNskV27ihXf6VwzKhslU0x X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Sun, 12 Feb 2023 15:38:19 +0000 Original-Received: by hermes--production-sg3-9fc5746c8-vmkgs (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID ee111702b005cdcb3a5221bef28b1e2f; Sun, 12 Feb 2023 15:36:16 +0000 (UTC) In-Reply-To: <83bklyhqi5.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 12 Feb 2023 17:06:58 +0200") X-Mailer: WebService/1.1.21183 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.189.173; envelope-from=luangruo@yahoo.com; helo=sonic314-47.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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:303181 Archived-At: Eli Zaretskii writes: >> Date: Sun, 12 Feb 2023 16:32:16 +0200 >> From: Eli Zaretskii >> Cc: emacs-devel@gnu.org >> >> My suggestion is that you describe the problem(s), i.e. what these >> input methods expect from the client application, in enough detail >> that will allow people here think about it and suggest solutions. > > Btw, if this stuff is described somewhere, like descriptions of some > protocols and/or standards, pointing to that might save you a lot of > writing. Here is the InputConnection protocol that Emacs must implement: https://developer.android.com/reference/android/view/inputmethod/InputConnection and here is the InputMethodManager that Emacs must call: https://developer.android.com/reference/android/view/inputmethod/InputMethodManager and here is the `text-input-unstable-v3' protocol currently used by most Wayland compositors. It is soon to be replaced by `text-input-unstable-v4', which I have not yet investigated: https://wayland.app/protocols/text-input-unstable-v3 The requests of interest in the Android InputConnection protocol are commitCompletion, commitCorrection, commitText, deleteSurroundingText, finishComposingText, getExtractedText, getSelectedText, getSurroundingText, getTextBeforeCursor, getTextAfterCursor, replaceText, setSelection, requestCursorUpdates, requestTextBoundsInfo, setComposingRegion, setComposingText, setSelection, and takeSnapshot. These must be implemented by Emacs for input methods to work correctly. Emacs must also call the following APIs in InputMethodManager: restartInput invalidateInput updateCursor updateCursorAnchorInfo updateExtractedText updateSelection. The requests of interest in the Wayland text-input-unstable-v3 protocol are preedit_string, commit_string, delete_surrounding_text, set_surrounding_text; the rest are optional (but this is supposed to change in the V4 protocol.)