Commit | Line | Data |
---|---|---|
0a10297a | 1 | ;;; thai.el --- support for Thai -*- coding: iso-2022-7bit; no-byte-compile: t -*- |
4ed46869 | 2 | |
d4877ac1 GM |
3 | ;; Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, |
4 | ;; 2004, 2005, 2006 | |
db328182 KH |
5 | ;; National Institute of Advanced Industrial Science and Technology (AIST) |
6 | ;; Registration Number H14PRO021 | |
d4877ac1 GM |
7 | ;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, |
8 | ;; 2006 Free Software Foundation, Inc. | |
4ed46869 KH |
9 | |
10 | ;; Keywords: multilingual, Thai | |
11 | ||
12 | ;; This file is part of GNU Emacs. | |
13 | ||
14 | ;; GNU Emacs is free software; you can redistribute it and/or modify | |
15 | ;; it under the terms of the GNU General Public License as published by | |
16 | ;; the Free Software Foundation; either version 2, or (at your option) | |
17 | ;; any later version. | |
18 | ||
19 | ;; GNU Emacs is distributed in the hope that it will be useful, | |
20 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | ;; GNU General Public License for more details. | |
23 | ||
24 | ;; You should have received a copy of the GNU General Public License | |
369314dc | 25 | ;; along with GNU Emacs; see the file COPYING. If not, write to the |
3a35cf56 LK |
26 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
27 | ;; Boston, MA 02110-1301, USA. | |
4ed46869 KH |
28 | |
29 | ;;; Commentary: | |
30 | ||
31 | ;; For Thai, the character set TIS620 is supported. | |
32 | ||
33 | ;;; Code: | |
34 | ||
35 | (make-coding-system | |
4b9121fc | 36 | 'thai-tis620 2 ?T |
5ef35063 | 37 | "8-bit encoding for ASCII (MSB=0) and Thai TIS620 (MSB=1)." |
a79a3c79 | 38 | '(ascii thai-tis620 nil nil |
bbd84e16 | 39 | nil nil nil nil nil nil nil nil nil nil nil t) |
a79a3c79 | 40 | '((safe-charsets ascii thai-tis620) |
b586f4b4 | 41 | (mime-charset . tis-620) |
c27737aa | 42 | (post-read-conversion . thai-post-read-conversion))) |
a7f2c216 | 43 | |
2e21aa27 RS |
44 | (define-coding-system-alias 'th-tis620 'thai-tis620) |
45 | (define-coding-system-alias 'tis620 'thai-tis620) | |
5d22a4c9 | 46 | (define-coding-system-alias 'tis-620 'thai-tis620) |
4ed46869 | 47 | |
4ed46869 KH |
48 | (set-language-info-alist |
49 | "Thai" '((tutorial . "TUTORIAL.th") | |
a79a3c79 KH |
50 | (charset thai-tis620) |
51 | (coding-system thai-tis620) | |
52 | (coding-priority thai-tis620) | |
a564ccf9 KH |
53 | (nonascii-translation . thai-tis620) |
54 | (input-method . "thai-kesmanee") | |
55 | (unibyte-display . thai-tis620) | |
56 | (features thai-util) | |
44053845 KH |
57 | (setup-function . setup-thai-language-environment-internal) |
58 | (exit-function . exit-thai-language-environment-internal) | |
a1506d29 | 59 | (sample-text |
e2a20aa7 KH |
60 | . (thai-compose-string |
61 | (copy-sequence "Thai (\e,T@RIRd7B\e(B) \e,TJ\e0GQ\e1J\e04U\e1$\e0CQ\e1:\e(B, \e,TJ\e0GQ\e1J\e04U\e1\e0$h\e1P\e(B"))) | |
78eee0ed | 62 | (documentation . t))) |
4ed46869 | 63 | |
c27737aa KH |
64 | |
65 | ;; Register a function to compose Thai characters. | |
7b6fb480 | 66 | (let ((patterns '(("\\c0?\\(\\c2\\|\\c3\\|\\c4\\)+" |
2c974b15 DL |
67 | . thai-composition-function)))) |
68 | (aset composition-function-table (make-char 'thai-tis620) patterns) | |
69 | (dotimes (i (1+ (- #xe7f #xe00))) | |
70 | (aset composition-function-table (decode-char 'ucs (+ i #xe00)) patterns))) | |
c27737aa | 71 | |
41da80b1 DL |
72 | (provide 'thai) |
73 | ||
ab5796a9 | 74 | ;;; arch-tag: c7eb0e91-4db0-4619-81f8-8762e7d51e15 |
4ed46869 | 75 | ;;; thai.el ends here |