unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
blob 780ef968ee13226e37419e1c3967e07866cbca36 6835 bytes (raw)
name: lisp/leim/quail/tamil99.el 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
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

debug log:

solving 780ef968ee ...
found 780ef968ee in https://yhetil.org/emacs-bugs/20220925100244.13482-1-arunisaac@systemreboot.net/

applying [1/1] https://yhetil.org/emacs-bugs/20220925100244.13482-1-arunisaac@systemreboot.net/
diff --git a/lisp/leim/quail/tamil99.el b/lisp/leim/quail/tamil99.el
new file mode 100644
index 0000000000..780ef968ee

Checking patch lisp/leim/quail/tamil99.el...
Applied patch lisp/leim/quail/tamil99.el cleanly.

index at:
100644 780ef968ee13226e37419e1c3967e07866cbca36	lisp/leim/quail/tamil99.el

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).