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