Commit | Line | Data |
---|---|---|
c052c904 | 1 | ;;; burmese.el --- support for Burmese -*- coding: utf-8 -*- |
ca92c5bc | 2 | |
5df4f04c | 3 | ;; Copyright (C) 2008, 2009, 2010, 2011 |
ca92c5bc RS |
4 | ;; National Institute of Advanced Industrial Science and Technology (AIST) |
5 | ;; Registration Number H13PRO009 | |
6 | ||
7 | ;; Keywords: multilingual, Burma, i18n | |
8 | ||
9 | ;; This file is part of GNU Emacs. | |
10 | ||
4936186e | 11 | ;; GNU Emacs is free software: you can redistribute it and/or modify |
ca92c5bc | 12 | ;; it under the terms of the GNU General Public License as published by |
4936186e GM |
13 | ;; the Free Software Foundation, either version 3 of the License, or |
14 | ;; (at your option) any later version. | |
ca92c5bc RS |
15 | |
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 | ||
21 | ;; You should have received a copy of the GNU General Public License | |
4936186e | 22 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
ca92c5bc RS |
23 | |
24 | ;;; Commentary: | |
25 | ||
26 | ;; Aung San Suu Kyi says to call her country "Burma". | |
27 | ;; The murderous generals say to call it "Myanmar". | |
28 | ;; We will call it "Burma". -- rms, Chief GNUisance. | |
29 | ||
30 | ;;; Code: | |
31 | ||
32 | (set-language-info-alist | |
33 | "Burmese" '((charset unicode) | |
34 | (coding-system utf-8) | |
35 | (coding-priority utf-8) | |
36ef8f08 | 36 | (sample-text . "Burmese (မ္ရန္မာ) မင္ဂလာပာ") |
ca92c5bc RS |
37 | (documentation . t))) |
38 | ||
d99ea08e | 39 | (defvar burmese-composable-pattern |
f88cc4d6 KH |
40 | (let ((table |
41 | '(("K" . "[\u1004\u105A]\u103A\u1039") ; KINZI sequence | |
42 | ("C" . "[\u1000-\u102A\u103F\u1041-\u1049\u104E\u105A-\u105D\u1061\u1065-\u1066\u106E\u1071\u1075\u1081\u108E\uAA60-\uAA6F\uAA71-\uAA76]") ; consonant and vowel letter | |
43 | ("V" . "\u1039") ; VIRAMA | |
44 | ("A" . "\u103A") ; ASAT | |
45 | ("S" . "[\u1000-\u1019\u101C\u101E\u1020\u1021\u105A]") ; subscript | |
46 | ("M" . "[\u103B-\u103E\105E-\1060]") ; medial | |
47 | ("v" . "[\u102B-\u103A\u103C-\u103E\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A\u109C\uAA70]"))) ; vowel sign, etc. | |
48 | (regexp "\\(K\\)?C\\(VS\\)?\\(VS\\)?A?M*v*")) | |
49 | (let ((case-fold-search nil)) | |
50 | (dolist (elt table) | |
51 | (setq regexp (replace-regexp-in-string (car elt) (cdr elt) | |
52 | regexp t t)))) | |
53 | regexp)) | |
54 | ||
d99ea08e | 55 | (let ((elt (list (vector burmese-composable-pattern 0 'font-shape-gstring) |
f88cc4d6 KH |
56 | (vector "." 0 'font-shape-gstring)))) |
57 | (set-char-table-range composition-function-table '(#x1000 . #x107F) elt) | |
58 | (set-char-table-range composition-function-table '(#xAA60 . #xAA7B) elt)) | |
ca92c5bc | 59 |