annotate lisp/language/indian.el @ 107200:e8c35d7a4eac

Revert isearch.el change due to feature freeze. * isearch.el (isearch-update-post-hook, isearch-update): Revert 2010-02-17 change.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 19 Feb 2010 16:36:29 -0500
parents 1d1d5d9bd884
children 21f4a7e7d29b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
92067
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
1 ;;; indian.el --- Indian languages support -*- coding: utf-8; -*-
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 106736
diff changeset
3 ;; Copyright (C) 1997, 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
74544
43cc94d955c2 Update copyright years.
Glenn Morris <rgm@gnu.org>
parents: 64085
diff changeset
4 ;; Free Software Foundation, Inc.
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 106736
diff changeset
5 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
62396
197607499a29 Fix copyrights.
Kenichi Handa <handa@m17n.org>
parents: 57537
diff changeset
6 ;; National Institute of Advanced Industrial Science and Technology (AIST)
197607499a29 Fix copyrights.
Kenichi Handa <handa@m17n.org>
parents: 57537
diff changeset
7 ;; Registration Number H14PRO021
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8
92067
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
9 ;; Maintainer: Kenichi Handa <handa@m17n.org>
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
10 ;; KAWABATA, Taichi <kawabata@m17n.org>
42312
c7ffa58f9637 Add keyword.
Pavel Janík <Pavel@Janik.cz>
parents: 42152
diff changeset
11 ;; Keywords: multilingual, i18n, Indian
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
13 ;; This file is part of GNU Emacs.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
14
94665
55b7f25d920a Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
15 ;; GNU Emacs is free software: you can redistribute it and/or modify
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16 ;; it under the terms of the GNU General Public License as published by
94665
55b7f25d920a Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
17 ;; the Free Software Foundation, either version 3 of the License, or
55b7f25d920a Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
18 ;; (at your option) any later version.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
19
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
20 ;; GNU Emacs is distributed in the hope that it will be useful,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
23 ;; GNU General Public License for more details.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
24
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
25 ;; You should have received a copy of the GNU General Public License
94665
55b7f25d920a Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
26 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
27
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
28 ;;; Commentary:
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
29
92067
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
30 ;; This file contains definitions of Indian language environments, and
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
31 ;; setups for displaying the scrtipts used there.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
32
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
33 ;;; Code:
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
34
88414
fad0f879877f Call define-coding-system instead of make-coding-system. All CCL program deleted.
Kenichi Handa <handa@m17n.org>
parents: 42312
diff changeset
35 (define-coding-system 'in-is13194-devanagari
fad0f879877f Call define-coding-system instead of make-coding-system. All CCL program deleted.
Kenichi Handa <handa@m17n.org>
parents: 42312
diff changeset
36 "8-bit encoding for ASCII (MSB=0) and IS13194-Devanagari (MSB=1)."
fad0f879877f Call define-coding-system instead of make-coding-system. All CCL program deleted.
Kenichi Handa <handa@m17n.org>
parents: 42312
diff changeset
37 :coding-type 'iso-2022
fad0f879877f Call define-coding-system instead of make-coding-system. All CCL program deleted.
Kenichi Handa <handa@m17n.org>
parents: 42312
diff changeset
38 :mnemonic ?D
fad0f879877f Call define-coding-system instead of make-coding-system. All CCL program deleted.
Kenichi Handa <handa@m17n.org>
parents: 42312
diff changeset
39 :designation [ascii indian-is13194 nil nil]
fad0f879877f Call define-coding-system instead of make-coding-system. All CCL program deleted.
Kenichi Handa <handa@m17n.org>
parents: 42312
diff changeset
40 :charset-list '(ascii indian-is13194)
89239
976a610d28e1 (in-is13194-devanagari): Fix
Kenichi Handa <handa@m17n.org>
parents: 89095
diff changeset
41 :post-read-conversion 'in-is13194-post-read-conversion
976a610d28e1 (in-is13194-devanagari): Fix
Kenichi Handa <handa@m17n.org>
parents: 89095
diff changeset
42 :pre-write-conversion 'in-is13194-pre-write-conversion)
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
43
88414
fad0f879877f Call define-coding-system instead of make-coding-system. All CCL program deleted.
Kenichi Handa <handa@m17n.org>
parents: 42312
diff changeset
44 (define-coding-system-alias 'devanagari 'in-is13194-devanagari)
46743
d341cac00baf (in-is13194): Give correct `safe-chars' property.
Kenichi Handa <handa@m17n.org>
parents: 42312
diff changeset
45
92067
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
46 (set-language-info-alist
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
47 "Devanagari" '((charset unicode)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
48 (coding-system utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
49 (coding-priority utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
50 (input-method . "dev-aiba")
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
51 (documentation . "\
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
52 Such languages using Devanagari script as Hindi and Marathi
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
53 are supported in this language environment."))
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
54 '("Indian"))
50256
104cf4fa2a8e (indian-font-foundry): New variable.
Kenichi Handa <handa@m17n.org>
parents: 49704
diff changeset
55
92067
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
56 (set-language-info-alist
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
57 "Bengali" '((charset unicode)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
58 (coding-system utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
59 (coding-priority utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
60 (input-method . "bengali-itrans")
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
61 (documentation . "\
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
62 Such languages using Bengali script as Bengali and Assamese
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
63 are supported in this language environment."))
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
64 '("Indian"))
50256
104cf4fa2a8e (indian-font-foundry): New variable.
Kenichi Handa <handa@m17n.org>
parents: 49704
diff changeset
65
92067
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
66 (set-language-info-alist
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
67 "Punjabi" '((charset unicode)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
68 (coding-system utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
69 (coding-priority utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
70 (input-method . "punjabi-itrans")
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
71 (documentation . "\
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
72 North Indian language Punjabi is supported in this language environment."))
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
73 '("Indian"))
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
74
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
75 (set-language-info-alist
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
76 "Gujarati" '((charset unicode)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
77 (coding-system utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
78 (coding-priority utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
79 (input-method . "gujarati-itrans")
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
80 (documentation . "\
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
81 North Indian language Gujarati is supported in this language environment."))
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
82 '("Indian"))
50256
104cf4fa2a8e (indian-font-foundry): New variable.
Kenichi Handa <handa@m17n.org>
parents: 49704
diff changeset
83
92067
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
84 (set-language-info-alist
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
85 "Oriya" '((charset unicode)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
86 (coding-system utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
87 (coding-priority utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
88 (input-method . "oriya-itrans")
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
89 (documentation . "\
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
90 Such languages using Oriya script as Oriya, Khonti, and Santali
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
91 are supported in this language environment."))
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
92 '("Indian"))
57537
b9687fdf909d (indian-script-language-alist): Swap value and doc.
Kim F. Storm <storm@cua.dk>
parents: 52401
diff changeset
93
92067
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
94 (set-language-info-alist
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
95 "Tamil" '((charset unicode)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
96 (coding-system utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
97 (coding-priority utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
98 (input-method . "tamil-itrans")
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
99 (documentation . "\
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
100 South Indian Language Tamil is supported in this language environment."))
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
101 '("Indian"))
57537
b9687fdf909d (indian-script-language-alist): Swap value and doc.
Kim F. Storm <storm@cua.dk>
parents: 52401
diff changeset
102
92067
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
103 (set-language-info-alist
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
104 "Telugu" '((charset unicode)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
105 (coding-system utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
106 (coding-priority utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
107 (input-method . "telugu-itrans")
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
108 (documentation . "\
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
109 South Indian Language Telugu is supported in this language environment."))
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
110 '("Indian"))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
111
92067
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
112 (set-language-info-alist
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
113 "Kannada" '((charset unicode)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
114 (coding-system mule-utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
115 (coding-priority mule-utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
116 (input-method . "kannada-itrans")
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
117 (sample-text . "Kannada (ಕನ್ನಡ) ನಮಸ್ಕಾರ")
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
118 (documentation . "\
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
119 Kannada language and script is supported in this language
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
120 environment."))
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
121 '("Indian"))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
122
92067
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
123 (set-language-info-alist
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
124 "Malayalam" '((charset unicode)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
125 (coding-system utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
126 (coding-priority utf-8)
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
127 (input-method . "malayalam-itrans")
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
128 (documentation . "\
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
129 South Indian language Malayalam is supported in this language environment."))
e687db4e3832 (indian-font-foundry)
Kenichi Handa <handa@m17n.org>
parents: 91327
diff changeset
130 '("Indian"))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
131
106541
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
132 ;; Replace mnemonic characters in REGEXP according to TABLE. TABLE is
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
133 ;; an alist of (MNEMONIC-STRING . REPLACEMENT-STRING).
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
134
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
135 (defun indian-compose-regexp (regexp table)
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
136 (let ((case-fold-search nil))
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
137 (dolist (elt table)
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
138 (setq regexp (replace-regexp-in-string (car elt) (cdr elt) regexp t t)))
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
139 regexp))
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
140
97841
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
141 (defconst devanagari-composable-pattern
106634
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
142 (let ((table
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
143 '(("V" . "[\u0904-\u0914\u0960-\u0961\u0972]") ; independent vowel
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
144 ("C" . "[\u0915-\u0939]") ; consonant
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
145 ("R" . "\u0930") ; RA
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
146 ("n" . "\u093C") ; NUKTA
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
147 ("H" . "\u094D") ; HALANT
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
148 ("m" . "\u093F") ; vowel sign (pre)
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
149 ("u" . "[\u0945-\u0948\u0955]") ; vowel sign (above)
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
150 ("b" . "[\u0941-\u0944\u0962-\u0963]") ; vowel sign (below)
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
151 ("p" . "[\u093E\u0940\u0949-\u094C]") ; vowel sign (post)
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
152 ("A" . "[\u0900-\u0902\u0953-\u0954]") ; vowel modifier (above)
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
153 ("a" . "\u0903") ; vowel modifier (post)
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
154 ("S" . "\u0951") ; stress sign (above)
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
155 ("s" . "\u0952") ; stress sign (below)
106736
8d23ea9e4ab1 language/indian.el (malayalam-composable-pattern): Fix ZWNJ and ZWJ.
Kenichi Handa <handa@m17n.org>
parents: 106634
diff changeset
156 ("N" . "\u200C") ; ZWNJ
106634
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
157 ("J" . "\u200D") ; ZWJ
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
158 ("X" . "[\u0900-\u097F]")))) ; all coverage
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
159 (indian-compose-regexp
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
160 (concat
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
161 ;; syllables with an independent vowel, or
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
162 "\\(?:RH\\)?Vn?m?b?u?p?n?A?s?S?a?\\|"
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
163 ;; consonant-based syllables, or
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
164 "\\(?:Cn?J?HJ?\\)*Cn?\\(?:H[NJ]?\\|m?b?u?p?n?A?s?S?a?\\)\\|"
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
165 ;; special consonant form, or
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
166 "JHR\\|"
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
167 ;; any other singleton characters
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
168 "X")
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
169 table))
97841
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
170 "Regexp matching a composable sequence of Devanagari characters.")
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
171
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
172 (defconst tamil-composable-pattern
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
173 (concat
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
174 "\\([அ-ஔ]\\)\\|"
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
175 "[ஂஃ]\\|" ;; vowel modifier considered independent
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
176 "\\(\\(?:\\(?:க்ஷ\\)\\|[க-ஹ]\\)[்ா-ௌ]?\\)\\|"
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
177 "\\(ஷ்ரீ\\)")
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
178 "Regexp matching a composable sequence of Tamil characters.")
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
179
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
180 (defconst kannada-composable-pattern
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
181 (concat
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
182 "\\([ಂ-ಔೠಌ]\\)\\|[ಃ]"
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
183 "\\|\\("
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
184 "\\(?:\\(?:[ಕ-ಹ]್\\)?\\(?:[ಕ-ಹ]್\\)?\\(?:[ಕ-ಹ]್\\)?[ಕ-ಹ]್\\)?"
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
185 "[ಕ-ಹ]\\(?:್\\|[ಾ-್ೕೃ]?\\)?"
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
186 "\\)")
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
187 "Regexp matching a composable sequence of Kannada characters.")
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
188
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
189 (defconst malayalam-composable-pattern
106634
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
190 (let ((table
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
191 '(("V" . "[\u0D05-\u0D14\u0D60-\u0D61]") ; independent vowel
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
192 ("C" . "[\u0D15-\u0D39]") ; consonant
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
193 ("m" . "[\u0D46-\u0D48\u0D4A-\u0D4C]") ; prebase matra
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
194 ("p" . "[\u0D3E-\u0D44\u0D57]") ; postbase matra
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
195 ("b" . "[\u0D62-\u0D63]") ; belowbase matra
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
196 ("a" . "[\u0D02-\u0D03]") ; abovebase sign
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
197 ("H" . "\u0D4D") ; virama sign
106736
8d23ea9e4ab1 language/indian.el (malayalam-composable-pattern): Fix ZWNJ and ZWJ.
Kenichi Handa <handa@m17n.org>
parents: 106634
diff changeset
198 ("N" . "\u200C") ; ZWNJ
8d23ea9e4ab1 language/indian.el (malayalam-composable-pattern): Fix ZWNJ and ZWJ.
Kenichi Handa <handa@m17n.org>
parents: 106634
diff changeset
199 ("J" . "\u200D") ; ZWJ
106634
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
200 ("X" . "[\u0D00-\u0D7F]")))) ; all coverage
106541
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
201 (indian-compose-regexp
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
202 (concat
106634
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
203 ;; syllables with an independent vowel, or
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
204 "V\\(?:J?HC\\)?m?b?p?a?\\|"
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
205 ;; consonant-based syllables, or
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
206 "\\(?:CJ?HJ?\\)\\{0,4\\}C\\(?:H[NJ]?\\|m?b?p?a?\\)\\|"
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
207 ;; special consonant form, or
106541
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
208 "JHC\\|"
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
209 ;; any other singleton characters
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
210 "X")
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
211 table))
97841
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
212 "Regexp matching a composable sequence of Malayalam characters.")
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
213
91322
fc05151881d9 Set font-shape-text for all Indic characters
Kenichi Handa <handa@m17n.org>
parents: 90996
diff changeset
214 (let ((script-regexp-alist
106634
1f0768e4ad7e (devanagari-composable-pattern): Fixed to
Kenichi Handa <handa@m17n.org>
parents: 106543
diff changeset
215 `((devanagari . ,devanagari-composable-pattern)
91322
fc05151881d9 Set font-shape-text for all Indic characters
Kenichi Handa <handa@m17n.org>
parents: 90996
diff changeset
216 (bengali . "[\x980-\x9FF\x200C\x200D]+")
fc05151881d9 Set font-shape-text for all Indic characters
Kenichi Handa <handa@m17n.org>
parents: 90996
diff changeset
217 (gurmukhi . "[\xA00-\xA7F\x200C\x200D]+")
fc05151881d9 Set font-shape-text for all Indic characters
Kenichi Handa <handa@m17n.org>
parents: 90996
diff changeset
218 (gujarati . "[\xA80-\xAFF\x200C\x200D]+")
fc05151881d9 Set font-shape-text for all Indic characters
Kenichi Handa <handa@m17n.org>
parents: 90996
diff changeset
219 (oriya . "[\xB00-\xB7F\x200C\x200D]+")
106374
d869f6255c19 Include ZWJ and ZWNJ in the patterns to shape for all Indic scripts.
Kenichi Handa <handa@m17n.org>
parents: 100908
diff changeset
220 (tamil . "[\xB80-\xBFF\x200C\x200D]+")
91322
fc05151881d9 Set font-shape-text for all Indic characters
Kenichi Handa <handa@m17n.org>
parents: 90996
diff changeset
221 (telugu . "[\xC00-\xC7F\x200C\x200D]+")
106374
d869f6255c19 Include ZWJ and ZWNJ in the patterns to shape for all Indic scripts.
Kenichi Handa <handa@m17n.org>
parents: 100908
diff changeset
222 (kannada . "[\xC80-\xCFF\x200C\x200D]+")
106541
0697cb4477c8 (indian-compose-regexp): New function.
Kenichi Handa <handa@m17n.org>
parents: 106374
diff changeset
223 (malayalam . ,malayalam-composable-pattern))))
97841
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
224 (map-char-table
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
225 #'(lambda (key val)
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
226 (let ((slot (assq val script-regexp-alist)))
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
227 (if slot
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
228 (set-char-table-range
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
229 composition-function-table key
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
230 (list (vector (cdr slot) 0 'font-shape-gstring))))))
10312e057a97 Fix setting up of
Kenichi Handa <handa@m17n.org>
parents: 94665
diff changeset
231 char-script-table))
50256
104cf4fa2a8e (indian-font-foundry): New variable.
Kenichi Handa <handa@m17n.org>
parents: 49704
diff changeset
232
33778
6d966e8b4bbe Use provide.
Dave Love <fx@gnu.org>
parents: 23158
diff changeset
233 (provide 'indian)
41469
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
234
93975
1e3a407766b9 Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 92067
diff changeset
235 ;; arch-tag: 83aa8fc7-7ee2-4364-a6e5-498f5e3b8c2f
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
236 ;;; indian.el ends here