From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#58070: [PATCH] Add tamil99 input method Date: Sun, 25 Sep 2022 17:08:50 +0530 Message-ID: <87h70vsmyd.fsf@gmail.com> References: <20220925100020.13229-1-arunisaac@systemreboot.net> <20220925100244.13482-1-arunisaac@systemreboot.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30892"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 58070@debbugs.gnu.org To: Arun Isaac Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 25 14:22:13 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ocQeD-0007tc-4F for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Sep 2022 14:22:13 +0200 Original-Received: from localhost ([::1]:59270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocQeC-0002qi-3r for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Sep 2022 08:22:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocPzO-0001lu-QH for bug-gnu-emacs@gnu.org; Sun, 25 Sep 2022 07:40:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46909) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ocPzO-0007Jq-8N for bug-gnu-emacs@gnu.org; Sun, 25 Sep 2022 07:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ocPzN-0002Cc-TN for bug-gnu-emacs@gnu.org; Sun, 25 Sep 2022 07:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Sep 2022 11:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58070 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58070-submit@debbugs.gnu.org id=B58070.16641059508403 (code B ref 58070); Sun, 25 Sep 2022 11:40:01 +0000 Original-Received: (at 58070) by debbugs.gnu.org; 25 Sep 2022 11:39:10 +0000 Original-Received: from localhost ([127.0.0.1]:45987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocPyY-0002BS-2o for submit@debbugs.gnu.org; Sun, 25 Sep 2022 07:39:10 -0400 Original-Received: from mail-pj1-f65.google.com ([209.85.216.65]:44720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocPyT-0002Aw-Rs for 58070@debbugs.gnu.org; Sun, 25 Sep 2022 07:39:08 -0400 Original-Received: by mail-pj1-f65.google.com with SMTP id i15-20020a17090a4b8f00b0020073b4ac27so4309482pjh.3 for <58070@debbugs.gnu.org>; Sun, 25 Sep 2022 04:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date; bh=FeeGEAOVMEDh9g4AF46ciNGdtEzRjE8aATqpIULrzyQ=; b=EWXjcH65nynbAE07NtYWAa1drRnvEHdbHIPLl2wKwe4VSMl703zah14sDUYLIl7SiH jOECNOUX2YYsoe6fwzAKQ5uSn7iIbU2uEZYhzDqilcNrabq9OXMDSWbClThQvY1UJNd3 Jatx/cq/Tit039Zy0QBDtY3O7YkFBckTpWWH10dUrjWqfba71E4KstFGJcRdrq1KmuuW izrkly5zPiu95w5gBJVSUQnsCKDhBselmZJKLMd4fRrf2iwdUBW1k4WKggtcaS0nX3nP 8xmedtjVaMdML777iwwZuxQT9kJXDZJuTY7d7ZCSFM4IRI7RE3Msxnihh0gO6kEfY1iH ScKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=FeeGEAOVMEDh9g4AF46ciNGdtEzRjE8aATqpIULrzyQ=; b=WxdVXoR4Xyx2spgyDVPbmDlYboCz5MB0BW2XaB50PJoQGix42DZEmGmStleI4C+Y0K eRUHwnx0Wbks21s9zR5j0e0XpFWgOAstW0jXggb0lcao+9/g71UMdNdqXDpe7c6YZ+tT cePBC8ERABaQ/jT5LxZ0er2nGUKY/3hxn9jmM7XIcbRVHoNRZG3JMjHfienuBWxm//uo J964LWsfQ8M1KTMowdCvMqBd/v4YNoRx3ZuRUB+N2Tm9wGa0P6Vfm8ZCClw2uYcPCbtW URJZAXNwDJVeSF2NsFKuSZoVw0GmcHWDutvfLi3Z2W+xJD7H9NIB43DHcBcN86r3LWx8 eY2w== X-Gm-Message-State: ACrzQf0zMFfOvb3TAGNKRGY58F4fqkSnW8epD1aZWGEfMWnv2hT5n2tv 4tB+deTWCweW2JUKrpHln1M= X-Google-Smtp-Source: AMsMyM4kmmwgY7MfAUygGu1mtBI8a1EZCejWs6yV0T7Mw9Fm87BOLj6N3l4f4t9dvnEiYh1dUyqhaw== X-Received: by 2002:a17:902:6943:b0:178:4751:a76b with SMTP id k3-20020a170902694300b001784751a76bmr16827369plt.37.1664105939763; Sun, 25 Sep 2022 04:38:59 -0700 (PDT) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id ix21-20020a170902f81500b001788494b764sm9047421plb.231.2022.09.25.04.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Sep 2022 04:38:58 -0700 (PDT) In-Reply-To: <20220925100244.13482-1-arunisaac@systemreboot.net> (Arun Isaac's message of "Sun, 25 Sep 2022 15:32:44 +0530") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:243588 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 W+CunuCuvuCur+Cuv+CuseCvgSDgrprgr4bgrqrgr43grp/grq7gr43grqrgrrDgr40gMjUsIDIw MjJdIEFydW4gSXNhYWMgd3JvdGU6DQoNCj4gKyhkZWZ1biB0YW1pbDk5LWluc3RhbGwgKCkNCj4g KyAgIkluc3RhbGwgdGFtaWw5OSBpbnB1dCBtZXRob2QuIg0KPiArICAocXVhaWwtZGVmaW5lLXJ1 bGVzKQ0KPiArICA7OyDgrongrq/grr/grrDgr40NCj4gKyAgOzsgdm93ZWwNCj4gKyAgKG1hcGMg KHBjYXNlLWxhbWJkYSAoYCgsdm93ZWwta2V5ICx2b3dlbCkpDQo+ICsgICAgICAgICAgKHF1YWls LWRlZnJ1bGUgdm93ZWwta2V5IHZvd2VsKSkNCj4gKyAgICAgICAgdGFtaWw5OS12b3dlbHMpDQo+ ICsgIChtYXBjIChwY2FzZS1sYW1iZGEgKGAoLGNvbnNvbmFudC1rZXkgLGNvbnNvbmFudCkpDQo+ ICsgICAgICAgICAgOzsg4K6F4K6V4K6wIOCuieCur+Cuv+CusOCvjeCuruCvhuCur+CvjQ0KPiAr ICAgICAgICAgIDs7IGNvbnNvbmFudCB3aXRoIGFnYXJhbSAo4K6FKQ0KPiArICAgICAgICAgIChx dWFpbC1kZWZydWxlIGNvbnNvbmFudC1rZXkgY29uc29uYW50KQ0KPiArICAgICAgICAgIDs7IOCu ruCvhuCur+CvjeCur+CviuCuseCvjeCuseCvgSDgrqrgrr/grqngr40g4K6F4K6V4K6wIOCuieCu r+Cuv+CusOCvjeCuruCvhuCur+CvjQ0KPiArICAgICAgICAgIDs7IHB1bGxpIG9uIGRvdWJsZSBj b25zb25hbnQNCj4gKyAgICAgICAgICAocXVhaWwtZGVmcnVsZSAoY29uY2F0IGNvbnNvbmFudC1r ZXkgY29uc29uYW50LWtleSkNCj4gKyAgICAgICAgICAgICAgICAgICAgICAgICAodmVjdG9yIChj b25jYXQgY29uc29uYW50ICLgr40iIGNvbnNvbmFudCkpKQ0KPiArICAgICAgICAgIChtYXBjIChw Y2FzZS1sYW1iZGEgKGAoLHZvd2VsLWtleSAsdm93ZWwtbW9kaWZpZXIpKQ0KPiArICAgICAgICAg ICAgICAgICAgOzsg4K6J4K6v4K6/4K6w4K+N4K6u4K+G4K6v4K+NDQo+ICsgICAgICAgICAgICAg ICAgICA7OyB2b3dlbCtjb25zb25hbnQNCj4gKyAgICAgICAgICAgICAgICAgIChxdWFpbC1kZWZy dWxlIChjb25jYXQgY29uc29uYW50LWtleSB2b3dlbC1rZXkpDQo+ICsgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAodmVjdG9yIChjb25jYXQgY29uc29uYW50IHZvd2VsLW1vZGlmaWVy KSkpDQo+ICsgICAgICAgICAgICAgICAgICA7OyDgrq7gr4bgrq/gr43grq/gr4rgrrHgr43grrHg r4Eg4K6q4K6/4K6p4K+NIOCuieCur+Cuv+CusOCvjeCuruCvhuCur+CvjQ0KPiArICAgICAgICAg ICAgICAgICAgOzsgdm93ZWwrY29uc29uYW50IGFmdGVyIGRvdWJsZSBjb25zb25hbnQNCj4gKyAg ICAgICAgICAgICAgICAgIChxdWFpbC1kZWZydWxlIChjb25jYXQgY29uc29uYW50LWtleSBjb25z b25hbnQta2V5IHZvd2VsLWtleSkNCj4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICh2ZWN0b3IgKGNvbmNhdCBjb25zb25hbnQgIuCvjSIgY29uc29uYW50IHZvd2VsLW1vZGlmaWVy KSkpKQ0KPiArICAgICAgICAgICAgICAgIHRhbWlsOTktdm93ZWwtbW9kaWZpZXJzKSkNCj4gKyAg ICAgICAgdGFtaWw5OS1jb25zb25hbnRzKQ0KPiArICAoc2VxLW1hcG4gKHBjYXNlLWxhbWJkYSAo YCgsbWVsbGluYW0tY29uc29uYW50LWtleSAsbWVsbGluYW0tY29uc29uYW50KQ0KPiArICAgICAg ICAgICAgICAgICAgICAgICAgICAgYCgsdmFsbGluYW0tY29uc29uYW50LWtleSAsdmFsbGluYW0t Y29uc29uYW50KSkNCj4gKyAgICAgICAgICAgICAgOzsg4K6u4K+G4K6y4K+N4K6y4K6/4K6p4K6u 4K+NIOCuquCuv+CuqeCvjSDgrrXgrrLgr43grrLgrr/grqngrq7gr40NCj4gKyAgICAgICAgICAg ICAgOzsgdmFsbGluYW0gYWZ0ZXIgbWVsbGluYW0NCj4gKyAgICAgICAgICAgICAgKHF1YWlsLWRl ZnJ1bGUgKGNvbmNhdCBtZWxsaW5hbS1jb25zb25hbnQta2V5IHZhbGxpbmFtLWNvbnNvbmFudC1r ZXkpDQo+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2ZWN0b3IgKGNvbmNhdCBtZWxs aW5hbS1jb25zb25hbnQgIuCvjSIgdmFsbGluYW0tY29uc29uYW50KSkpDQo+ICsgICAgICAgICAg ICAgIChtYXBjIChwY2FzZS1sYW1iZGEgKGAoLHZvd2VsLWtleSAsdm93ZWwtbW9kaWZpZXIpKQ0K PiArICAgICAgICAgICAgICAgICAgICAgIDs7IOCuruCvhuCusuCvjeCusuCuv+CuqSDgrpLgrrHg r43grrHgr4rgrp/gr43grp/grr/grq8g4K614K6y4K+N4K6y4K6/4K6p4K6u4K+NIOCuquCuv+Cu qeCvjSDgrongrq/grr/grrDgr43grq7gr4bgrq/gr40NCj4gKyAgICAgICAgICAgICAgICAgICAg ICA7OyB2b3dlbCtjb25zb25hbnQgYWZ0ZXIgbWVsbGluYW0tdmFsbGluYW0gY29uc29uYW50DQo+ ICsgICAgICAgICAgICAgICAgICAgICAgKHF1YWlsLWRlZnJ1bGUgKGNvbmNhdCBtZWxsaW5hbS1j b25zb25hbnQta2V5IHZhbGxpbmFtLWNvbnNvbmFudC1rZXkgdm93ZWwta2V5KQ0KPiArICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2ZWN0b3IgKGNvbmNhdCBtZWxsaW5hbS1j b25zb25hbnQgIuCvjSIgdmFsbGluYW0tY29uc29uYW50IHZvd2VsLW1vZGlmaWVyKSkpKQ0KPiAr ICAgICAgICAgICAgICAgICAgICB0YW1pbDk5LXZvd2VsLW1vZGlmaWVycykpDQo+ICsgICAgICAg ICAgICB0YW1pbDk5LW1lbGxpbmFtLWNvbnNvbmFudHMNCj4gKyAgICAgICAgICAgIHRhbWlsOTkt dmFsbGluYW0tY29uc29uYW50cykNCj4gKyAgOzsg4K6q4K6/4K6xIOCuteCusOCuv+Cur+CvgeCu sOCvgeCuleCvjeCuleCus+CvjQ0KPiArICA7OyBvdGhlciBjaGFyYWN0ZXJzDQo+ICsgIChtYXBj IChwY2FzZS1sYW1iZGEgKGAoLGtleSAsdHJhbnNsYXRpb24pKQ0KPiArICAgICAgICAgIChxdWFp bC1kZWZydWxlIGtleSB0cmFuc2xhdGlvbikpDQo+ICsgICAgICAgIHRhbWlsOTktb3RoZXIpKQ0K DQpIaSwgSSBoYXZlIGEgdGFtaWw5OSBrZXlib2FyZCBsYXlvdXQgaW4gdGhlIHdvcmtzIGFzIHdl bGwsIGFuZCBJJ20NCnNsb3dseSBkb2dmZWVkaW5nIGl0IHdoaWxzdCBhbHNvIGxlYXJuaW5nIHRo ZSBsYXlvdXQuICBJIHVzZSBhIGRpZmZlcmVudA0KYXBwcm9hY2ggdG8gYWRkIHRoZXNlIHNwZWNp YWwgcnVsZXM6IHVzaW5nIGEgVVBEQVRFLVRSQU5TTEFUSU9OLUZVTkNUSU9OLg0KVGhpcyBoYXMg dGhlIGFkdmFudGFnZSB0aGF0IHlvdSBjYW4gaW5zZXJ0IHRoZSB2b3dlbCBzaWduIGZvciBhbnkN CmNvbnNvbmFudCBvdXQtb2Ytc2VxdWVuY2UgaS5lLiwgeW91IGNhbiBzYXkgaCBqIEJBQ0tTUEFD RSBzDQp0byBpbnNlcnQg4K6V4K6/IChhbmQgc28gZG8gb3RoZXIgcnVsZXMpLiAgV0RZVCBhYm91 dCB0aGlzIGFwcHJvYWNoLCBpcyB0aGlzDQpmZWFzaWJsZT8NCg0KQUZBSUssIE1TIFdpbmRvd3Mn IHRhbWlsOTkga2V5Ym9hcmQgbGF5b3V0IGJlaGF2ZXMgbGlrZSBtaW5lLCB3aGVyZWFzDQp0aGUg aWJ1cyBsYXlvdXQgYmVoYXZlcyBsaWtlIHlvdXIgaW1wbGVtZW50YXRpb24uICBJZiB5b3UgYXJl IGEgaGVhdnkNCnVzZXIgb2YgdGhpcyBsYXlvdXQsIGNhbiB5b3UgdHJ5IG91dCB0aGUgYXR0YWNo ZWQ/DQoNClRoZSBvbmx5IHJlYXNvbiB3aHkgSSBoYXZlbid0IHN1Ym1pdHRlZCBhIHBhdGNoIHNv IGZhciBpcyBiZWNhdXNlIEkgd2FzDQpub3Qgc3VyZSBpZiBteSBpbXBsZW1lbnRhdGlvbiB3YXNu J3QgcmlkZGxlZCBvZiBidWdzLg0KDQo= --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=tamil99.el Content-Transfer-Encoding: quoted-printable ;;; tamil99.el --- Tamil99 keyboard layout -*- lexical-binding: t= ; -*- ;; Copyright (C) 2022 Visuwesh ;; Author: Visuwesh ;; Keywords: i18n, languages ;; This program 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. ;; This program 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 this program. If not, see . ;;; Commentary: ;; This is an Emacs port of the Tamil99 keyboard layout. ;; For a description of the layout, visit http://www.tamilvu.org/ta/tkbd-in= dex-341488 ;; (direct link http://www.tamilvu.org/tkbd/Tamil_Unicode_G.O.zip). ;;; Code: (require 'quail) (defvar tamil99-translation-rules '(("q" . "=E0=AE=86") ("w" . "=E0=AE=88") ("e" . "=E0=AE=8A") ("r" . "=E0= =AE=90") ("t" . "=E0=AE=8F") ("y" . "=E0=AE=B3") ("u" . "=E0=AE=B1") ("i" .= "=E0=AE=A9") ("o" . "=E0=AE=9F") ("p" . "=E0=AE=A3") ("[" . "=E0=AE=9A") (= "]" . "=E0=AE=9E") ("Q" . "=E0=AE=B8") ("W" . "=E0=AE=B7") ("E" . "=E0=AE=9C") ("R" . "=E0= =AE=B9") ("T" . ["=E0=AE=95=E0=AF=8D=E0=AE=B7"]) ("Y" . ["=E0=AE=B8=E0=AF= =8D=E0=AE=B0=E0=AF=80"]) ("U" . "=E0=AE=B6") ("I" . "=E0=AE=A9") ("O" . "["= ) ("P" . "]") ("a" . "=E0=AE=85") ("s" . "=E0=AE=87") ("d" . "=E0=AE=89") ("f" . "=E0= =AF=8D") ("g" . "=E0=AE=8E") ("h" . "=E0=AE=95") ("j" . "=E0=AE=AA") ("k" .= "=E0=AE=AE") ("l" . "=E0=AE=A4") (";" . "=E0=AE=A8") ("'" . "=E0=AE=AF") ("A" . "=E0=AF=B9") ("S" . "=E0=AF=BA") ("D" . "=E0=AF=B8") ("F" . "=E0= =AE=83") ("G" . "=E0=AE=8E") ("H" . "=E0=AE=95") ("J" . "=E0=AE=AA") ("K" .= "\"") ("L" . ":") (":" . ";") ("\"" . "'") ("z" . "=E0=AE=94") ("x" . "=E0=AE=93") ("c" . "=E0=AE=92") ("v" . "=E0= =AE=B5") ("b" . "=E0=AE=99") ("n" . "=E0=AE=B2") ("m" . "=E0=AE=B0") ("/" .= "=E0=AE=B4") ("Z" . "=E0=AF=B3") ("X" . "=E0=AF=B4") ("C" . "=E0=AF=B5") ("V" . "=E0= =AF=B6") ("B" . "=E0=AF=B7") ("N" . "=E0=AF=90") ("M" . "/"))) ;; Separate to speed `assoc-default' calls in the translation func. (defvar tamil99-extra-translations '(("^2" . "=C2=BD") ("^3" . "=C2=BE") ("^4" . "=C2=BC") ("^7" . "=E2=80= =98") ("^8" . "=E2=80=99") ("^9" . "=E2=80=9C") ("^0" . "=E2=80=9D") ("^." . "=E2=80=A2") ("^C" . = "=C2=A9") ("^S" . "=C2=A0") ;; NBSP. ("^^" . "^") ("^#" . "=E2=82=B9") ("^f" . "=E0=AF=8D") ("^q" . "=E0=AE=BE") ("^s" . "=E0=AE=BF") ("^w" . = "=E0=AF=80") ("^d" . "=E0=AF=81") ("^e" . "=E0=AF=82") ("^g" . "=E0=AF=86") ("^t" . "=E0=AF=87") ("^r" . = "=E0=AF=88") ("^c" . "=E0=AF=8A") ("^x" . "=E0=AF=8B") ("^z" . "=E0=AF=8C") ("^#0#" . "=E0=AF=A6") ("^#1#" . "=E0=AF=A7") ("^#2#" . "=E0=AF=A8") ("= ^#3#" . "=E0=AF=A9") ("^#4#" . "=E0=AF=AA") ("^#5#" . "=E0=AF=AB") ("^#6#" . "=E0=AF=AC") ("^#7#" . "=E0=AF=AD") ("= ^#8#" . "=E0=AF=AE") ("^#9#" . "=E0=AF=AF") ("^#10#" . "=E0=AF=B0") ("^#100#" . "=E0=AF=B1") ("^#1000#" . "=E0=AF= =B2") ;; TODO: Is 1/16, 3/16, 3/80 correct? ("^#18#" . "=F0=91=BF=8C") ("^#14#" . "=F0=91=BF=90") ("^#12#" . "=F0= =91=BF=91") ("^#34#" . "=F0=91=BF=93") ("^#132#" . "=F0=91=BF=85") ("^#116#" . "=F0=91=BF=8A") ("^#316#" . "= =F0=91=BF=8E") ("^#140#" . "=F0=91=BF=84") ("^#120#" . "=F0=91=BF=88") ("^#110#" . "=F0=91=BF=8B") ("^#320#" . "= =F0=91=BF=8D") ("^#15#" . "=F0=91=BF=8F") ("^#1320#" . "=F0=91=BF=80") ("^#1160#" . "=F0=91=BF=81") ("^#180#" . "= =F0=91=BF=82") ("^#380#" . "=F0=91=BF=86"))) (defun tamil99--lookup-translation (key) (let ((trans (assoc-default key tamil99-translation-rules))) (if (vectorp trans) (aref trans 0) trans))) (defvar tamil99-vowel-signs '(("=E0=AE=85" . nil) ("=E0=AE=86" . ?=E0=AE=BE) ("=E0=AE=87" . ?=E0=AE= =BF) ("=E0=AE=88" . ?=E0=AF=80) ("=E0=AE=89" . ?=E0=AF=81) ("=E0=AE=8A" . ?=E0=AF=82) ("=E0=AE=8E" . ?= =E0=AF=86) ("=E0=AE=8F" . ?=E0=AF=87) ("=E0=AE=90" . ?=E0=AF=88) ("=E0=AE=92" . ?=E0=AF=8A) ("=E0=AE=93" . ?= =E0=AF=8B) ("=E0=AE=94" . ?=E0=AF=8C))) (defsubst tamil99-vowel-keyp (key) (member key '("q" "w" "e" "r" "t" "a" "s" "d" "g" "g" "G" "z" "x" "c"))) (defsubst tamil99-consonant-keyp (key) (member key '("y" "u" "i" "o" "p" "[" "]" "U" "I" "Q" "W" "E" "R" "T" "h" "j" "k" "l" ";" "'" "H" "J" "v" "b" "n" "m" "/" "N"))) (defsubst tamil99-consonantp () ;; Consonants in Tamil unicode block is between KA and HA. (<=3D ?=E0=AE=95 (char-before (point)) ?=E0=AE=B9)) (defsubst tamil99-vowel-sign (key) (string (assoc-default (tamil99--lookup-translation key) tamil99-vowel-si= gns))) (defvar tamil99-hard-soft-pairs '(("=E0=AE=95" . ?=E0=AE=99) ("=E0=AE=9A" . ?=E0=AE=9E) ("=E0=AE=A4" . ?= =E0=AE=A8) ("=E0=AE=9F" . ?=E0=AE=A3) ("=E0=AE=AA" . ?=E0=AE=AE) ("=E0=AE= =B1" . ?=E0=AE=A9))) (defsubst tamil99-soft-hard-pairp (key) (eq (assoc-default (tamil99--lookup-translation key) tamil99-hard-soft-pa= irs) (char-before (point)))) (defvar-local tamil99--delink-flag nil "Non-nil means prevent fancy translations. This flag is set to t when a user presses `a' to prevent conversion of mei to uyirmei, or set to `consonant' when a consonant pair or hard-soft consonant pair was handled.") (put 'tamil99--delink-flag 'permanent-local t) ;; The control flag FLAG may be a number, nil or t. ;; If a number, then that length of quail-current-key is to be ;; translated. ;; If nil, then translation is not complete, and should resume. ;; If t, then translation is complete. ;; quail-current-key is the string to be translated, quail-current-str ;; is the final translation. (defun tamil99-update-translation (flag) ;; TODO: Do we need to handle f specially as well? I.e., if the ;; previous character is not a consonant, should it insert =E0=AE=83 (F)? ;; The ibus and MS Windows tamil99 keyboard layouts simply insert ;; pulli regardless of the character before point. (cond ((eq flag t) (let ((key quail-current-key)) (cond ((and (equal key "W") (and (eq (char-before (point)) ?=E0=AF=8D) (eq (char-before (1- (point))) ?=E0=AE=95))) ;; We need a ZWNJ if the previous character is =E0=AE=95=E0=AF=8D, = otherwise =E0=AE=B7 (W) ;; combines with it to produce =E0=AE=95=E0=AF=8D=E0=AE=B7 (T). (setq quail-current-str (string #x200c quail-current-str) ; 200c = =3D ZWNJ tamil99--delink-flag nil)) ((and (tamil99-vowel-keyp key) (tamil99-consonantp)) ;; Check if delink flag needs to be set. ;; TODO: Ask Srinivasan if it is possible to insert =E0=AE=85 after= a consonant. (if (equal key "a") (setq tamil99--delink-flag t quail-current-str "") (if (or (null tamil99--delink-flag) (eq tamil99--delink-flag 'consonant)) ;; If no delink flag is set, then insert the vowel sign. (setq quail-current-str (tamil99-vowel-sign key)) ;; Reset the flag. (setq tamil99--delink-flag nil)))) ((tamil99-consonant-keyp key) ;; If delink flag is set, then don't do any fancy pants stuff. (if tamil99--delink-flag (setq tamil99--delink-flag nil) ;; If a hard-soft consonant pair is encountered or if the ;; previous consonant is same as the current consonant, then ;; add a pulli. (when (or (tamil99-soft-hard-pairp key) ;; FIXME: This naive check will definitely fail ;; when there's a =E0=AE=95=E0=AF=8D=E0=AE=B7before and= we are inserting ;; =E0=AE=B7. (equal (string (char-before (point))) (tamil99--lookup-translation key))) (setq quail-current-str (concat "=E0=AF=8D" (if (characterp qua= il-current-str) (string quail-current-st= r) quail-current-str)) tamil99--delink-flag 'consonant)))) (t (setq tamil99--delink-flag nil))))) ;; Copy-pasted from `quail-update-translation'. ((null flag) (unless quail-current-str (setq quail-current-str (if (quail-kbd-translate) (quail-keyseq-translate quail-current-key) quail-current-key)) (if (and input-method-exit-on-first-char (quail-simple)) (setq flag t)))) ((numberp flag) (let ((len (length quail-current-key))) (if (=3D flag 0) (setq quail-current-str (if (quail-kbd-translate) (quail-keyseq-translate quail-current-key) quail-current-key))) (or input-method-exit-on-first-char (while (> len flag) (setq len (1- len)) (quail-add-unread-command-events (aref quail-current-key len))))))) flag) (quail-define-package "tamil99" "Tamil" "t99" t "Tamil99 keyboard layout." nil nil t t t nil nil nil #'tamil99-update-translation nil t) (progn ;; Clear translation rules. Placeholder for now whilst testing. (let ((quail-current-package (assoc "tamil99" quail-package-alist))) (setf (nth 2 quail-current-package) '(nil))) (dolist (r (append tamil99-translation-rules tamil99-extra-translations)) (quail-defrule (car r) (cdr r) "tamil99"))) (defun tamil99--clear-delink-flag () (when (equal current-input-method "tamil99") (setq tamil99--delink-flag nil))) (add-hook 'input-method-deactivate-hook #'tamil99--clear-delink-flag) (provide 'tamil99) ;;; tamil99.el ends here --=-=-=--