GNU bug report logs - #56323
29.0.50; Add new customisable phonetic Tamil input method

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Thu, 30 Jun 2022 12:14:02 UTC

Severity: wishlist

Tags: patch

Found in version 29.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: visuweshm <at> gmail.com
Cc: 56323 <at> debbugs.gnu.org
Subject: bug#56323: 29.0.50; [v2] Add new customisable phonetic Tamil input method
Date: Sat, 02 Jul 2022 10:35:18 +0300
> Cc: 56323 <at> debbugs.gnu.org
> Date: Sat, 02 Jul 2022 10:17:56 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> >     (let ((core-consonants '("க" "ங" "ச" "ஞ" "ட" "ண" "த"
> >                              "ந" "ப" "ம" "ய" "ர" "ல"
> >                              "வ" "ழ" "ள" "ற" "ன")))
> >       (mapcar (lambda (c) (string-to-char c)) core-consonants))
> > 
> >       ;; => (2965 2969 2970 2974 2975 2979 2980 2984 2986 2990 2991 2992
> >              2994 2997 2996 2995 2993 2985)
> > 
> > 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.  ]
> > 
> > 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.)

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 '("க" "ங" "ச" "ஞ" "ட" "ண" "த"
			   "ந" "ப" "ம" "ய" "ர" "ல"
			   "வ" "ழ" "ள" "ற" "ன")))

 (sort core-consonants 'sort-by-codepoint))
  => ("க" "ங" "ச" "ஞ" "ட" "ண" "த" "ந" "ன" "ப" "ம" "ய" "ர" "ற" "ல" "ள" "ழ" "வ")

(To understand why, read the doc string of 'sort' carefully, where it
explains what is expected from PREDICATE.)




This bug report was last modified 2 years and 312 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.