Subject: bug#55370: [PATCH] Add support for the Syloti Nagri script

From: Eli Zaretskii <[email-masked]>
Date: Thu, 12 May 2022 10:10:19 +0300

> From: समीर सिंह Sameer Singh
>  <[email-masked]>
> Date: Wed, 11 May 2022 20:31:28 +0530
> 
> This time I have added support for the Syloti Nagri script.
> I also had to separate the consonant conjunct syllables and the non consonant conjunct syllables
> composition rules this time around, because if they were together, Emacs would hang whenever I put a
> cursor on a Syloti Nagri word or tried to edit it.

Thanks.

There's something strange in the composition rules:

> +;; Syloti Nagri composition rules
> +(let ((consonant            "[\xA807-\xA80A\xA80C-\xA822]")
> +      (independent-vowel    "[\xA800\xA801\xA803-\xA805]")
> +      (vowel                "[\xA802\xA823-\xA827]")
> +      (nasal                "[\xA80B]")
> +      (virama               "[\xA806\xA82C]"))
> +  (set-char-table-range composition-function-table
> +                        '(#xA806 . #xA806)
> +                        (list (vector
> +                               ;; Consonant conjunct based syllables
> +                               (concat consonant "\\(?:" virama consonant "\\)+"
> +                                       vowel "?" nasal "?")
> +                               1 'font-shape-gstring)
> +                              (vector
> +                               ;; Nasal vowels
> +                               (concat independent-vowel nasal "?")
> +                               1 'font-shape-gstring)))

This set of ruled is triggered by U+A806, and should match a regexp
starting from one character before U+A806.  However, the second rule,
i.e.

> +                               ;; Nasal vowels
> +                               (concat independent-vowel nasal "?")
> +                               1 'font-shape-gstring)))

has 'nasal' ("[\xA80B]") as its second character, and 'nasal' will
never match U+A806.  So this rule will never match, right?

> +  (set-char-table-range composition-function-table
> +                        '(#xA823 . #xA827)
> +                        (list (vector
> +                               ;; Non Consonant conjunct based syllables
> +                               (concat consonant vowel "?" nasal "?")
> +                               1 'font-shape-gstring))))

Similarly here: this rule will never match if 'vowel' isn't present,
because the second character of the matching sequence _must_ be a
vowel, since that is what triggers the composition rule in the first
place.  Am I missing something?

I see similar issues with the composition rules we installed for other
old Indian scripts; could you please review them with the above
comments in mind and see which ones need to be amended?