From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Andr=C3=A9_A=2E_Gomes?= Newsgroups: gmane.emacs.devel Subject: Re: How do you write input methods? Date: Mon, 30 Aug 2021 23:12:07 +0300 Message-ID: <87fsuqofoo.fsf@gmail.com> References: <8d1a3c4b-80fd-65c8-70b6-1ab452a52f6a@piermont.com> <87h7f7qa4k.fsf@gmail.com> <83mtozj5bg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20504"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cc: perry@piermont.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 30 22:14:32 2021 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 1mKnfr-00055P-Ro for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Aug 2021 22:14:31 +0200 Original-Received: from localhost ([::1]:48032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKnfq-00023m-91 for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Aug 2021 16:14:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKndd-0008KQ-0s for emacs-devel@gnu.org; Mon, 30 Aug 2021 16:12:13 -0400 Original-Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]:33713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mKndb-0001MY-A6; Mon, 30 Aug 2021 16:12:12 -0400 Original-Received: by mail-lj1-x236.google.com with SMTP id s12so28067907ljg.0; Mon, 30 Aug 2021 13:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=OSYA3GOJ71REv/d2vv3afUJ/hVFHkT0RSr7reoVOLw0=; b=SdjTi4ldcuHi3/QWd0o2QNRG4obm4sAEvJluaYCEsujEKmCfsYky36EIuELc2VlqfC AlYLV/144h/s9Jnht4kjY/nU9p4LLvRX6CDmnBZzFPSmlgaUOKL9kfnnG9X0nfVBhss0 pMiAfBmShBJ8FLVBnLvg/SPjkRhF+SuLDIAqqa2EC3xB7HIX/TliulWPtnJ5NFBtdcWC 9ocBMhA69v7twY0WpyiwuOh/q6GsyYk+sd54cUPIobgmEzBFQRl6VrzALsUwFBAPzKky KOdNvjUJKDpDBKo6feNuC6OxD+ugzkun72NJtPmrSRF+ad7kmPl33Tl7Al7aGDp9xqJU YTtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=OSYA3GOJ71REv/d2vv3afUJ/hVFHkT0RSr7reoVOLw0=; b=rFmv0f75K/r+daYMzxPPrUYzRVz87+6VLyqeKmerw/xuFRx+CFtgwxsVI6flPcBwaX mWScoTuPVyBmnosQNHUQiLjUSGhfGf+KFO7EmahhzFYUsb0ad4Ra5zdzFoguP/YSE8lj hSyAeUY3/0qRKaHVbwVETJak1ZLAc/QArJqZL6HOvPgB/YJksvVEe/CBV814KEzLoGEl bRBbqh1BOqRpOqeVDIpaoKUCZfPbZnvET95Cs70HBFJBmx+lh0JcsjMDQ/q65X5788bZ tEAIZHwXg09tCA9HlIsPE5OoAd43ZnmcSTPAC3BnSu1Uf9Fs5LlEeVs1ZdXJICctwxgN DTug== X-Gm-Message-State: AOAM5301M+cnRRPbbP/z8AqTg2fc0lFd4dSHf3rJfQ6Xh0TaJiCOA1BW TTTiofauhpv1KTXNVkIBe28QicjLzyM= X-Google-Smtp-Source: ABdhPJzYcyvuYtyTflJiIGeSNFX+GA6lZRC5Oa8KrKAY+el/nYrTJMP6GYjNwnKSoF09ZBT127sxZQ== X-Received: by 2002:a2e:9615:: with SMTP id v21mr21307170ljh.22.1630354329110; Mon, 30 Aug 2021 13:12:09 -0700 (PDT) Original-Received: from guix-xps13 (78-107-221-113.broadband.corbina.ru. [78.107.221.113]) by smtp.gmail.com with ESMTPSA id m16sm1489314lfh.243.2021.08.30.13.12.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Aug 2021 13:12:08 -0700 (PDT) In-Reply-To: <83mtozj5bg.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 30 Aug 2021 18:54:59 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=andremegafone@gmail.com; helo=mail-lj1-x236.google.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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:273550 Archived-At: Eli Zaretskii writes: >> From: Andr=C3=A9 A. Gomes >> Date: Mon, 30 Aug 2021 17:29:15 +0300 >> Cc: emacs-devel@gnu.org >> >> I thought I could share this idea, but I'm not sure the maintainers will >> like the idea to move non-CJK input methods from quail to robin. From >> the user perspective, it would bring new interesting features. > > I don't think I understand what kind of "move" you are proposing here, > and what features would that enable. Please elaborate. There's a feature regarding input methods (IMs) that Emacs doesn't have, but it's relatively easy to implement. Let me describe it. Let's think about non-CJK IMs, i.e. IMs for which there is a bijection between the keyboard layouts. The simplest example would be the bijection between QWERTY and QWERTZ. Examples of "interesting" bijections would be mapping QWERTY to either =D0=99=D0=A6=D0= =A3=D0=9A=D0=95=D0=9D (Russian layout) or the Greek layout. It's handy to toggle IMs, but here's what often happens: you type a string; realise that the wrong IM was selected; toggle the IM; delete the string and retype. This is tiresome. This is the itch I'm scratching. Robin can be leveraged to implement such a feature. There are actually 2 features here. One is to be able to manually transform a string as if it has been typed with the another IM selected. Example: take the QWERTY <-> QWERTZ bijection; "yes" maps to "zes", and vice-versa. The second is a minor mode that implements a "smarter" way to automatically toggle IMs. Example: take the US QWERTY <-> =D0=99=D0=A6=D0= =A3=D0=9A=D0=95=D0=9D bijection; type "ghb" while the US IM is selected; it automatically changes the IM to russian and transforms it into "=D0=BF=D1=80=D0=B8". The= re's no word in english starting with "ghb", whereas "=D0=BF=D1=80=D0=B8" is the beginni= ng of the word "=D0=BF=D1=80=D0=B8=D0=B2=D0=B5=D1=82". Indeed, this mode requires so= me work. For a more visual explanation and a low quality proof of concept, please refer to https://github.com/aadcg/emacs-yeis. When I worked on this, I tried to imagine how it could potentially be integrated into Emacs. I see two alternatives. Here's how I think it should be done. It makes little sense that all IMs are defined with quail, expect for CJK and other "complex" ones. But the "simple" ones should use always robin. Nothing would change for the user, and the above mentioned features would be available "for free". The alternative is to keep all IMs definition, and add the new ones. Say that those will have "-robin" as suffix. In this scenario, you'll have, for instance, "russian-computer" (defined with quail) and "russian-computer-robin" (defined with robin). But they're actually the same, so it makes little sense. Hopefully that was clear. -- Andr=C3=A9 A. Gomes "Free Thought, Free World"