thai.el 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. ;;; thai.el --- support for Thai -*- coding: iso-2022-7bit; no-byte-compile: t -*-
  2. ;; Copyright (C) 1997-1998, 2000-2012 Free Software Foundation, Inc.
  3. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
  4. ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011
  5. ;; National Institute of Advanced Industrial Science and Technology (AIST)
  6. ;; Registration Number H13PRO009
  7. ;; Copyright (C) 2005
  8. ;; National Institute of Advanced Industrial Science and Technology (AIST)
  9. ;; Registration Number H14PRO021
  10. ;; Keywords: multilingual, Thai, i18n
  11. ;; This file is part of GNU Emacs.
  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 3 of the License, or
  15. ;; (at your option) any later version.
  16. ;; GNU Emacs is distributed in the hope that it will be useful,
  17. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;; GNU General Public License for more details.
  20. ;; You should have received a copy of the GNU General Public License
  21. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  22. ;;; Commentary:
  23. ;; For Thai, the character set TIS620 is supported.
  24. ;;; Code:
  25. (define-coding-system 'thai-tis620
  26. "8-bit encoding for ASCII (MSB=0) and Thai TIS620 (MSB=1)."
  27. :coding-type 'charset
  28. :mnemonic ?T
  29. :charset-list '(tis620-2533))
  30. (define-coding-system-alias 'th-tis620 'thai-tis620)
  31. (define-coding-system-alias 'tis620 'thai-tis620)
  32. (define-coding-system-alias 'tis-620 'thai-tis620)
  33. (set-language-info-alist
  34. "Thai" '((tutorial . "TUTORIAL.th")
  35. (charset thai-tis620)
  36. (coding-system thai-tis620 iso-8859-11 cp874)
  37. (coding-priority thai-tis620)
  38. (nonascii-translation . tis620-2533)
  39. (input-method . "thai-kesmanee")
  40. (unibyte-display . thai-tis620)
  41. (features thai-util)
  42. (setup-function . setup-thai-language-environment-internal)
  43. (exit-function . exit-thai-language-environment-internal)
  44. (sample-text
  45. . (thai-compose-string
  46. (copy-sequence "Thai (,T@RIRd7B(B) ,TJGQJ4U$CQ:(B, ,TJGQJ4U$hP(B")))
  47. (documentation . t)))
  48. (define-coding-system 'cp874
  49. "DOS codepage 874 (Thai)"
  50. :coding-type 'charset
  51. :mnemonic ?D
  52. :charset-list '(cp874)
  53. :mime-charset 'cp874)
  54. (define-coding-system-alias 'ibm874 'cp874)
  55. (define-coding-system 'iso-8859-11
  56. "ISO/IEC 8859/11 (Latin/Thai)
  57. This is the same as `thai-tis620' with the addition of no-break-space."
  58. :coding-type 'charset
  59. :mnemonic ?*
  60. :mime-charset 'iso-8859-11 ; not actually registered as of 2002-05-24
  61. :charset-list '(iso-8859-11))
  62. ;; For automatic composition.
  63. (let ((chars ",TQTUVWXYZghijklmn(B")
  64. (elt '(["[,T!(B-,TO(B].[,Thijkl(B]?,TS(B?" 1 thai-composition-function]
  65. [nil 0 thai-composition-function])))
  66. (dotimes (i (length chars))
  67. (aset composition-function-table (aref chars i) elt)))
  68. (aset composition-function-table ?,TS(B '(["[,T!(B-,TO(B]." 1 thai-composition-function]))
  69. (provide 'thai)
  70. ;;; thai.el ends here