all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Visuwesh <visuweshm@gmail.com>
Cc: 56323@debbugs.gnu.org
Subject: bug#56323: 29.0.50; [v2] Add new customisable phonetic Tamil input method
Date: Sun, 10 Jul 2022 08:34:12 +0300	[thread overview]
Message-ID: <83r12t1qgb.fsf@gnu.org> (raw)
In-Reply-To: <87tu7phb7s.fsf@gmail.com> (message from Visuwesh on Sun, 10 Jul 2022 09:26:39 +0530)

> From: Visuwesh <visuweshm@gmail.com>
> 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?





  reply	other threads:[~2022-07-10  5:34 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 12:13 bug#56323: 29.0.50; Add new customisable phonetic Tamil input method Visuwesh
2022-06-30 14:08 ` Visuwesh
2022-06-30 15:53 ` Visuwesh
2022-07-01 12:59 ` bug#56323: 29.0.50; [v2] " Visuwesh
2022-07-01 13:01   ` Visuwesh
2022-07-01 13:22   ` Eli Zaretskii
2022-07-01 13:47     ` Visuwesh
2022-07-01 14:06       ` Eli Zaretskii
2022-07-01 14:30         ` Visuwesh
2022-07-01 16:09           ` Eli Zaretskii
2022-07-01 16:37             ` Visuwesh
2022-07-01 18:16               ` Eli Zaretskii
2022-07-02  4:02                 ` Visuwesh
2022-07-02  6:35                   ` Eli Zaretskii
2022-07-02  6:54                     ` Visuwesh
2022-07-02  7:17                       ` Eli Zaretskii
2022-07-02  7:35                         ` Eli Zaretskii
2022-07-02  7:46                           ` Eli Zaretskii
2022-07-02  8:11                         ` Visuwesh
2022-07-02  8:29                           ` Eli Zaretskii
2022-07-02  8:40                             ` Visuwesh
2022-07-02  8:54                               ` Eli Zaretskii
2022-07-02  9:33                                 ` Visuwesh
2022-07-02  9:38                                   ` Eli Zaretskii
2022-07-02 10:31                                     ` Visuwesh
2022-07-02 10:46                                       ` Eli Zaretskii
2022-07-02 12:08                                         ` Visuwesh
2022-07-02 11:05                                       ` समीर सिंह Sameer Singh
2022-07-02 12:04                                         ` Visuwesh
2022-07-02 12:23                                         ` Eli Zaretskii
2022-07-02  6:58               ` Eli Zaretskii
2022-07-02  7:58                 ` Visuwesh
2022-07-02  8:39                   ` Eli Zaretskii
2022-07-02  9:28                     ` Visuwesh
2022-07-10  3:56                       ` Visuwesh
2022-07-10  5:34                         ` Eli Zaretskii [this message]
2022-07-10  6:42                           ` Visuwesh
2022-07-10  7:32                             ` Visuwesh
2022-07-14  6:34                               ` Eli Zaretskii
2022-07-14  7:11                                 ` Visuwesh
2022-07-02 12:15             ` Visuwesh
2022-07-03  3:57               ` Visuwesh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83r12t1qgb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=56323@debbugs.gnu.org \
    --cc=visuweshm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.