Subject: Re: bug#55439: [PATCH] Add support for the Modi script

From: समीर सिंह Sameer Singh<[email-masked]>
Date: Tue, 17 May 2022 04:55:42 +0530

>
> Can you tell how many more old scripts you intend to add?  I'm
> thinking perhaps we should make a separate section for them in NEWS,
> instead of basically repeating the same text over and over and over
> again

I am planning to add about 31 more scripts.

I'm okay with the change, but please add the same sample-text to the
> Devanagari language environment in indian.el.
>

Done.

I have also:
    1. added sample texts to other scripts which didn't have them.
    2. replaced the spaces with a tab in the sample texts which I had added.
    3. renamed Punjabi to Gurmukhi in its set-language-info-alist.

In etc/HELLO
I have:
    1. added a Gurumukhi greeting.
    2. replaced the Odia greeting, it was ଶୁଣିବେ (tl. Listen) earlier,
which I don't think is a greeting, therefore I have replaced it with
ନମସ୍କାର (namaskaar)

The "Hindi" greeting had a character at its end, U+0964, which
> disappeared when you moved the line to Devanagari.  Is that
> intentional?
>

Yes, that was intentional, it was a full stop. I didn't think that it was
necessary, the other greetings also did not have it.

Period missing at the end of this line.

Oops. Fixed it.  The earlier news entry about Syloti Nagri did not have it
too, so I have also added it there.

On Mon, May 16, 2022 at 5:04 PM Eli Zaretskii <[email-masked]> wrote:

> > From: समीर सिंह Sameer Singh
> >  <[email-masked]>
> > Date: Mon, 16 May 2022 05:03:59 +0530
> >
> > I have added the modi script to Emacs this time.
>
> Thanks.
>
> Can you tell how many more old scripts you intend to add?  I'm
> thinking perhaps we should make a separate section for them in NEWS,
> instead of basically repeating the same text over and over and over
> again.
>
> > I have also renamed Hindi to Devanagari in etc/HELLO, since this
> > script is also used by languages other than Hindi, like: Marathi and
> > Nepali.
>
> I'm okay with the change, but please add the same sample-text to the
> Devanagari language environment in indian.el.
>
> > Please review the patch.
> > diff --git a/etc/HELLO b/etc/HELLO
> > index 16a38b59d3..04014e8dea 100644
> > --- a/etc/HELLO
> > +++ b/etc/HELLO
> > @@ -38,6 +38,7 @@ Comanche /kəˈmæntʃiː/       Haa marʉ́awe
> >  Cree (ᓀᐦᐃᔭᐍᐏᐣ)       ᑕᓂᓯ / ᐙᒋᔮ
> >  Czech (čeština)      Dobrý den
> >  Danish (dansk)       Hej / Goddag / Halløj
> > +Devanagari (देवनागरी)        नमस्ते / नमस्कार
> >  Dutch (Nederlands)   Hallo / Dag
> >  Efik  /ˈɛfɪk/        Mɔkɔm
> >  Egyptian Hieroglyphs (𓂋𓏤𓈖𓆎𓅓‌𓏏𓊖)       𓅓𓊵𓏏𓊪, 𓇍𓇋𓂻𓍘𓇋
> > @@ -55,7 +57,6 @@ Greek, ancient (ἑλληνική)   Οὖλέ τε καὶ μέγα χαῖρε
> >  Gujarati (ગુજરાતી)   નમસ્તે
> >  Hebrew (עִבְרִית)    שָׁלוֹם
> >  Hungarian (magyar)   Szép jó napot!
> > -Hindi (हिंदी)        नमस्ते / नमस्कार ।
>
> The "Hindi" greeting had a character at its end, U+0964, which
> disappeared when you moved the line to Devanagari.  Is that
> intentional?
>
> > +*** New language environment "Modi"
>
> Period missing at the end of this line.
>
From e8c15a522c51f4c58804bcce8cc4783cd79fa8cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E0=A4=B8=E0=A4=AE=E0=A5=80=E0=A4=B0=20=E0=A4=B8=E0=A4=BF?=
 =?UTF-8?q?=E0=A4=82=E0=A4=B9=20Sameer=20Singh?= <[email-masked]>
Date: Tue, 17 May 2022 04:33:57 +0530
Subject: [PATCH] Add support for the Modi script

* lisp/language/indian.el ("Modi"): New language environment.
Add composition rules for Modi.  Add sample text and input
method.
Add sample text to various scripts.
Rename Punjabi to Gurmukhi.
* lisp/international/fontset.el (script-representative-chars)
(setup-default-fontset): Support Modi.
* lisp/leim/quail/indian.el ("modi"): New input method.

* etc/HELLO: Add a Modi greeting.
Rename Hindi to Devanagari.
Add a Gurmukhi greeting.
Replace Odia greeting.
* etc/NEWS: Announce the new language environment and its
input method.
---
 etc/HELLO                     |   7 ++-
 etc/NEWS                      |   7 ++-
 lisp/international/fontset.el |   3 +-
 lisp/language/indian.el       |  54 +++++++++++++++---
 lisp/leim/quail/indian.el     | 101 ++++++++++++++++++++++++++++++++++
 5 files changed, 161 insertions(+), 11 deletions(-)

diff --git a/etc/HELLO b/etc/HELLO
index 16a38b59d3..49168ba9ba 100644
--- a/etc/HELLO
+++ b/etc/HELLO
@@ -38,6 +38,7 @@ Comanche /kəˈmæntʃiː/	Haa marʉ́awe
 Cree (ᓀᐦᐃᔭᐍᐏᐣ)	ᑕᓂᓯ / ᐙᒋᔮ
 Czech (čeština)	Dobrý den
 Danish (dansk)	Hej / Goddag / Halløj
+Devanagari (देवनागरी)	नमस्ते / नमस्कार
 Dutch (Nederlands)	Hallo / Dag
 Efik  /ˈɛfɪk/	Mɔkɔm
 Egyptian Hieroglyphs (𓂋𓏤𓈖𓆎𓅓‌𓏏𓊖)	𓅓𓊵𓏏𓊪, 𓇍𓇋𓂻𓍘𓇋
@@ -53,9 +54,9 @@ German (Deutsch)	Guten Tag / Grüß Gott
 Greek (ελληνικά)	Γειά σας
 Greek, ancient (ἑλληνική)	Οὖλέ τε καὶ μέγα χαῖρε
 Gujarati (ગુજરાતી)	નમસ્તે
+Gurmukhi (ਗੁਰਮੁਖੀ)	ਸਤ ਸ੍ਰੀ ਅਕਾਲ
 Hebrew (עִבְרִית)	שָׁלוֹם
 Hungarian (magyar)	Szép jó napot!
-Hindi (हिंदी)	नमस्ते / नमस्कार ।
 Inuktitut (ᐃᓄᒃᑎᑐᑦ)	ᐊᐃ
 Italian (italiano)	Ciao / Buon giorno
 Javanese (ꦧꦱꦗꦮꦶ)	console.log("ꦲꦭꦺꦴ");
@@ -69,10 +71,11 @@ Malayalam (മലയാളം)	നമസ്കാരം
 Maldivian (ދިވެހި)	އައްސަލާމު ޢަލައިކުމް / ކިހިނެހް؟
 Maltese (il-Malti)	Bonġu / Saħħa
 Mathematics	∀ p ∈ world • hello p  □
+Modi (𑘦𑘻𑘚𑘲)	𑘡𑘦𑘭𑘿𑘎𑘰𑘨
 Mongolian (монгол хэл)	Сайн байна уу?
 Northern Thai (ᨣᩣᩴᨾᩮᩬᩥᨦ / ᨽᩣᩈᩣᩃ᩶ᩣ᩠ᨶᨶᩣ)	ᩈ᩠ᩅᩢᩔ᩠ᨯᩦᨣᩕᩢ᩠ᨸ
 Norwegian (norsk)	Hei / God dag
-Oriya (ଓଡ଼ିଆ)	ଶୁଣିବେ
+Oriya (ଓଡ଼ିଆ)	ନମସ୍କାର
 Polish  (język polski)	Dzień dobry! / Cześć!
 Russian (русский)	Здра́вствуйте!
 Sharada (𑆯𑆳𑆫𑆢𑆳)	𑆤𑆩𑆱𑇀𑆑𑆳𑆫
diff --git a/etc/NEWS b/etc/NEWS
index 630288d431..6f9c434e81 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -807,11 +807,16 @@ language.  Nowadays it is mostly used by the Buddhist monks in Japan for
 religious writings.  A new input method, 'siddham', is provided to type
 text in this script.
 
-*** New language environment "Syloti Nagri"
+*** New language environment "Syloti Nagri".
 This language environment supports the Syloti Nagri script for the Sylheti
 language, which is spoke in parts of Bangladesh, Assam and Tripura.  A new
 input method, 'syloti-nagri', is provided to type text in this script.
 
+*** New language environment "Modi".
+This language environment supports the Modi script which was used to write
+the Marathi language in the past.  A new input method, 'modi', is provided
+to type text in this script.
+
 ---
 *** New Greek translation of the Emacs tutorial.
 Type 'C-u C-h t' to select it in case your language setup does not do
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index 0abbf2309c..40499f42d0 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -244,7 +244,7 @@ font-encoding-charset-alist
 	(newa #x11400)
 	(tirhuta #x11481 #x1148F #x114D0)
 	(siddham #x1158E #x115AF #x115D4)
-	(modi #x11600)
+	(modi #x1160E #x11630 #x11655)
 	(takri #x11680)
 	(dogra #x11800)
 	(warang-citi #x118A1)
@@ -782,6 +782,7 @@ setup-default-fontset
                     sharada
                     tirhuta
                     siddham
+                    modi
 		    makasar
                     dives-akuru
 		    cuneiform
diff --git a/lisp/language/indian.el b/lisp/language/indian.el
index 559239b491..257ecc1617 100644
--- a/lisp/language/indian.el
+++ b/lisp/language/indian.el
@@ -45,8 +45,9 @@ 'devanagari
 		(coding-system utf-8)
 		(coding-priority utf-8)
 		(input-method . "devanagari-aiba")
+                (sample-text . "Devanagari (देवनागरी)	नमस्ते / नमस्कार")
 		(documentation . "\
-Such languages using Devanagari script as Hindi and Marathi
+Such languages using Devanagari script as Hindi, Marathi and Nepali
 are supported in this language environment."))
  '("Indian"))
 
@@ -55,16 +56,18 @@ 'devanagari
 	     (coding-system utf-8)
 	     (coding-priority utf-8)
 	     (input-method . "bengali-itrans")
+             (sample-text . "Bengali (বাংলা)	নমস্কার")
 	     (documentation . "\
 Such languages using Bengali script as Bengali and Assamese
 are supported in this language environment."))
  '("Indian"))
 
 (set-language-info-alist
- "Punjabi" '((charset unicode)
+ "Gurmukhi" '((charset unicode)
 	      (coding-system utf-8)
 	      (coding-priority utf-8)
 	      (input-method . "punjabi-itrans")
+              (sample-text . "Gurmukhi (ਗੁਰਮੁਖੀ)	ਸਤ ਸ੍ਰੀ ਅਕਾਲ")
 	      (documentation . "\
 North Indian language Punjabi is supported in this language environment."))
  '("Indian"))
@@ -74,6 +77,7 @@ 'devanagari
 	      (coding-system utf-8)
 	      (coding-priority utf-8)
 	      (input-method . "gujarati-itrans")
+              (sample-text . "Gujarati (ગુજરાતી)	નમસ્તે")
 	      (documentation . "\
 North Indian language Gujarati is supported in this language environment."))
  '("Indian"))
@@ -83,6 +87,7 @@ 'devanagari
 	      (coding-system utf-8)
 	      (coding-priority utf-8)
 	      (input-method . "oriya-itrans")
+              (sample-text . "Oriya (ଓଡ଼ିଆ)	ନମସ୍କାର")
 	      (documentation . "\
 Such languages using Oriya script as Oriya, Khonti, and Santali
 are supported in this language environment."))
@@ -93,6 +98,7 @@ 'devanagari
 	   (coding-system utf-8)
 	   (coding-priority utf-8)
 	   (input-method . "tamil-itrans")
+           (sample-text . "Tamil (தமிழ்)	வணக்கம்")
 	   (documentation . "\
 South Indian Language Tamil is supported in this language environment."))
  '("Indian"))
@@ -102,6 +108,7 @@ 'devanagari
 	    (coding-system utf-8)
 	    (coding-priority utf-8)
 	    (input-method . "telugu-itrans")
+            (sample-text . "Telugu (తెలుగు)	నమస్కారం")
 	    (documentation . "\
 South Indian Language Telugu is supported in this language environment."))
  '("Indian"))
@@ -122,6 +129,7 @@ 'devanagari
 	       (coding-system utf-8)
 	       (coding-priority utf-8)
 	       (input-method . "malayalam-itrans")
+               (sample-text . "Malayalam (മലയാളം)	നമസ്കാരം")
 	       (documentation . "\
 South Indian language Malayalam is supported in this language environment."))
  '("Indian"))
@@ -141,7 +149,7 @@ 'devanagari
             (coding-system utf-8)
             (coding-priority utf-8)
             (input-method . "kaithi")
-            (sample-text . "Kaithi (𑂍𑂶𑂟𑂲)        𑂩𑂰𑂧𑂩𑂰𑂧")
+            (sample-text . "Kaithi (𑂍𑂶𑂟𑂲)	𑂩𑂰𑂧𑂩𑂰𑂧")
             (documentation . "\
 Languages such as Awadhi, Bhojpuri, Magahi and Maithili
 which used the Kaithi script are supported in this language environment."))
@@ -152,7 +160,7 @@ 'devanagari
              (coding-system utf-8)
              (coding-priority utf-8)
              (input-method . "tirhuta")
-             (sample-text . "Tirhuta (𑒞𑒱𑒩𑒯𑒳𑒞𑒰)        𑒣𑓂𑒩𑒢𑒰𑒧")
+             (sample-text . "Tirhuta (𑒞𑒱𑒩𑒯𑒳𑒞𑒰)	𑒣𑓂𑒩𑒢𑒰𑒧 / 𑒮𑒲𑒞𑒰𑒩𑒰𑒧")
              (documentation . "\
 Maithili language and its script Tirhuta is supported in this
 language environment."))
@@ -163,7 +171,7 @@ 'devanagari
              (coding-system utf-8)
              (coding-priority utf-8)
              (input-method . "sharada")
-             (sample-text . "Sharada (𑆯𑆳𑆫𑆢𑆳)        𑆤𑆩𑆱𑇀𑆑𑆳𑆫")
+             (sample-text . "Sharada (𑆯𑆳𑆫𑆢𑆳)	𑆤𑆩𑆱𑇀𑆑𑆳𑆫")
              (documentation . "\
 Kashmiri language and its script Sharada is supported in this
 language environment."))
@@ -174,7 +182,7 @@ 'devanagari
              (coding-system utf-8)
              (coding-priority utf-8)
              (input-method . "siddham")
-             (sample-text . "Siddham (𑖭𑖰𑖟𑖿𑖠𑖽)        𑖡𑖦𑖭𑖿𑖝𑖸")
+             (sample-text . "Siddham (𑖭𑖰𑖟𑖿𑖠𑖽)	𑖡𑖦𑖭𑖿𑖝𑖸")
              (documentation . "\
 Sanskrit language and one of its script Siddham is supported
 in this language environment."))
@@ -185,12 +193,22 @@ 'devanagari
                   (coding-system utf-8)
                   (coding-priority utf-8)
                   (input-method . "syloti-nagri")
-                  (sample-text . "Syloti Nagri (ꠍꠤꠟꠐꠤ ꠘꠣꠉꠞꠤ)        ꠀꠌ꠆ꠍꠣꠟꠣꠝꠥ ꠀꠟꠣꠁꠇꠥꠝ")
+                  (sample-text . "Syloti Nagri (ꠍꠤꠟꠐꠤ ꠘꠣꠉꠞꠤ)	ꠀꠌ꠆ꠍꠣꠟꠣꠝꠥ ꠀꠟꠣꠁꠇꠥꠝ / ꠘꠝꠡ꠆ꠇꠣꠞ")
                   (documentation . "\
 Sylheti language and its script Syloti Nagri is supported
 in this language environment."))
  '("Indian"))
 
+(set-language-info-alist
+ "Modi" '((charset unicode)
+          (coding-system utf-8)
+          (coding-priority utf-8)
+          (input-method . "modi")
+          (sample-text . "Modi (𑘦𑘻𑘚𑘲)	𑘡𑘦𑘭𑘿𑘎𑘰𑘨")
+          (documentation . "\
+Marathi language and one of its script Modi is supported
+in this language environment."))
+ '("Indian"))
 
 ;; Replace mnemonic characters in REGEXP according to TABLE.  TABLE is
 ;; an alist of (MNEMONIC-STRING . REPLACEMENT-STRING).
@@ -618,5 +636,27 @@ malayalam-composable-pattern
                                        vowel "?" nasal "?")
                                1 'font-shape-gstring))))
 
+;; Modi composition rules
+(let ((consonant            "[\x1160E-\x1162F]")
+      (independent-vowel    "[\x11600-\x1160D]")
+      (vowel                "[\x11630-\x1163C]")
+      (nasal                "\x1163D")
+      (visarga              "\x1163E")
+      (virama               "\x1163F")
+      (ardhacandra          "\x11640"))
+  (set-char-table-range composition-function-table
+                        '(#x11630 . #x11640)
+                        (list (vector
+                               ;; Consonant based syllables
+                               (concat consonant "\\(?:" virama consonant "\\)*\\(?:"
+                                       virama "\\|" vowel "*" ardhacandra "?" nasal
+                                       "?" visarga "?\\)")
+                               1 'font-shape-gstring)
+                              (vector
+                               ;; Vowels based syllables
+                               (concat independent-vowel virama "?" vowel "?" ardhacandra
+                                       nasal "?" visarga "?")
+                               1 'font-shape-gstring))))
+
 (provide 'indian)
 ;;; indian.el ends here
diff --git a/lisp/leim/quail/indian.el b/lisp/leim/quail/indian.el
index eb9d1183e5..95798a4477 100644
--- a/lisp/leim/quail/indian.el
+++ b/lisp/leim/quail/indian.el
@@ -1348,4 +1348,105 @@ "||"
 ("M"  ?ꠋ)
 )
 
+(quail-define-package
+ "modi" "Modi" "𑘦𑘻" t "Modi phonetic input method.
+
+ `\\=`' is used to switch levels instead of Alt-Gr.
+" nil t t t t nil nil nil nil nil t)
+
+(quail-define-rules
+("``" ?₹)
+("1"  ?𑙑)
+("`1" ?1)
+("2"  ?𑙒)
+("`2" ?2)
+("3"  ?𑙓)
+("`3" ?3)
+("4"  ?𑙔)
+("`4" ?4)
+("5"  ?𑙕)
+("`5" ?5)
+("6"  ?𑙖)
+("`6" ?6)
+("7"  ?𑙗)
+("`7" ?7)
+("8"  ?𑙘)
+("`8" ?8)
+("9"  ?𑙙)
+("`9" ?9)
+("0"  ?𑙐)
+("`0" ?0)
+("`)" ?𑙃)
+("`\\" ?𑙁)
+("`|" ?𑙂)
+("`"  ?𑘘)
+("q"  ?𑘘)
+("Q"  ?𑘙)
+("`q" ?𑙄)
+("w"  ?𑘚)
+("W"  ?𑘛)
+("e"  ?𑘹)
+("E"  ?𑘺)
+("`e" ?𑘊)
+("`E" ?𑘋)
+("r"  ?𑘨)
+("R"  ?𑘵)
+("`r" ?𑘆)
+("t"  ?𑘝)
+("T"  ?𑘞)
+("y"  ?𑘧)
+("u"  ?𑘳)
+("U"  ?𑘴)
+("`u" ?𑘄)
+("`U" ?𑘅)
+("i"  ?𑘱)
+("I"  ?𑘲)
+("`i" ?𑘂)
+("`I" ?𑘃)
+("o"  ?𑘻)
+("O"  ?𑘼)
+("`o" ?𑘌)
+("`O" ?𑘍)
+("p"  ?𑘢)
+("P"  ?𑘣)
+("a"  ?𑘰)
+("A"  ?𑘁)
+("`a" ?𑘀)
+("s"  ?𑘭)
+("S"  ?𑘫)
+("d"  ?𑘟)
+("D"  ?𑘠)
+("f"  ?𑘿)
+("F"  ?𑘶)
+("`f" ?𑘇)
+("g"  ?𑘐)
+("G"  ?𑘑)
+("h"  ?𑘮)
+("H"  ?𑘾)
+("j"  ?𑘕)
+("J"  ?𑘖)
+("k"  ?𑘎)
+("K"  ?𑘏)
+("l"  ?𑘩)
+("L"  ?𑘯)
+("`l" ?𑘷)
+("`L" ?𑘈)
+("z"  ?𑘗)
+("Z"  ?𑘒)
+("`z" ?𑘸)
+("`Z" ?𑘉)
+("x"  ?𑘬)
+("X"  ?𑙀)
+("c"  ?𑘓)
+("C"  ?𑘔)
+("`c" #x200C)  ; ZWNJ
+("v"  ?𑘪)
+("b"  ?𑘤)
+("B"  ?𑘥)
+("n"  ?𑘡)
+("N"  ?𑘜)
+("m"  ?𑘦)
+("M"  ?𑘽)
+)
+
 ;;; indian.el ends here
-- 
2.36.1