Subject: [PATCH] Add support for the Modi script

From: समीर सिंह Sameer Singh<[email-masked]>
Date: Mon, 16 May 2022 05:03:59 +0530

I have added the modi script to Emacs this time.

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. If this change is not
warranted you can
revert it.

Please review the patch.
From 390e29f3f87d0c69b4e04c36db6b057f55cd86f1 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: Mon, 16 May 2022 04:56:19 +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.
* 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.
* etc/NEWS: Announce the new language environment and its
input method.
---
 etc/HELLO                     |   5 +-
 etc/NEWS                      |   5 ++
 lisp/international/fontset.el |   3 +-
 lisp/language/indian.el       |  32 +++++++++++
 lisp/leim/quail/indian.el     | 101 ++++++++++++++++++++++++++++++++++
 5 files changed, 144 insertions(+), 2 deletions(-)

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 (हिंदी)	नमस्ते / नमस्कार ।
 Inuktitut (ᐃᓄᒃᑎᑐᑦ)	ᐊᐃ
 Italian (italiano)	Ciao / Buon giorno
 Javanese (ꦧꦱꦗꦮꦶ)	console.log("ꦲꦭꦺꦴ");
@@ -69,6 +70,7 @@ Malayalam (മലയാളം)	നമസ്കാരം
 Maldivian (ދިވެހި)	އައްސަލާމު ޢަލައިކުމް / ކިހިނެހް؟
 Maltese (il-Malti)	Bonġu / Saħħa
 Mathematics	∀ p ∈ world • hello p  □
+Modi (𑘦𑘻𑘚𑘲)	𑘡𑘦𑘭𑘿𑘎𑘰𑘨
 Mongolian (монгол хэл)	Сайн байна уу?
 Northern Thai (ᨣᩣᩴᨾᩮᩬᩥᨦ / ᨽᩣᩈᩣᩃ᩶ᩣ᩠ᨶᨶᩣ)	ᩈ᩠ᩅᩢᩔ᩠ᨯᩦᨣᩕᩢ᩠ᨸ
 Norwegian (norsk)	Hei / God dag
diff --git a/etc/NEWS b/etc/NEWS
index a3ec2100e9..67f711033a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -801,6 +801,11 @@ 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..ae1ea14279 100644
--- a/lisp/language/indian.el
+++ b/lisp/language/indian.el
@@ -191,6 +191,16 @@ 'devanagari
 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 +628,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"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