1 ;;; lao.el --- support for Lao -*- coding: utf-8 -*-
3 ;; Copyright (C) 2001-2015 Free Software Foundation, Inc.
4 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
5 ;; 2007, 2008, 2009, 2010, 2011
6 ;; National Institute of Advanced Industrial Science and Technology (AIST)
7 ;; Registration Number H14PRO021
9 ;; National Institute of Advanced Industrial Science and Technology (AIST)
10 ;; Registration Number H13PRO009
12 ;; Keywords: multilingual, Lao
14 ;; This file is part of GNU Emacs.
16 ;; GNU Emacs is free software: you can redistribute it and/or modify
17 ;; it under the terms of the GNU General Public License as published by
18 ;; the Free Software Foundation, either version 3 of the License, or
19 ;; (at your option) any later version.
21 ;; GNU Emacs is distributed in the hope that it will be useful,
22 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;; GNU General Public License for more details.
26 ;; You should have received a copy of the GNU General Public License
27 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
33 (define-coding-system 'lao
34 "8-bit encoding for ASCII (MSB=0) and LAO (MSB=1)."
39 (set-language-info-alist
43 (input-method .
"lao")
44 (unibyte-display . lao
)
48 (let ((consonant "ກ-ຮໜໝ")
50 (vowel-upper-lower "ັິ-ົໍ")
52 (fallback-rule [nil
0 compose-gstring-for-graphic
]))
53 ;; target characters regexp
54 ;; ----------------- ------
55 (dolist (l `((,vowel-upper-lower .
"[c].[t]?")
57 (,semivowel-lower .
"[c].[v][t]?")
58 (,semivowel-lower .
"[c].[t]")))
59 (let* ((chars (car l
))
61 ;; Replace `c', `t', `v' to consonant, tone, and vowel.
62 (regexp (mapconcat #'(lambda (c)
63 (cond ((= c ?c
) consonant
)
65 ((= c ?v
) vowel-upper-lower
)
68 ;; Element of composition-function-table.
69 (elt (list (vector regexp
1 'lao-composition-function
)
73 (setq ch
(aref chars i
))
74 (if (and (> i
1) (= (aref chars
(1- i
)) ?-
))
75 ;; End of character range.
76 (set-char-table-range composition-function-table
77 (cons (aref chars
(- i
2)) ch
) elt
)
78 (if (or (= (1+ i
) len
)
79 (and (/= ch ?-
) (/= (aref chars
(1+ i
)) ?-
)))
80 ;; A character not forming a range.
81 (set-char-table-range composition-function-table ch elt
)))))))