Commit | Line | Data |
---|---|---|
123f4a5e | 1 | ;;; lrt.el --- Quail package for inputting Lao characters by LRT method -*-coding: iso-2022-7bit;-*- |
24b31c88 | 2 | |
89115082 | 3 | ;; Copyright (C) 1998, 2006 Free Software Foundation, Inc. |
7976eda0 | 4 | ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 |
698218a2 KH |
5 | ;; National Institute of Advanced Industrial Science and Technology (AIST) |
6 | ;; Registration Number H14PRO021 | |
24b31c88 KH |
7 | |
8 | ;; Keywords: multilingual, input method, Lao, LRT. | |
9 | ||
10 | ;; This file is part of GNU Emacs. | |
11 | ||
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 2, or (at your option) | |
15 | ;; any later version. | |
16 | ||
17 | ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | ;; GNU General Public License for more details. | |
21 | ||
22 | ;; You should have received a copy of the GNU General Public License | |
23 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
364c38d3 LK |
24 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
25 | ;; Boston, MA 02110-1301, USA. | |
24b31c88 | 26 | |
be567141 PJ |
27 | ;;; Commentary: |
28 | ||
24b31c88 KH |
29 | ;;; Code: |
30 | ||
31 | (require 'quail) | |
32 | (require 'lao-util) | |
33 | ||
34 | ;; LRT (Lao Roman Transcription) input method accepts the following | |
35 | ;; key sequence: | |
36 | ;; consonant [+ semi-vowel-sign-lo ] + vowel [+ maa-sakod ] [+ tone-mark ] | |
37 | ||
653b6bad KH |
38 | (defun quail-lao-update-translation (control-flag) |
39 | (if (integerp control-flag) | |
40 | ;; Non-composable character typed. | |
41 | (setq quail-current-str | |
42 | (buffer-substring (overlay-start quail-overlay) | |
43 | (overlay-end quail-overlay)) | |
44 | unread-command-events | |
45 | (string-to-list | |
46 | (substring quail-current-key control-flag))) | |
47 | (let ((lao-str (lao-transcribe-roman-to-lao-string quail-current-key))) | |
48 | (if (> (aref lao-str 0) 255) | |
49 | (setq quail-current-str lao-str) | |
50 | (or quail-current-str | |
51 | (setq quail-current-str quail-current-key))))) | |
52 | control-flag) | |
24b31c88 | 53 | |
24b31c88 KH |
54 | |
55 | (quail-define-package | |
f89752e9 | 56 | "lao-lrt" "Lao" "\e(1E\e(BR" t |
5d0c3ab6 KH |
57 | "Lao input method using LRT (Lao Roman Transcription). |
58 | `\\' (backslash) + number-key => \e(1p\e(B,\e(1q\e(B,\e(1r\e(B,... LAO DIGIT ZERO, ONE, TWO, ... | |
59 | `\\' (backslash) + `\\' => \e(1f\e(B LAO KO LA (REPETITION) | |
60 | `\\' (backslash) + `$' => \e(1O\e(B LAO ELLIPSIS | |
61 | " | |
653b6bad KH |
62 | nil 'forget-last-selection 'deterministic 'kbd-translate 'show-layout |
63 | nil nil nil 'quail-lao-update-translation nil t) | |
f89752e9 | 64 | |
653b6bad KH |
65 | ;; LRT (Lao Roman Transcription) input method accepts the following |
66 | ;; key sequence: | |
67 | ;; consonant [ semi-vowel-sign-lo ] vowel [ maa-sakod ] [ tone-mark ] | |
68 | ||
69 | (quail-install-map | |
70 | (quail-map-from-table | |
71 | '((base-state (lao-transcription-consonant-alist . sv-state) | |
72 | lao-transcription-vowel-alist | |
73 | lao-transcription-tone-alist) | |
177c0ea7 | 74 | (sv-state (lao-transcription-semi-vowel-alist . v-state) |
653b6bad KH |
75 | (lao-transcription-vowel-alist . mt-state)) |
76 | (v-state (lao-transcription-vowel-alist . mt-state)) | |
177c0ea7 | 77 | (mt-state (lao-transcription-maa-sakod-alist . t-state) |
653b6bad KH |
78 | lao-transcription-tone-alist) |
79 | (t-state lao-transcription-tone-alist)))) | |
f89752e9 | 80 | |
ab5796a9 | 81 | ;;; arch-tag: f65e4038-e187-4906-997b-d2de7ed813d2 |
be567141 | 82 | ;;; lrt.el ends here |