159
|
1 ;;; thai.el --- Support for Thai
|
|
2
|
|
3 ;; Copyright (C) 1995 Free Software Foundation, Inc.
|
|
4 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
|
|
5 ;; Copyright (C) 1997 MORIOKA Tomohiko
|
|
6
|
|
7 ;; Keywords: multilingual, Thai
|
|
8
|
|
9 ;; This file is part of XEmacs.
|
|
10
|
|
11 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
12 ;; under the terms of the GNU General Public License as published by
|
|
13 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
14 ;; any later version.
|
|
15
|
|
16 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
19 ;; General Public License for more details.
|
|
20
|
|
21 ;; You should have received a copy of the GNU General Public License
|
|
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
24 ;; 02111-1307, USA.
|
|
25
|
|
26 ;;; Commentary:
|
|
27
|
|
28 ;; For Thai, the character set TIS620 is supported.
|
|
29
|
|
30 ;;; Code:
|
|
31
|
|
32 (define-language-environment 'thai
|
|
33 "Thai"
|
|
34 (lambda ()
|
|
35 (set-coding-category-system 'iso-8-designate 'tis620)
|
|
36 (set-coding-priority-list '(iso-8-designate iso-8-1))
|
|
37 (set-default-buffer-file-coding-system 'tis620)
|
|
38 ;; (setq-default quail-current-package (assoc "thai" quail-package-alist))
|
|
39 ))
|
|
40
|
|
41 ;; (make-coding-system
|
|
42 ;; 'th-tis620 2 ?T
|
|
43 ;; "Coding-system used for ASCII(MSB=0) & TIS620(MSB=1)."
|
|
44 ;; '((ascii t) (thai-tis620 t) nil nil
|
|
45 ;; nil ascii-eol))
|
|
46 ;; (put 'th-tis620 'post-read-conversion 'thai-post-read-conversion)
|
|
47 ;; (put 'th-tis620 'pre-write-conversion 'thai-pre-write-conversion)
|
|
48
|
|
49 (make-coding-system
|
|
50 'tis620 'iso2022
|
|
51 "Coding-system used for ASCII(MSB=0) & TIS620(MSB=1)."
|
|
52 '(charset-g0 ascii
|
|
53 charset-g1 thai-tis620
|
|
54 no-ascii-cntl t
|
|
55 mnemonic "TIS620"
|
|
56 post-read-conversion thai-compose-region
|
|
57 pre-write-conversion decompose-region
|
|
58 ))
|
|
59
|
|
60 ;;(define-coding-system-alias 'th-tis620 'tis620)
|
|
61
|
|
62 (register-input-method
|
|
63 "Thai" '("quail-thai" quail-use-package "quail/thai"))
|
|
64
|
|
65 (defun setup-thai-environment ()
|
|
66 "Setup multilingual environment (MULE) for Thai."
|
|
67 (interactive)
|
|
68 (setup-english-environment)
|
|
69 (setq coding-category-iso-8-1 'th-tis620)
|
|
70
|
|
71 (set-coding-priority
|
|
72 '(coding-category-iso-7
|
|
73 coding-category-iso-8-1))
|
|
74
|
|
75 (setq-default buffer-file-coding-system 'th-tis620)
|
|
76
|
|
77 (setq default-input-method '("Thai" . "quail-thai"))
|
|
78 )
|
|
79
|
|
80 (defun describe-thai-support ()
|
|
81 "Describe how Emacs supports Thai."
|
|
82 (interactive)
|
|
83 (describe-language-support-internal "Thai"))
|
|
84
|
|
85 (set-language-info-alist
|
|
86 "Thai" '((tutorial . "TUTORIAL.th")
|
|
87 (setup-function . setup-thai-environment)
|
|
88 (describe-function . describe-thai-support)
|
|
89 (charset . (thai-tis620))
|
|
90 (coding-system . (th-tis620))
|
|
91 (sample-text . "Thai (,T@RIRd7B(B) ,TJ0GQ1J04U1$0CQ1:(B, ,TJ0GQ1J04U10$h1P(B")
|
|
92 (documentation . nil)))
|
|
93
|
|
94 ;;; thai.el ends here
|