From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.devel Subject: Re: quail input methods and conversion functions Date: Fri, 09 Feb 2018 13:26:25 -0500 Message-ID: <87wozmnhny.fsf@md5i.com> References: <878tcbdpf3.fsf@mat.ucm.es> <876078p1gy.fsf@md5i.com> <87tvurldff.fsf@mat.ucm.es> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1518200698 18145 195.159.176.226 (9 Feb 2018 18:24:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Feb 2018 18:24:58 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 09 19:24:53 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 1ekDLd-0003Bw-27 for ged-emacs-devel@m.gmane.org; Fri, 09 Feb 2018 19:24:33 +0100 Original-Received: from localhost ([::1]:54197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekDNe-0000dD-Gz for ged-emacs-devel@m.gmane.org; Fri, 09 Feb 2018 13:26:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekDNX-0000bR-8i for emacs-devel@gnu.org; Fri, 09 Feb 2018 13:26:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekDNS-0005r9-TU for emacs-devel@gnu.org; Fri, 09 Feb 2018 13:26:31 -0500 Original-Received: from md5i.com ([75.151.244.229]:41886) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ekDNS-0005ql-NZ for emacs-devel@gnu.org; Fri, 09 Feb 2018 13:26:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=md5i.com; s=dkim; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=FQ3bMSQy3cE5A95VBUaBs+jzvqoKDmpUMbZs95ERNm0=; b=rf+k3eNUKYGQjc4CpKcJubQtCU seztg6cST9Ce8BSib/vZ06wFTwmQuCG0Vq6lDSuid8+CHHWwbNIXR+mVe+qsGyA8b0GqeHvM4+bBp DZpLTljs9lXCSKDZJ+frnJmIV; Original-Received: from md5i by md5i.com with local (Exim 4.90) (envelope-from ) id 1ekDNR-00069w-TB for emacs-devel@gnu.org; Fri, 09 Feb 2018 13:26:25 -0500 In-Reply-To: <87tvurldff.fsf@mat.ucm.es> (Uwe Brauer's message of "Thu, 08 Feb 2018 16:16:20 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 75.151.244.229 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:222641 Archived-At: Uwe Brauer writes: >>>> "Michael" =3D=3D Michael Welsh Duggan writes: > > > Uwe Brauer writes: > >> In ancient pre Mule times, there was iso-unacentuate which for exam= ple > >> would translatex =C3=A4 to "a > >>=20 > >>=20 > >> Does something like this exist for all, or some quail input methods? > > > It seems to exist. The interactive version is `M-x quail-show-key',= and > > the programmatic version is `quail-find-key'. For example, using the > > latin-1-prefix input method, M-x quail-show-key on =C3=A4 outputs: > > > To input =E2=80=98=C3=A4=E2=80=99, type ""a" > > > and (quail-find-key ?=C3=A4) -> ("\"a") > > > Both of these depend on the current input method, of course. > > Thanks, but these functions do not convert globally, that is for a > region or file, between the two sets. > > I mean suppose I have > > =C3=9Cber den Wolken, unter dem =C3=96l, > > Should give when converted > > "Uber den Wolken, unter dem "Ol. > > And vice versa, same way as iso-accentuate and iso-unaccentuate > worked/s. In the unaccentuate case (which is what your original question), it should be easy to write that functionality using `quail-find-key' as a base. You would have to decide how to handle failures (character can't be typed using the current input method). The accentuate case looks more difficult. Quail allows more than one translation candidate for a single key sequence, which leaves no good way handle these characters. A simple example from the ipa input method: tsh can translate into =CA=A7, t=CA=83, or t=E2=81=80=CA=83. Somet= hing that works with input methods that do not have this ambiguity is possible, though my initial look through the code leads me to believe that this is still going to be more difficult to write then the (fairly trivial) unaccentuate case. --=20 Michael Welsh Duggan (md5i@md5i.com)