1;;; thai.el --- support for Thai -*- coding: iso-2022-7bit; no-byte-compile: t -*-
2
3;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4;;   2005, 2006, 2007
5;;   National Institute of Advanced Industrial Science and Technology (AIST)
6;;   Registration Number H14PRO021
7;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
8;;   2006, 2007  Free Software Foundation, Inc.
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
25;; along with GNU Emacs; see the file COPYING.  If not, write to the
26;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
27;; Boston, MA 02110-1301, USA.
28
29;;; Commentary:
30
31;; For Thai, the character set TIS620 is supported.
32
33;;; Code:
34
35(make-coding-system
36 'thai-tis620 2 ?T
37 "8-bit encoding for ASCII (MSB=0) and Thai TIS620 (MSB=1)."
38 '(ascii thai-tis620 nil nil
39   nil nil nil nil nil nil nil nil nil nil nil t)
40 '((safe-charsets ascii thai-tis620)
41   (mime-charset . tis-620)
42   (post-read-conversion . thai-post-read-conversion)))
43
44(define-coding-system-alias 'th-tis620 'thai-tis620)
45(define-coding-system-alias 'tis620 'thai-tis620)
46(define-coding-system-alias 'tis-620 'thai-tis620)
47
48(set-language-info-alist
49 "Thai" '((tutorial . "TUTORIAL.th")
50	  (charset thai-tis620)
51	  (coding-system thai-tis620)
52	  (coding-priority thai-tis620)
53	  (nonascii-translation . thai-tis620)
54	  (input-method . "thai-kesmanee")
55	  (unibyte-display . thai-tis620)
56	  (features thai-util)
57	  (setup-function . setup-thai-language-environment-internal)
58	  (exit-function . exit-thai-language-environment-internal)
59	  (sample-text
60	   . (thai-compose-string
61	      (copy-sequence "Thai (,T@RIRd7B(B)		,TJ0GQ1J04U1$0CQ1:(B, ,TJ0GQ1J04U10$h1P(B")))
62	  (documentation . t)))
63
64
65;; Register a function to compose Thai characters.
66(let ((patterns '(("\\c0?\\(\\c2\\|\\c3\\|\\c4\\)+"
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)))
71
72(provide 'thai)
73
74;;; arch-tag: c7eb0e91-4db0-4619-81f8-8762e7d51e15
75;;; thai.el ends here
76