Switch to recommended form of GPLv3 permissions notice.
[bpt/emacs.git] / lisp / language / indian.el
1 ;;; indian.el --- Indian languages support -*- coding: utf-8; -*-
2
3 ;; Copyright (C) 1997, 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4 ;; Free Software Foundation, Inc.
5 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
6 ;; National Institute of Advanced Industrial Science and Technology (AIST)
7 ;; Registration Number H14PRO021
8
9 ;; Maintainer: Kenichi Handa <handa@m17n.org>
10 ;; KAWABATA, Taichi <kawabata@m17n.org>
11 ;; Keywords: multilingual, i18n, Indian
12
13 ;; This file is part of GNU Emacs.
14
15 ;; GNU Emacs is free software; you can redistribute it and/or modify
16 ;; it under the terms of the GNU General Public License as published by
17 ;; the Free Software Foundation; either version 3, or (at your option)
18 ;; any later version.
19
20 ;; GNU Emacs is distributed in the hope that it will be useful,
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;; GNU General Public License for more details.
24
25 ;; You should have received a copy of the GNU General Public License
26 ;; along with GNU Emacs; see the file COPYING. If not, write to the
27 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
28 ;; Boston, MA 02110-1301, USA.
29
30 ;;; Commentary:
31
32 ;; This file contains definitions of Indian language environments, and
33 ;; setups for displaying the scrtipts used there.
34
35 ;;; Code:
36
37 (define-coding-system 'in-is13194-devanagari
38 "8-bit encoding for ASCII (MSB=0) and IS13194-Devanagari (MSB=1)."
39 :coding-type 'iso-2022
40 :mnemonic ?D
41 :designation [ascii indian-is13194 nil nil]
42 :charset-list '(ascii indian-is13194)
43 :post-read-conversion 'in-is13194-post-read-conversion
44 :pre-write-conversion 'in-is13194-pre-write-conversion)
45
46 (define-coding-system-alias 'devanagari 'in-is13194-devanagari)
47
48 (set-language-info-alist
49 "Devanagari" '((charset unicode)
50 (coding-system utf-8)
51 (coding-priority utf-8)
52 (input-method . "dev-aiba")
53 (documentation . "\
54 Such languages using Devanagari script as Hindi and Marathi
55 are supported in this language environment."))
56 '("Indian"))
57
58 (set-language-info-alist
59 "Bengali" '((charset unicode)
60 (coding-system utf-8)
61 (coding-priority utf-8)
62 (input-method . "bengali-itrans")
63 (documentation . "\
64 Such languages using Bengali script as Bengali and Assamese
65 are supported in this language environment."))
66 '("Indian"))
67
68 (set-language-info-alist
69 "Punjabi" '((charset unicode)
70 (coding-system utf-8)
71 (coding-priority utf-8)
72 (input-method . "punjabi-itrans")
73 (documentation . "\
74 North Indian language Punjabi is supported in this language environment."))
75 '("Indian"))
76
77 (set-language-info-alist
78 "Gujarati" '((charset unicode)
79 (coding-system utf-8)
80 (coding-priority utf-8)
81 (input-method . "gujarati-itrans")
82 (documentation . "\
83 North Indian language Gujarati is supported in this language environment."))
84 '("Indian"))
85
86 (set-language-info-alist
87 "Oriya" '((charset unicode)
88 (coding-system utf-8)
89 (coding-priority utf-8)
90 (input-method . "oriya-itrans")
91 (documentation . "\
92 Such languages using Oriya script as Oriya, Khonti, and Santali
93 are supported in this language environment."))
94 '("Indian"))
95
96 (set-language-info-alist
97 "Tamil" '((charset unicode)
98 (coding-system utf-8)
99 (coding-priority utf-8)
100 (input-method . "tamil-itrans")
101 (documentation . "\
102 South Indian Language Tamil is supported in this language environment."))
103 '("Indian"))
104
105 (set-language-info-alist
106 "Telugu" '((charset unicode)
107 (coding-system utf-8)
108 (coding-priority utf-8)
109 (input-method . "telugu-itrans")
110 (documentation . "\
111 South Indian Language Telugu is supported in this language environment."))
112 '("Indian"))
113
114 (set-language-info-alist
115 "Kannada" '((charset unicode)
116 (coding-system mule-utf-8)
117 (coding-priority mule-utf-8)
118 (input-method . "kannada-itrans")
119 (sample-text . "Kannada (ಕನ್ನಡ) ನಮಸ್ಕಾರ")
120 (documentation . "\
121 Kannada language and script is supported in this language
122 environment."))
123 '("Indian"))
124
125 (set-language-info-alist
126 "Malayalam" '((charset unicode)
127 (coding-system utf-8)
128 (coding-priority utf-8)
129 (input-method . "malayalam-itrans")
130 (documentation . "\
131 South Indian language Malayalam is supported in this language environment."))
132 '("Indian"))
133
134 (let ((script-regexp-alist
135 '((devanagari . "[\x900-\x9FF\x200C\x200D]+")
136 (bengali . "[\x980-\x9FF\x200C\x200D]+")
137 (gurmukhi . "[\xA00-\xA7F\x200C\x200D]+")
138 (gujarati . "[\xA80-\xAFF\x200C\x200D]+")
139 (oriya . "[\xB00-\xB7F\x200C\x200D]+")
140 (tamil . "[\xB80-\xBFF\x200C\x200D]+")
141 (telugu . "[\xC00-\xC7F\x200C\x200D]+")
142 (kannada . "[\xC80-\xCFF\x200C\x200D]+")
143 (malayalam . "[\xD00-\xD7F\x200C\x200D]+"))))
144 (map-char-table #'(lambda (key val)
145 (let ((slot (assq val script-regexp-alist)))
146 (if slot
147 (set-char-table-range
148 composition-function-table key
149 (list (cons (cdr slot) 'font-shape-text))))))
150 char-script-table))
151
152 (provide 'indian)
153
154 ;; arch-tag: 83aa8fc7-7ee2-4364-a6e5-498f5e3b8c2f
155 ;;; indian.el ends here