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.bugs Subject: bug#56323: 29.0.50; [v2] Add new customisable phonetic Tamil input method Date: Sat, 02 Jul 2022 13:41:17 +0530 Message-ID: <878rpcj5ne.fsf@gmail.com> References: <87pmiqe4da.fsf@gmail.com> <878rpdq99n.fsf@gmail.com> <83fsjldl2b.fsf@gnu.org> <87tu81osgp.fsf@gmail.com> <83czepdj0z.fsf@gnu.org> <87pmioq51w.fsf@gmail.com> <831qv4erwf.fsf@gnu.org> <87r134aiwd.fsf@gmail.com> <83wncwd7gy.fsf@gnu.org> <8735fkkvqd.fsf@gmail.com> <83o7y8c983.fsf@gnu.org> <87letcj974.fsf@gmail.com> <83k08wc7a3.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="2246"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 56323@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 02 10:12:13 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1o7YEd-0000S4-RP for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Jul 2022 10:12:11 +0200 Original-Received: from localhost ([::1]:60248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7YEc-0001Ie-A2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 02 Jul 2022 04:12:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7YEU-0001IU-M6 for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2022 04:12:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7YEU-0006mr-CT for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2022 04:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o7YEU-0008L1-4M for bug-gnu-emacs@gnu.org; Sat, 02 Jul 2022 04:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Jul 2022 08:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56323 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 56323-submit@debbugs.gnu.org id=B56323.165674948831999 (code B ref 56323); Sat, 02 Jul 2022 08:12:02 +0000 Original-Received: (at 56323) by debbugs.gnu.org; 2 Jul 2022 08:11:28 +0000 Original-Received: from localhost ([127.0.0.1]:39685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7YDv-0008K3-LR for submit@debbugs.gnu.org; Sat, 02 Jul 2022 04:11:27 -0400 Original-Received: from mail-pf1-f195.google.com ([209.85.210.195]:46001) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7YDu-0008Jm-4P for 56323@debbugs.gnu.org; Sat, 02 Jul 2022 04:11:26 -0400 Original-Received: by mail-pf1-f195.google.com with SMTP id 128so4444455pfv.12 for <56323@debbugs.gnu.org>; Sat, 02 Jul 2022 01:11:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=Yx/tGES3/+nRnxlKj1nSUZmA5iUeLQxf6CE9HeiIdyg=; b=QG/BLAWN4usn7dz63OLSgGCEVUozbNHPHa0KVslPsEugSI+HigGY+TnTvl7/omB3Dq oMC9NSXcTTZyNdbjp/Ea5TM6veSEcEQg7aAFBJnFSNbIZgZEeRMOXHYpRimgxsD3Lo7d wRAaWtN8Ti8SfePtTL0EfHBZAekjM6hAj/xSmdNVleeT9by99xvvMF2eRCkm2LM8FZLh fRP8MfrneP0RgpYgpWV3IBh+UJDp+Bm/EJqT7tZPOZCIxPLhg61rnu76lKFzk5paS7Lc +QwSx3X61uY6yviSvUrw8OBIQpZAbBcy101qFWr9CB6Ty9GkH9F83DgXGuGJsw7PVhXU hEIA== 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:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=Yx/tGES3/+nRnxlKj1nSUZmA5iUeLQxf6CE9HeiIdyg=; b=aE1fcv5RIGeRRnL45LczTMOrp25Fj0ordEJ3qPSyaaUvHc+V9u+oeLh0+vT1SZm/rj NX3/4+MoSzWzNEhe+ZRazkh43eK96lKn+zlrYyatZ05S6jZRAtw/6H2ZHK3Ic+H4ePZo fVbrrsnk3bO0lspONA5JuejqeDR9PJ0DO8n0uTRnPdOmeM07YzLrx+BBvj/gZoRPA/uo ln2DIP+dhQc16KRjrXGQ5zmRDhcSFu/D4j1gKzhcN6a9CQPCmXbT+6XdjkHjm+4T6Wpf Dj5J2Uzgr7tmzzaIzJbJDGNVR31ap4n2mCjxWt6HbzFQECjYj2EkgvpQscg6jf+HS6nr SlEA== X-Gm-Message-State: AJIora95Fmrfl5PrNJ0kaQ+4nb9KsAJcPIGrIsoRa4adUgc3J8GdvK5i Ri9yjJlrLrZBuNbS2M5eQ1s= X-Google-Smtp-Source: AGRyM1uZzKAUBCFiAe7ze2jYjvJ3nb5hAQwHkIH4qIQOGjUIqBY/roCz+GqNxKWUb/EhEEWrE95HJw== X-Received: by 2002:a63:f91b:0:b0:40d:d291:1555 with SMTP id h27-20020a63f91b000000b0040dd2911555mr15848761pgi.399.1656749480247; Sat, 02 Jul 2022 01:11:20 -0700 (PDT) Original-Received: from localhost ([49.204.136.62]) by smtp.gmail.com with ESMTPSA id jf5-20020a170903268500b0016a1d007637sm16728216plb.110.2022.07.02.01.11.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 01:11:19 -0700 (PDT) In-Reply-To: <83k08wc7a3.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 Jul 2022 10:17:56 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235859 Archived-At: [=E0=AE=9A=E0=AE=A9=E0=AE=BF =E0=AE=9C=E0=AF=82=E0=AE=B2=E0=AF=88 02, 2022]= Eli Zaretskii wrote: >> From: Visuwesh >> Cc: 56323@debbugs.gnu.org >> Date: Sat, 02 Jul 2022 12:24:39 +0530 >>=20 >> [=E0=AE=9A=E0=AE=A9=E0=AE=BF =E0=AE=9C=E0=AF=82=E0=AE=B2=E0=AF=88 02, 20= 22] Eli Zaretskii wrote: >>=20 >> >> There are two "classes" of consonants: those that are part of Tamil >> >> (let's call them "core") and those borrowed from Sanskrit. When one >> >> writes the consonants in order, the core consonants come first then t= he >> >> Sanskrit ones. You can find the order of the core consonants in >> >> wikipedia here in the table titled "Tamil consonants": >> >> https://en.wikipedia.org/wiki/Tamil_script#Letters >> >>=20 >> >> We need not worry too much about the order of Sanskrit consonants, we >> >> just need to ensure that they come after the core consonants. You can >> >> find these Sanskrit consonants in the table titled "Grantha consonants >> >> in Tamil" in the same link. >> >>=20 >> >> I hope this is clear. >> >>=20 >> >> As for the criteria, it is simply "Tamil consonants then the Sanskrit >> >> consonants." >> > >> > Then your comparison function should first see whether a character is >> > in the former or the latter group, and use string-lessp or character >> > codepoint comparison with each group, right? But that's not what you >> > did, so I wonder whether my understanding is correct. >>=20 >> It didn't occur to me to do it this way so I tried it out but then I >> noticed, string-lessp even within a group won't work. When you evaluate >> the following sexp, you don't get a list of increasing numbers... >>=20 >> (let ((core-consonants '("=E0=AE=95" "=E0=AE=99" "=E0=AE=9A" "=E0=AE= =9E" "=E0=AE=9F" "=E0=AE=A3" "=E0=AE=A4" >> "=E0=AE=A8" "=E0=AE=AA" "=E0=AE=AE" "=E0=AE= =AF" "=E0=AE=B0" "=E0=AE=B2" >> "=E0=AE=B5" "=E0=AE=B4" "=E0=AE=B3" "=E0=AE= =B1" "=E0=AE=A9"))) >> (mapcar (lambda (c) (string-to-char c)) core-consonants)) >>=20 >> ;; =3D> (2965 2969 2970 2974 2975 2979 2980 2984 2986 2990 2991 29= 92 >> 2994 2997 2996 2995 2993 2985) >>=20 >> and sure enough when you do (sort core-consonants #'string-lessp) the >> list is jumbled up instead of retaining the order. >> [ core-consonants, as declared, is in the right order but sort jumbles >> it up. ] >>=20 >> But string-lessp works for vowels. It is the consonants that is the >> problem. > > Sorry, I don't understand what you are saying here. How is the above > code related to the issue at hand, which is how to sort characters in > the order you want them to be sorted? (And please keep in mind that I > don't even know which of those characters are consonants and which are > vowels -- if you want me to say something intelligent about that.) I'm trying to explain the behaviour of string-lessp which seems to sort the characters by their Unicode codepoints. But the order these characters appear in Unicode and their actual order is not the same so string-lessp does not do the job we want it to. [=E0=AE=9A=E0=AE=A9=E0=AE=BF =E0=AE=9C=E0=AF=82=E0=AE=B2=E0=AF=88 02, 2022]= Eli Zaretskii wrote: > > Or maybe my guess below will be lucky. You probably want this: > > (defun sort-by-codepoint (c1 c2) > (< (string-to-char c1) (string-to-char c2))) > > (let ((core-consonants '("=E0=AE=95" "=E0=AE=99" "=E0=AE=9A" "=E0=AE=9E= " "=E0=AE=9F" "=E0=AE=A3" "=E0=AE=A4" > "=E0=AE=A8" "=E0=AE=AA" "=E0=AE=AE" "=E0=AE=AF" "=E0=AE=B0" "=E0=AE= =B2" > "=E0=AE=B5" "=E0=AE=B4" "=E0=AE=B3" "=E0=AE=B1" "=E0=AE=A9"))) > > (sort core-consonants 'sort-by-codepoint)) > =3D> ("=E0=AE=95" "=E0=AE=99" "=E0=AE=9A" "=E0=AE=9E" "=E0=AE=9F" "=E0= =AE=A3" "=E0=AE=A4" "=E0=AE=A8" "=E0=AE=A9" "=E0=AE=AA" "=E0=AE=AE" "=E0=AE= =AF" "=E0=AE=B0" "=E0=AE=B1" "=E0=AE=B2" "=E0=AE=B3" "=E0=AE=B4" "=E0=AE=B5= ") > > (To understand why, read the doc string of 'sort' carefully, where it > explains what is expected from PREDICATE.) Unfortunately not, since it jumbles up the list. The desired outcome is the same list.