Subject: Re: bug#56323: 29.0.50; [v2] Add new customisable phonetic Tamil input method

From: Eli Zaretskii <[email-masked]>
Date: Sat, 02 Jul 2022 11:39:47 +0300

> From: Visuwesh <[email-masked]>
> Cc: [email-masked]
> Date: Sat, 02 Jul 2022 13:28:29 +0530
> 
> >> Also, I would like to know if there's a better to write the :set
> >> function for the defcustoms tamil-vowel-translation,
> >> tamil-consonant-translation, tamil-misc-translation, tamil-native-digits
> >> without the boundp check chain below,
> >> 
> >>     (defun tamil--set-variable (sym val)
> >>       (set-default sym val)
> >>       (when (and (boundp 'tamil-vowel-translation)
> >>                  (boundp 'tamil-consonant-translation)
> >>                  (boundp 'tamil-misc-translation)
> >>                  (boundp 'tamil-native-digits))
> >>         (tamil--update-quail-rules)))
> >
> > Why do you need a single function for all of them?  Would a separate
> > setter function for each defcustom do the job?
> >
> 
> Because it is harder to clear the old translation rules and add the new
> translation rules than clearing ALL translation rules and starting over
> again.  When the user changes tamil-vowel-translation, then not only
> does the translation rule for the vowels change, we also need to change
> the translation rules for consonant+vowel pairs so that means we need to
> check if the consonant var is bound.  (The translation rules for
> consonant+vowel pairs are auto-generated based on the rules for vowels
> and consonants.)

If the rules are generated based on both defcustom's, then shouldn't
we have just one defcustom for both?  IOW, what is the purpose of
having two separate defcustom's here?

> > I also don't understand the need for the boundp tests -- the function
> > will live on the same indian.el file as the defcustoms, so if the
> > function is defined, the defcustoms are also bound, no?
> >
> 
> IIUC, when we load indian.el, first, the vowel defcustom will be bound,
> then the consonant defcustom and so on.  So this boundp test is needed,
> I think?

Wouldn't that be fixed by having the setter function defined before
the defcustom's?

> See above for why the defcustoms have a "dependency" on each
> other.  When the vowel defcustom is loaded, then its job _sometimes_
> depends on the consonant defcustom being bound as well.

Since the defcustom's have their default value, I don't think I see
the problem.  Did you actually see any problems, and if so, in which
scenario, and what were the error messages?

> I thought the subject could be "Translation rules for the Tamil input
> method."  If you think the group name is too general, then "tamil-im"
> could work?

tamil-input, perhaps?