From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.devel Subject: Re: Preventing accidental prefix match in input-method Date: Fri, 23 Nov 2018 23:47:33 +0100 Message-ID: <87y39j9zsq.fsf@fastmail.fm> References: <87efbbh710.fsf@md5i.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1543013453 26774 195.159.176.226 (23 Nov 2018 22:50:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 23 Nov 2018 22:50:53 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 26.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 23 23:50:48 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gQKHf-0006rL-PE for ged-emacs-devel@m.gmane.org; Fri, 23 Nov 2018 23:50:48 +0100 Original-Received: from localhost ([::1]:54483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQKJm-00048b-2I for ged-emacs-devel@m.gmane.org; Fri, 23 Nov 2018 17:52:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQKJV-0003iS-LE for emacs-devel@gnu.org; Fri, 23 Nov 2018 17:52:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQKEd-0006Ck-B6 for emacs-devel@gnu.org; Fri, 23 Nov 2018 17:47:43 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:59761) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gQKEd-0006A9-3g for emacs-devel@gnu.org; Fri, 23 Nov 2018 17:47:39 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 2FDDA21F40 for ; Fri, 23 Nov 2018 17:47:37 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 23 Nov 2018 17:47:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:subject:in-reply-to:date:message-id :mime-version:content-type:content-transfer-encoding; s=fm1; bh= kGcUbdZONBeg0QZEzTKe2Mc0ALk7ag7mzz8Sbi/IJvs=; b=vUvURp7cLSeC8pcQ emTg6Z9+4nTZIKS0AoViIDuTh82Lzpq9edbpoFVaXSH9DEENGITeIQlQcaTS/zF+ lMgpaB7/M/b/bvYaBn5IxQsOTjoJM9D2k+bbTTP+Bwv0VpQaZouXV0NAjraf4AE6 3wJGeKksYDFirGEb6nVpsbCC8MUPZKJDy39HNHQ186jU9T2YgXVhjSWW/geWpuc7 zu9NFv0J5aBP1rgPWmmYcxKTzEFws6hUx+qKCHbzKaTYyx46lkyqniBBzfQ7AU0D hwqSgDk6of1Sh0gWPNoe7AQGgY9qr2i5xNqWYxzvMDH0y0Ns08E/k05xW1M3CqYs o65yxA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=kGcUbdZONBeg0QZEzTKe2Mc0ALk7ag7mzz8Sbi/IJ vs=; b=FvJw4SW+KQlq4KZEegnTuQt8mrm++TZZJbIRJ7HphhYjmQwsJfZLx3dP4 BGp4yvTj8pxTHK84xM+MmCBa3cMHFa/InMLiys9f+CfVKayE49wavroNHeSjaHfv 7l64Jqg8Tq6IPrUpx0gz43k7jGJ4LaJdiEsvgQ/ckT1MXQxZqg/Dt+AGLIwPsqW3 knTyVCEnASW+J+je5djTQYfet+sqd1xeDLEwNql2tNOF0GZcpmDp07IONf3pYOkt kas8VE0EtlmdiXV/mXbhXoBL83PVZZdo5f0lVGOaiBTOwoQeJrYIyBxsOeIebWXQ H2OrlOBLyrgleKh6uYQuWmkyItHIg== X-ME-Sender: X-ME-Proxy: Original-Received: from Swift.fastmail.com (ip5f5ac90a.dynamic.kabel-deutschland.de [95.90.201.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 5B778102E8 for ; Fri, 23 Nov 2018 17:47:36 -0500 (EST) In-reply-to: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.28 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:231322 Archived-At: On Fri, Nov 23 2018, Stefan Monnier wrote: >>> I'd like to setup an input method where I have a mapping >>> >>> \b =3D> =CE=B2 >>> >>> but where I'd like it that when the user enters `\beta` >>> the result is `\beta` rather than `=CE=B2eta`. >>> >>> I know I can do it by adding mappings >>> >>> \ba =3D> \ba >>> \bb =3D> \bb >>> \bc =3D> \bc >>> \bd =3D> \bd >>> \be =3D> \be >>> ... >>> >>> but that would blow up my input method by a factor 50. >>> Is there a better solution? >> >> Would adding a mapping from `=CE=B2eta` to `\beta` work? > > I didn't mean that only `\beta` stays untouched, sorry. > `\big` should also stay as `\big` rather than be turned into=20 > `=CE=B2ig`, and > same for all other `\b` where is made up=20 > of > alphabetic characters. > > IOW I'd like to be able to say something like "\b is rewritten=20 > to =CE=B2 but > only if immediately followed by a word boundary". You could always create mapping of the form "\b " (i.e., with a=20 space) =3D> =CE=B2, but then you may need to add more mappings such as=20 "\b.", "\b,", etc., all mapping to =CE=B2. Also not ideal. The way to deal with this, AFAICT, is to add a binding that=20 effectively cancels the "special" character. For example,=20 latin-9-prefix uses space for this: typing ' followed by a gives=20 =C2=AB=C3=A1=C2=BB, but ' + space + a gives =C2=AB'a=C2=BB. The TeX input m= ethod allows you=20 to type backslash twice to get a single backslash. So you could add a mapping from "\\" or "\ " to "\" and accustom=20 yourself to typing "\\beta" or "\ beta" to get "\beta". --=20 Joost Kremers Life has its moments