From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.devel Subject: Re: Questions about Quail Date: Sat, 23 Jul 2022 17:49:42 +0530 Message-ID: <87zgh0aun5.fsf@gmail.com> References: <87r12kl4km.fsf@gmail.com> <8735esa27p.fsf@gmx.net> <87o7xgcmjj.fsf@gmail.com> <87y1wk8dqn.fsf@gmx.net> <87k084ck82.fsf@gmail.com> <87fsiscjg1.fsf@gmail.com> <878rokcid2.fsf@gmail.com> <87r12c83ea.fsf@gmx.net> 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="15306"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: James Thomas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 23 15:28:57 2022 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 1oFFBg-0003sL-U6 for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Jul 2022 15:28:56 +0200 Original-Received: from localhost ([::1]:39266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFFBf-00078o-V9 for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Jul 2022 09:28:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFE70-0003cB-PA for emacs-devel@gnu.org; Sat, 23 Jul 2022 08:20:03 -0400 Original-Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:39690) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oFE6z-0002tV-4G for emacs-devel@gnu.org; Sat, 23 Jul 2022 08:20:02 -0400 Original-Received: by mail-pl1-x642.google.com with SMTP id c6so6619084pla.6 for ; Sat, 23 Jul 2022 05:20:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :user-agent:mime-version:content-transfer-encoding; bh=Bp5uq5Q6SMY0Tg/d73hMmUwfz6Js/DbLeWWHJLkeEV4=; b=Vm9uRkeCtszQMlr2PUCyyyiRnjrv1AYxVddoMlFOlPzVY00nmF9YKp3gVZRXRxo+3D fDxshDOAXxUbo5BgsBsS1/Iv9l5rgEqpuBDmw80EL0dyktB2E97HbBy1QAwM4ScdMPMf 6UjXGQb59OdeEDtFmys95Vcs0yNyaMfmJvhV4T0/+ZWrCqqyCedF0/tQAyZUfA2ZHPrG q50uNafWI+y8YMxHBnwTPn9weGCWRIp0k/ZAD64U3qVLE6bEvbXpJqxQSDiQTSuOeoYX d77IJpano2kt5fot5gugT24rhDHRvZ7XkNrv0hwckRanx45enc2nC74Fx60YJg/tAqxB 9VWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:user-agent:mime-version:content-transfer-encoding; bh=Bp5uq5Q6SMY0Tg/d73hMmUwfz6Js/DbLeWWHJLkeEV4=; b=i+n18DufegU+QG1VLwHEwLMya0Vy5n1qQw6p48Wubs0PMY9UC6BkYa4NK0OQ3RexQI 8hJJt5GaBkkek1/OljMC6WMuwH+8ecupFOz08YYtj9PcyJzp4V65sp3FwONCLvmuzmke nMda22YAcgrRutzu7ckNFOhmL7oAvKglOlIB4wjS2dQw9TgX1djWri1dgXPoN02ASlDS NSgCwzZIK+pQflbJMpyq9qbxf0m6wSKYpOE2Sl2JlDM+xQERpu7NpBF1YqoF8O07H2HL bWLzRz3WEyiVkBTMOcEbpnxTRyOZLd1Puh8MCYymMKsqpzKJ7zPxzzEtazC36tBVwd8p P/Cg== X-Gm-Message-State: AJIora/Jdmk4k9Aqci6FQfmxBfPyHJIFa7AcB+vXUyVh7n4yPym4btp0 JdwtX2aCoo79zjh4oxFTGxo= X-Google-Smtp-Source: AGRyM1vrMrVxLhaA29UswbQ0OVksix49YmMMuwq0149nFMjglPqgVnCD8Z1mfqxw5HhAR2uEkJvMUw== X-Received: by 2002:a17:903:192:b0:16d:1bdc:109a with SMTP id z18-20020a170903019200b0016d1bdc109amr3845222plg.172.1658578799583; Sat, 23 Jul 2022 05:19:59 -0700 (PDT) Original-Received: from localhost ([49.204.138.209]) by smtp.gmail.com with ESMTPSA id u17-20020a17090341d100b001677d4a9654sm5583809ple.265.2022.07.23.05.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 05:19:58 -0700 (PDT) In-Reply-To: <87r12c83ea.fsf@gmx.net> (James Thomas's message of "Sat, 23 Jul 2022 17:08:53 +0530") Received-SPF: pass client-ip=2607:f8b0:4864:20::642; envelope-from=visuweshm@gmail.com; helo=mail-pl1-x642.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 23 Jul 2022 09:27:58 -0400 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" Xref: news.gmane.io gmane.emacs.devel:292530 Archived-At: [=E0=AE=9A=E0=AE=A9=E0=AE=BF =E0=AE=9C=E0=AF=82=E0=AE=B2=E0=AF=88 23, 2022]= James Thomas wrote: >> The ibus input method does not care about the character before point, it >> only checks the keystrokes hmm... I will wait for user feedback=E2=84= =A2 to >> decide which is better. >> >>> In that web keyboard, try typing hj (=E0=AE=95=E0=AE=AA) then backspace= (=E0=AE=95) and type h >>> again: you will get =E0=AE=95=E0=AF=8D=E0=AE=95. >> >> I.e., whilst you get =E0=AE=95=E0=AF=8D=E0=AE=95 in my input method, you= get =E0=AE=95=E0=AE=95 in the ibus >> one. > > Hmm. One possible solution (albeit a bit complicated), to get the > non-ibus behaviour, is to use the update-translation-function to never > end a translation that reaches up to the last 2 input characters: ie > keep the input pending (unless the last one is not any of the valid > input characters), and programatically insert the translation of any > remaining input character beyond the control-flag. > > But that would work for only one level of backspace. If you have a > simpler implementation with the use of state (or checking the character > before point directly?) that might be better. Yep, checking the character before point is the easiest solution. I tried to keep track of the last character inputted but that quickly got hairy and unnecessarily complicated. The current update-translation-functi= on checks the character before point and the key that was pressed to set the quail-current-string appropriately.