Toggle diff (222 lines)
diff --git a/etc/NEWS b/etc/NEWS
index 3d1af8bd6f..bcdc991ea3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1279,6 +1279,9 @@ The default input method for the Tamil language environment is now
change the input method's translation rules, customize the user option
'tamil-translation-rules'.
+---
+*** New tamil99 input method for the Tamil language
+
* Changes in Specialized Modes and Packages in Emacs 29.1
diff --git a/lisp/leim/quail/tamil99.el b/lisp/leim/quail/tamil99.el
new file mode 100644
index 0000000000..780ef968ee
--- /dev/null
+++ b/lisp/leim/quail/tamil99.el
@@ -0,0 +1,200 @@
+;;; tamil99.el --- Quail package for the tamil99 input method -*- lexical-binding: t -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+;;
+;; Author: Arun Isaac <arunisaac@systemreboot.net>
+;; Keywords: multilingual, input method, Indian, Tamil
+
+;; This file is part of GNU Emacs.
+;;
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; Tamil99 is a keyboard layout and input method that is specifically
+;; designed for the Tamil language. Vowels and vowel modifiers are
+;; input with your left hand, and consonants are input with your right
+;; hand. See https://en.wikipedia.org/wiki/Tamil_99
+;;
+;; ?????99 ????????????? ?????????????? ?????????? ????????? ????????? ????????
+;; ?????. ???????? ????????????? ??????? ????????????? ???????????????
+;; ??????????????. https://ta.wikipedia.org/wiki/%E0%AE%A4%E0%AE%AE%E0%AE%BF%E0%AE%B4%E0%AF%8D_99
+;; ?????.
+;;
+;; Usage:
+;;
+;; Switch to the tamil99 input method using M-x set-input-method
+;; tamil99 RET and enjoy typing in Tamil!
+;;
+;; ????????:
+;;
+;; tamil99 ????????? ???????? ??? M-x set-input-method tamil99 RET ????????
+;; ???????? ??????? ???????????? ??????!
+
+;;; Code:
+
+(require 'pcase)
+(require 'quail)
+(require 'seq)
+
+(quail-define-package
+ "tamil99" "Tamil" "?????99"
+ t "Tamil99 input method"
+ nil t t t t nil nil nil nil nil t)
+
+(defconst tamil99-vowels
+ '(("q" "?")
+ ("w" "?")
+ ("e" "?")
+ ("r" "?")
+ ("t" "?")
+ ("a" "?")
+ ("s" "?")
+ ("d" "?")
+ ("g" "?")
+ ("z" "?")
+ ("x" "?")
+ ("c" "?"))
+ "Mapping for vowels.")
+
+(defconst tamil99-vowel-modifiers
+ '(("q" "?")
+ ("w" "?")
+ ("e" "?")
+ ("r" "?")
+ ("t" "?")
+ ("a" "")
+ ("s" "?")
+ ("d" "?")
+ ("g" "?")
+ ("z" "?")
+ ("x" "?")
+ ("c" "?")
+ ("f" "?"))
+ "Mapping for vowel modifiers.")
+
+(defconst tamil99-vallinam-consonants
+ '(("h" "?")
+ ("[" "?")
+ ("o" "?")
+ ("l" "?")
+ ("j" "?")
+ ("u" "?"))
+ "Mapping for vallinam consonants.")
+
+(defconst tamil99-mellinam-consonants
+ '(("b" "?")
+ ("]" "?")
+ ("p" "?")
+ (";" "?")
+ ("k" "?")
+ ("i" "?"))
+ "Mapping for mellinam consonants.")
+
+(defconst tamil99-idaiinam-consonants
+ '(("'" "?")
+ ("m" "?")
+ ("n" "?")
+ ("v" "?")
+ ("/" "?")
+ ("y" "?"))
+ "Mapping for idaiinam consonants.")
+
+(defconst tamil99-grantham-consonants
+ '(("Q" "?")
+ ("W" "?")
+ ("E" "?")
+ ("R" "?"))
+ "Mapping for grantham consonants.")
+
+(defconst tamil99-consonants
+ (append tamil99-vallinam-consonants
+ tamil99-mellinam-consonants
+ tamil99-idaiinam-consonants
+ tamil99-grantham-consonants)
+ "Mapping for all consonants.")
+
+(defconst tamil99-other
+ `(("T" ,(vector "???"))
+ ("Y" ,(vector "????"))
+ ("O" "[")
+ ("P" "]")
+ ("A" "?")
+ ("S" "?")
+ ("D" "?")
+ ("F" "?")
+ ("K" "\"")
+ ("L" ":")
+ (":" ";")
+ ("\"" "'")
+ ("Z" "?")
+ ("X" "?")
+ ("C" "?")
+ ("V" "?")
+ ("B" "?")
+ ("M" "/"))
+ "Mapping for miscellaneous characters.")
+
+(defun tamil99-install ()
+ "Install tamil99 input method."
+ (quail-define-rules)
+ ;; ?????
+ ;; vowel
+ (mapc (pcase-lambda (`(,vowel-key ,vowel))
+ (quail-defrule vowel-key vowel))
+ tamil99-vowels)
+ (mapc (pcase-lambda (`(,consonant-key ,consonant))
+ ;; ??? ?????????
+ ;; consonant with agaram (?)
+ (quail-defrule consonant-key consonant)
+ ;; ?????????? ???? ??? ?????????
+ ;; pulli on double consonant
+ (quail-defrule (concat consonant-key consonant-key)
+ (vector (concat consonant "?" consonant)))
+ (mapc (pcase-lambda (`(,vowel-key ,vowel-modifier))
+ ;; ?????????
+ ;; vowel+consonant
+ (quail-defrule (concat consonant-key vowel-key)
+ (vector (concat consonant vowel-modifier)))
+ ;; ?????????? ???? ?????????
+ ;; vowel+consonant after double consonant
+ (quail-defrule (concat consonant-key consonant-key vowel-key)
+ (vector (concat consonant "?" consonant vowel-modifier))))
+ tamil99-vowel-modifiers))
+ tamil99-consonants)
+ (seq-mapn (pcase-lambda (`(,mellinam-consonant-key ,mellinam-consonant)
+ `(,vallinam-consonant-key ,vallinam-consonant))
+ ;; ????????? ???? ????????
+ ;; vallinam after mellinam
+ (quail-defrule (concat mellinam-consonant-key vallinam-consonant-key)
+ (vector (concat mellinam-consonant "?" vallinam-consonant)))
+ (mapc (pcase-lambda (`(,vowel-key ,vowel-modifier))
+ ;; ??????? ?????????? ???????? ???? ?????????
+ ;; vowel+consonant after mellinam-vallinam consonant
+ (quail-defrule (concat mellinam-consonant-key vallinam-consonant-key vowel-key)
+ (vector (concat mellinam-consonant "?" vallinam-consonant vowel-modifier))))
+ tamil99-vowel-modifiers))
+ tamil99-mellinam-consonants
+ tamil99-vallinam-consonants)
+ ;; ??? ????????????
+ ;; other characters
+ (mapc (pcase-lambda (`(,key ,translation))
+ (quail-defrule key translation))
+ tamil99-other))
+
+(tamil99-install)
+
+(provide 'tamil99)
+
+;;; tamil99.el ends here
--
2.37.2