annotate leim/quail/indian.el @ 41980:e0aefc6e3422

(Frecenter): Simplify computation in the case of window system frames and ARG < 0; use window_box_height.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 12 Dec 2001 13:43:16 +0000
parents 93957ea66b86
children 69c2ba4ebc59
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
41464
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 ;; quail/indian.el -- Quail packages for inputting Indian
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3 ;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 ;; Author: KAWABATA, Taichi <kawabata@m17n.org>
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 ;; Keywords: multilingual, input method, Indian, Devanagari
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 ;; any later version.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 ;; GNU General Public License for more details.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26 ;;; Commentary:
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;; History:
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 ;; 2000.12.12
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 ;; Totally re-written from devanagari.el to handle multiple Inidan Scripts.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;;; Code:
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 (require 'cl)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 (require 'quail)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 (require 'devan-util)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 (require 'ind-util)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40 (defun quail-indian-preceding-char-position (position)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 "Return the position of preceding composite character."
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 (let (prec-composed)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43 (if (char-valid-p (char-before position)) ;; range o.k.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 (if (setq prec-composed (find-composition (1- position)))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 (car prec-composed)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46 (1- position))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47 nil)))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 (defvar quail-indian-update-preceding-char nil)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 (make-variable-frame-local 'quail-indian-update-preceding-char)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 ;;; update function
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 ;; CONTROL-FLAG is integer (n)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 ;; quail-current-key :: keyboard input.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 ;; Only first n can be translated.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57 ;; quail-current-string :: corresonding string. Translated when last
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58 ;; time CONTROL-FLAG is nil.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 ;; todo :: (1) put last (len-n) char to unrread-command-event.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 ;; (2) put translated string to quail-current-string.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 ;;
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 ;; CONTROL-FLAG is t (terminate) or nil (proceed the translation)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 ;; quail-current-key :: keyboard input.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 ;; quail-current-string :: corresponding string. Created by database.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 ;; todo :: (1) put modified translated string to quail-current-string.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 (defun quail-indian-update-translation (control-flag)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 ;;(message "input control-flag=%s, string=%s, key=%s"
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 ;; control-flag quail-current-str quail-current-key)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 ;; make quail-current-str string when possible.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 (if (char-valid-p quail-current-str)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 (setq quail-current-str (char-to-string quail-current-str)))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 ;; reset quail-indian-update-preceding-char if it's initial.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 (if (= (overlay-start quail-overlay) (overlay-end quail-overlay))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 (setq quail-indian-update-preceding-char nil))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 ;; set quial-indian-update-preceding-char if appropriate.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 (let* (prec-char-position composition-regexp
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 prec-char-str candidate-str match-pos match-end)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 (when (and quail-current-str
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 (null input-method-use-echo-area)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 (null input-method-exit-on-first-char)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 (setq prec-char-position
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 (quail-indian-preceding-char-position
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 (overlay-start quail-overlay)))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 (setq composition-regexp
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 (if prec-char-position
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87 (caar (elt composition-function-table
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 (char-after prec-char-position)))))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 ;; (null quail-indian-update-preceding-char)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 (setq prec-char-str
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 (buffer-substring prec-char-position
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92 (overlay-start quail-overlay))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 candidate-str (concat prec-char-str quail-current-str)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 match-pos (string-match composition-regexp candidate-str)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 match-end (match-end 0))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 (> match-end (length prec-char-str)))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 (setq quail-indian-update-preceding-char prec-char-str)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 (delete-region prec-char-position
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 (overlay-start quail-overlay))))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 ;; make quail-current-str string when possible.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 (if (null quail-current-str)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 (setq quail-current-str ""))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 ;; set quail-current-str unless control-flag is number.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104 (if (numberp control-flag)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 (setq quail-indian-update-preceding-char nil
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 quail-current-str
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 (if (equal quail-current-str "")
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 (substring quail-current-key 0 control-flag)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109 (indian-compose-string quail-current-str))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110 unread-command-events
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 (string-to-list
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 (substring quail-current-key control-flag)))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 (if quail-indian-update-preceding-char
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 (setq quail-current-str
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 (concat quail-indian-update-preceding-char
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116 quail-current-str)))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117 (setq quail-current-str
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 (indian-compose-string quail-current-str)))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 (when (eq t control-flag)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 ;; reset preceding-char if translation is terminated.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 (setq quail-indian-update-preceding-char nil))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 ;; compose to previous char if it looks possible.
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 ;;(message " out control-flag=%s, string=%s, key=%s"
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 ;; control-flag quail-current-str quail-current-key)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 control-flag)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 ;;;
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 ;;; Input by transliteration
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129 ;;;
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 (defun quail-define-indian-trans-package (hashtbls pkgname
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 lang title doc)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 (funcall 'quail-define-package pkgname lang title t doc
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 nil nil nil nil nil nil t nil
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 'quail-indian-update-translation)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 (maphash
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 '(lambda (key val)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 (quail-defrule key (if (= (length val) 1)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 (string-to-char val)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140 (vector val))))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 (cdr hashtbls)))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143 ;;
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145 ;; (quail-define-package "devanagari-itrans" "Devanagari" "DevIT" t "Devanagari ITRANS")
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 (quail-define-indian-trans-package
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 indian-dev-itrans-v5-hash "devanagari-itrans" "Devanagari" "DevIT"
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148 "Devanagari transliteration by ITRANS method.")
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 ;; (quail-define-package "devanagari-kyoto-harvard" "Devanagari" "DevKH" t "Devanagari Kyoto-Harvard")
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151 (quail-define-indian-trans-package
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 indian-dev-kyoto-harvard-hash
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 "devanagari-kyoto-harvard" "Devanagari" "DevKH"
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154 "Devanagari transliteration by Kyoto-Harvard method.")
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 ;; (quail-define-package "devanagari-aiba" "Devanagari" "DevAB" t "Devanagari Aiba")
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 (quail-define-indian-trans-package
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 indian-dev-aiba-hash "devanagari-aiba" "Devanagari" "DevAB"
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 "Devanagari transliteration by Aiba-method.")
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 ;;;
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 ;;; Input by Inscript
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 ;;;
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 (defun flatten-list (lst)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 "Flatten the nested LIST so that there would be no innner list."
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 (if (listp lst)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 (apply 'append (mapcar 'flatten-list lst))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 (list lst)))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171 (defun quail-define-inscript-package (char-table key-table pkgname lang title
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 docstring)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173 (setq char-table (flatten-list char-table))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174 (setq key-table (flatten-list key-table))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
175 (funcall 'quail-define-package pkgname lang title nil docstring
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176 nil nil nil nil nil nil nil nil
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177 'quail-indian-update-translation
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
178 )
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179 (mapcar*
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180 '(lambda (key val)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 (and key val
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182 (quail-defrule
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183 (if (char-valid-p key) (char-to-string key) key)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 (if (stringp val) (vector val) val))))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185 key-table char-table))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187 ;;
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 (defvar inscript-dev-keytable
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190 '(
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 (;; VOWELS (18)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 (?D nil) (?E ?e) (?F ?f) (?R ?r) (?G ?g) (?T ?t)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193 (?+ ?=) ("F]" "f]") (?! ?@) (?Z ?z) (?S ?s) (?W ?w)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194 (?| ?\\) (?~ ?`) (?A ?a) (?Q ?q) ("+]" "=]") ("R]" "r]"))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 (;; CONSONANTS (42)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 ?k ?K ?i ?I ?U ;; GRUTTALS
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197 ?\; ?: ?p ?P ?} ;; PALATALS
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
198 ?' ?\" ?\[ ?{ ?C ;; CEREBRALS
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
199 ?l ?L ?o ?O ?v ?V ;; DENTALS
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200 ?h ?H ?y ?Y ?c ;; LABIALS
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201 ?/ ?j ?J ?n ?N "N]" ?b ;; SEMIVOWELS
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202 ?M ?< ?m ?u ;; SIBILANTS
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 "k]" "K]" "i]" "p]" "[]" "{]" "H]" "/]" ;; NUKTAS
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 ?% ?&)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205 (;; Misc Symbols (7)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206 ?X ?x ?_ ">]" ?d "X]" ?>)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 (;; Digits
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208 ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9)
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209 (;; Inscripts
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 ?# ?$ ?^ ?* ?\])))
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 ;; (quail-define-package "devanagari-inscript" "Devanagari" "DevIS" t "Devanagari keyboard Inscript")
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 (quail-define-inscript-package
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 indian-dev-base-table inscript-dev-keytable
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215 "devanagari-inscript" "Devanagari" "DevIS"
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216 "Devanagari keyboard Inscript.")
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217
93957ea66b86 Renamed from devanagari.el, and completely re-written.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 ;; quail/indian.el ends here.