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