From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#56323: 29.0.50; [v2] Add new customisable phonetic Tamil input method Date: Sun, 10 Jul 2022 08:34:12 +0300 Message-ID: <83r12t1qgb.fsf@gnu.org> 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> <83mtdsc86u.fsf@gnu.org> <87czeoj68q.fsf@gmail.com> <83edz3di24.fsf@gnu.org> <87zghrj22n.fsf@gmail.com> <87tu7phb7s.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38687"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56323@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 10 07:35:25 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 1oAPbI-0009ui-M6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Jul 2022 07:35:24 +0200 Original-Received: from localhost ([::1]:45380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAPbG-0001W8-WB for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Jul 2022 01:35:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAPaw-0001Vx-Us for bug-gnu-emacs@gnu.org; Sun, 10 Jul 2022 01:35:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oAPaw-0005Dl-M7 for bug-gnu-emacs@gnu.org; Sun, 10 Jul 2022 01:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oAPaw-0005wg-GD for bug-gnu-emacs@gnu.org; Sun, 10 Jul 2022 01:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Jul 2022 05:35: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.165743127822814 (code B ref 56323); Sun, 10 Jul 2022 05:35:02 +0000 Original-Received: (at 56323) by debbugs.gnu.org; 10 Jul 2022 05:34:38 +0000 Original-Received: from localhost ([127.0.0.1]:36170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oAPaX-0005vu-Ke for submit@debbugs.gnu.org; Sun, 10 Jul 2022 01:34:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oAPaV-0005vi-QA for 56323@debbugs.gnu.org; Sun, 10 Jul 2022 01:34:36 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAPaQ-0005AV-EK; Sun, 10 Jul 2022 01:34:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=fXSJXC/jMK0Y3sSxl7uRTq6IjmRcYjkpxYQ8ANLu4hA=; b=ZKdoVAMt50XEESfPi4zA 5K33/U1DXpziFwak7k90X+YB7GgabpWZhHbwGzZhlFQp2zOeEIuTuQaX13MB0P+Y5KhDc+I5fOnPL LbPwUt592992GulN0Ppa83A+pc7FS9kwDCq4APpT0Qi5z0iJF64oIE0ybFXKto4rc2dt6PHoFyKAv kbYbrLBviZ5MI9pjRx85TAhpfDD+yXnukjD88TCBKjH4+jQWveLAj85p2KoJ7dVo+VUgZMPqZoKrL cgW2fA2cLUuU57OVHyXJwTQaHSq3xUUTtepr4KrAr9KvDbcM12GzXfoIDT46sAsadzp/ShkRjcDtk uB/i+MXNVzzihw==; Original-Received: from [87.69.77.57] (port=4938 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAPaO-0003dJ-I1; Sun, 10 Jul 2022 01:34:30 -0400 In-Reply-To: <87tu7phb7s.fsf@gmail.com> (message from Visuwesh on Sun, 10 Jul 2022 09:26:39 +0530) 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:236539 Archived-At: > From: Visuwesh > Cc: 56323@debbugs.gnu.org > Date: Sun, 10 Jul 2022 09:26:39 +0530 > > > I will post an updated patch later when I clean up the comments, and > > docstrings. Thanks. > > Here's an updated patch. Thanks. > +--- > +*** New default phonetic input method for the Tamil language environment. > +The default input method for the Tamil language environment is now > +"tamil" which is a customizable phonetic input method. To change the > +input method's translation rules, customize the user option > +'tamil-translation-rules'. > + > > * Changes in Specialized Modes and Packages in Emacs 29.1 > > diff --git a/lisp/language/indian.el b/lisp/language/indian.el > index 2887d410ad..91ad818533 100644 > --- a/lisp/language/indian.el > +++ b/lisp/language/indian.el > @@ -109,7 +109,7 @@ 'devanagari > "Tamil" '((charset unicode) > (coding-system utf-8) > (coding-priority utf-8) > - (input-method . "tamil-itrans") > + (input-method . "tamil") > (sample-text . "Tamil (தமிழ்) வணக்கம்") > (documentation . "\ Please name the new input method "tamil-phonetic", not just "tamil", so that users who type "C-u C-\ tamil TAB" could have some means of making the decision which one to choose. > +;; This is needed since the Unicode codepoint order does not reflect > +;; the actual order in the Tamil language. > +(defvar quail-tamil-itrans--consonant-order > + '(("க" . 0) ("ங" . 1) ("ச" . 2) ("ஞ" . 3) ("ட" . 4) ("ண" . 5) > + ("த" . 6) ("ந" . 7) ("ப" . 8) ("ம" . 9) ("ய" . 10) ("ர" . 11) > + ("ல" . 12) ("வ" . 13) ("ழ" . 14) ("ள" . 15) ("ற" . 16) ("ன" . 17) > + ("ஜ" . 18) ("ஸ" . 19) ("ஷ" . 20) ("ஹ" . 21) ("க்ஷ" . 22) > + ("க்‌ஷ" . 23) ("ஶ" . 24))) Since the characters are ordered in the correct order, I wonder why we need the explicit ordinal numbers here: they are determined by the index of the character in the list. > +(defun quail-tamil-itrans-compute-syllable-table (vowels consonants) > + "Return the syllable table for the input method as a string. > +VOWELS is a list of (VOWEL SIGN TRANS) where VOWEL is a string or > +character representing the Tamil vowel character, SIGN is the ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ What does it mean "character representing ... character"? Can you clarify this confusing part of the doc string? > +vowel sign corresponding to VOWEL or nil for none, Likewise here: "vowel corresponding to VOWEL"? > and TRANS is > +the input sequence to insert VOWEL. The input sequence is generally a sequence of ASCII characters, is that right? If so, I think telling that would make the documentation more clear. Also, TRANS is a peculiar name for something described as "input sequence", so maybe rename it to INPUT-SEQ? > +CONSONANTS is a list of (CONSONANT TRANS...) where CONSONANT is > +the Tamil consonant character, and TRANS is one or more strings > +that describe how to insert CONSONANT." Same here regarding TRANS and its description. > + (setq vowels (sort vowels (lambda (x y) (string-lessp (car x) (car y)))) > + consonants (sort consonants > + (lambda (x y) > + (< (or (assoc-default (car x) quail-tamil-itrans--consonant-order) 10000) > + (or (assoc-default (car y) quail-tamil-itrans--consonant-order) 10000))))) Can you wrap these long lines, so that they would be easier to read? > + (let ((digits "௦௧௨௩௪௫௬௭௮௯") > (width 6) clm) > (with-temp-buffer > - (insert "\n" (make-string 18 ?-) "+") > - (when digitp (insert (make-string 60 ?-))) > + (insert "\n" (make-string 18 ?-)) > + (when digitp > + (insert "+" (make-string 60 ?-))) > (insert "\n") > (insert > (propertize "\t" 'display '(space :align-to 5)) "various" > - (propertize "\t" 'display '(space :align-to 18)) "|") > + (propertize "\t" 'display '(space :align-to 18))) > (when digitp > (insert > - (propertize "\t" 'display '(space :align-to 45)) "digits")) > - (insert "\n" (make-string 18 ?-) "+") > + "|" (propertize "\t" 'display '(space :align-to 45)) "digits")) > + (insert "\n" (make-string 18 ?-)) Did you test those :align-to specs when display-line-numbers is in use? > +;;; > +;;; Tamil phonetic input method > +;;; > + > +;; Define the input method straightaway. > +(quail-define-package "tamil" "Tamil" "ழ" t > + "Customisable Tamil phonetic input method. See above regarding the name of the input method. > + ;; Consonants. > + ("க்" "k" "g") ("ங்" "ng") ("ச்" "ch" "s") ("ஞ்" "nj") ("ட்" "t" "d") > + ("ண்" "N") ("த்" "th" "dh") ("ந்" "nh") ("ப்" "p" "b") ("ம்" "m") > + ("ய்" "y") ("ர்" "r") ("ல்" "l") ("வ்" "v") ("ழ்" "z" "zh") > + ("ள்" "L") ("ற்" "rh") ("ன்" "n") > + ;; Sanskrit. > + ("ஜ்" "j") ("ஸ்" "S") ("ஷ்" "sh") ("ஹ்" "h") > + ("க்‌ஷ்" "ksh") ("க்ஷ்" "ksH") ("ஶ்" "Z") > + > + ;; Misc. ஃ is neither a consonant nor a vowel. > + ("ஃ" "F" "q") > + ("ௐ" "OM")) > + "List of input sequences to translate to Tamil characters. > +Each element should be (CHARACTER . TRANSLATIONS) where CHARACTER The (CHARACTER . TRANSLATIONS) form seems to imply the elements are cons cells, but the value itself uses lists. Suggest to say instead Each element should be (CHARACTER TRANSLATIONS...) > +is the Tamil character, and TRANSLATIONS is a list of input > +sequences to translate to that character. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "sequences which produce that character" is better. And I suggest to use INPUT-SEQUENCES here, not TRANSLATIONS, for the reason explained above. > +CHARACTER is considered as a consonant (மெய் எழுத்து) if it ends > +with a pulli. What is a "pulli"? It is not a character name AFAICT. > +CHARACTER is that is neither a vowel nor a consonant are ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Typo and/or redundant words here. > +considered as \"miscellaneous\" characters and are inserted as > +is. Not sure what this wants to say: the fact that characters are inserted in some way seems to be unrelated to the description of the value. What is this about? > +The input sequence for consonant+vowel pairs (உயிர்மெய் எழுத்துக்கள்) > +is the input sequence for the consonant followed by the > +corresponding vowel." Isn't that obvious? If not, the non-obvious part(s) should be mentioned explicitly. > + :group 'tamil-input > + :type '(alist :key-type string :value-type (repeat string)) > + :set #'tamil--setter > + :options This defcustom lacks the :version tag. > [ Also, I don't see the customization group until I load > lisp/leim/quail/indian.el? But AFAICT, that's not the case for other > custom groups. ] There are no defcustoms in leim/quail/ files. How about moving the defcustom to lisp/language/indian.el?