]> code.delx.au - gnu-emacs/blobdiff - lisp/language/thai.el
* language/ethio-util.el (ethio-gemination)
[gnu-emacs] / lisp / language / thai.el
index 8172d7f59a357ba2634d4e3a61364da40b787355..1c1909976a584d97cd37f7f39957aa24e942f790 100644 (file)
@@ -1,7 +1,7 @@
-;;; thai.el --- Support for Thai
+;;; thai.el --- support for Thai -*- coding: iso-2022-7bit; no-byte-compile: t -*-
 
-;; Copyright (C) 1995 Free Software Foundation, Inc.
 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
+;; Licensed to the Free Software Foundation.
 
 ;; Keywords: multilingual, Thai
 
 ;;; Code:
 
 (make-coding-system
- 'th-tis620 2 ?T
- "Coding-system used for ASCII(MSB=0) & TIS620(MSB=1)."
- '((ascii t) (thai-tis620 t) nil nil
-   nil ascii-eol))
-(put 'th-tis620 'post-read-conversion 'thai-post-read-conversion)
-(put 'th-tis620 'pre-write-conversion 'thai-pre-write-conversion)
-
-(define-coding-system-alias 'th-tis620 'tis620)
-
-(register-input-method
- "Thai" '("quail-thai" quail-use-package "quail/thai"))
-
-(defun setup-thai-environment ()
-  "Setup multilingual environment (MULE) for Thai."
-  (interactive)
-  (setup-english-environment)
-  (setq coding-category-iso-8-1 'th-tis620)
-
-  (set-coding-priority
-   '(coding-category-iso-7
-     coding-category-iso-8-1))
-
-  (setq-default buffer-file-coding-system 'th-tis620)
-
-  (setq default-input-method '("Thai" . "quail-thai"))
-  )
-
-(defun describe-thai-support ()
-  "Describe how Emacs supports Thai."
-  (interactive)
-  (describe-language-support-internal "Thai"))
+ 'thai-tis620 2 ?T
+ "8-bit encoding for ASCII (MSB=0) and Thai TIS620 (MSB=1)."
+ '(ascii thai-tis620 nil nil
+   nil nil nil nil nil nil nil nil nil nil nil t)
+ '((safe-charsets ascii thai-tis620)
+   (mime-charset . tis-620)
+   (post-read-conversion . thai-post-read-conversion)))
+
+(define-coding-system-alias 'th-tis620 'thai-tis620)
+(define-coding-system-alias 'tis620 'thai-tis620)
+(define-coding-system-alias 'tis-620 'thai-tis620)
 
 (set-language-info-alist
  "Thai" '((tutorial . "TUTORIAL.th")
-         (setup-function . setup-thai-environment)
-         (describe-function . describe-thai-support)
-         (charset . (thai-tis620))
-         (coding-system . (th-tis620))
-         (sample-text . "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")
-         (documentation . nil)))
+         (charset thai-tis620)
+         (coding-system thai-tis620)
+         (coding-priority thai-tis620)
+         (nonascii-translation . thai-tis620)
+         (input-method . "thai-kesmanee")
+         (unibyte-display . thai-tis620)
+         (features thai-util)
+         (sample-text 
+          . (thai-compose-string
+             (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")))
+         (documentation . t)))
+
+
+;; Register a function to compose Thai characters.
+(let ((patterns '(("\\c0\\c4\\|\\c0\\(\\c2\\|\\c3\\)\\c4?"
+                  . thai-composition-function))))
+  (aset composition-function-table (make-char 'thai-tis620) patterns)
+  (dotimes (i (1+ (- #xe7f #xe00)))
+    (aset composition-function-table (decode-char 'ucs (+ i #xe00)) patterns)))
+
+(provide 'thai)
 
 ;;; thai.el ends here