comparison lisp/language/cyril-util.el @ 207:e45d5e7c476e r20-4b2

Import from CVS: tag r20-4b2
author cvs
date Mon, 13 Aug 2007 10:03:52 +0200
parents
children
comparison
equal deleted inserted replaced
206:d3e9274cbc4e 207:e45d5e7c476e
1 ;;; cyril-util.el --- utilities for Cyrillic scripts
2
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
4
5 ;; Keywords: mule, multilingual, Cyrillic
6
7 ;; This file is part of XEmacs.
8
9 ;; XEmacs is free software; you can redistribute it and/or modify it
10 ;; under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
12 ;; any later version.
13
14 ;; XEmacs is distributed in the hope that it will be useful, but
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 ;; General Public License for more details.
18
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with XEmacs; see the file COPYING. If not, write to the Free
21 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 ;; 02111-1307, USA.
23
24 ;;; Code:
25
26 ;;;###autoload
27 (defun setup-cyrillic-iso-environment ()
28 "Setup multilingual environment (MULE) for Cyrillic ISO-8859-5 users."
29 (interactive)
30 (setup-8-bit-environment "Cyrillic-ISO" 'cyrillic-iso8859-5
31 'iso-8859-5 "cyrillic-yawerty"))
32
33 ;;;###autoload
34 (defun setup-cyrillic-koi8-environment ()
35 "Setup multilingual environment (MULE) for Cyrillic KOI8 users."
36 (interactive)
37 (setup-8-bit-environment "Cyrillic-KOI8" 'cyrillic-iso8859-5 'koi8-r
38 "cyrillic-yawerty"))
39
40 ;;;###autoload
41 (defun setup-cyrillic-alternativnyj-environment ()
42 "Setup multilingual environment (MULE) for Cyrillic ALTERNATIVNYJ users."
43 (interactive)
44 (setup-8-bit-environment "Cyrillic" 'cyrillic-iso8859-5
45 'alternativnyj "cyrillic-yawerty")
46 ;; (setq coding-category-raw-text 'alternativnyj)
47 )
48
49
50 ;; Display
51
52 ;; Written by Valery Alexeev <valery@math.uga.edu>.
53
54 (defvar cyrillic-language-alist
55 (list '("Belorussian") '("Bulgarian") '("Macedonian")
56 '("Russian") '("Serbian") '("Ukrainian"))
57 "*List of known cyrillic languages")
58
59 ;;;###autoload
60 (defun standard-display-cyrillic-translit (&optional cyrillic-language)
61 "Display a cyrillic buffer using a transliteration.
62 For readability, the table is slightly
63 different from the one used for the input method `cyrillic-translit'.
64
65 The argument is a string which specifies which language you are using;
66 that affects the choice of transliterations slightly.
67 Possible values are listed in 'cyrillic-language-alist'.
68 If the argument is t, we use the default cyrillic transliteration.
69 If the argument is nil, we return the display table to its standard state."
70 (interactive
71 (list
72 (let* ((completion-ignore-case t))
73 (completing-read
74 "Cyrillic language (default nil): "
75 cyrillic-language-alist nil t nil nil nil))))
76
77 (or standard-display-table
78 (setq standard-display-table (make-display-table)))
79
80 (if (equal cyrillic-language "")
81 (setq cyrillic-language nil))
82
83 (if (null cyrillic-language)
84 (setq standard-display-table (make-display-table))
85 (aset standard-display-table ?,LP(B [?a])
86 (aset standard-display-table ?,LQ(B [?b])
87 (aset standard-display-table ?,LR(B [?v])
88 (aset standard-display-table ?,LS(B [?g])
89 (aset standard-display-table ?,LT(B [?d])
90 (aset standard-display-table ?,LU(B [?e])
91 (aset standard-display-table ?,Lq(B [?y?o])
92 (aset standard-display-table ?,LV(B [?z?h])
93 (aset standard-display-table ?,LW(B [?z])
94 (aset standard-display-table ?,LX(B [?i])
95 (aset standard-display-table ?,LY(B [?j])
96 (aset standard-display-table ?,LZ(B [?k])
97 (aset standard-display-table ?,L[(B [?l])
98 (aset standard-display-table ?,L\(B [?m])
99 (aset standard-display-table ?,L](B [?n])
100 (aset standard-display-table ?,L^(B [?o])
101 (aset standard-display-table ?,L_(B [?p])
102 (aset standard-display-table ?,L`(B [?r])
103 (aset standard-display-table ?,La(B [?s])
104 (aset standard-display-table ?,Lb(B [?t])
105 (aset standard-display-table ?,Lc(B [?u])
106 (aset standard-display-table ?,Ld(B [?f])
107 (aset standard-display-table ?,Le(B [?k?h])
108 (aset standard-display-table ?,Lf(B [?t?s])
109 (aset standard-display-table ?,Lg(B [?c?h])
110 (aset standard-display-table ?,Lh(B [?s?h])
111 (aset standard-display-table ?,Li(B [?s?c?h])
112 (aset standard-display-table ?,Lj(B [?~])
113 (aset standard-display-table ?,Lk(B [?y])
114 (aset standard-display-table ?,Ll(B [?'])
115 (aset standard-display-table ?,Lm(B [?e?'])
116 (aset standard-display-table ?,Ln(B [?y?u])
117 (aset standard-display-table ?,Lo(B [?y?a])
118
119 (aset standard-display-table ?,L0(B [?A])
120 (aset standard-display-table ?,L1(B [?B])
121 (aset standard-display-table ?,L2(B [?V])
122 (aset standard-display-table ?,L3(B [?G])
123 (aset standard-display-table ?,L4(B [?D])
124 (aset standard-display-table ?,L5(B [?E])
125 (aset standard-display-table ?,L!(B [?Y?o])
126 (aset standard-display-table ?,L6(B [?Z?h])
127 (aset standard-display-table ?,L7(B [?Z])
128 (aset standard-display-table ?,L8(B [?I])
129 (aset standard-display-table ?,L9(B [?J])
130 (aset standard-display-table ?,L:(B [?K])
131 (aset standard-display-table ?,L;(B [?L])
132 (aset standard-display-table ?,L<(B [?M])
133 (aset standard-display-table ?,L=(B [?N])
134 (aset standard-display-table ?,L>(B [?O])
135 (aset standard-display-table ?,L?(B [?P])
136 (aset standard-display-table ?,L@(B [?R])
137 (aset standard-display-table ?,LA(B [?S])
138 (aset standard-display-table ?,LB(B [?T])
139 (aset standard-display-table ?,LC(B [?U])
140 (aset standard-display-table ?,LD(B [?F])
141 (aset standard-display-table ?,LE(B [?K?h])
142 (aset standard-display-table ?,LF(B [?T?s])
143 (aset standard-display-table ?,LG(B [?C?h])
144 (aset standard-display-table ?,LH(B [?S?h])
145 (aset standard-display-table ?,LI(B [?S?c?h])
146 (aset standard-display-table ?,LJ(B [?~])
147 (aset standard-display-table ?,LK(B [?Y])
148 (aset standard-display-table ?,LL(B [?'])
149 (aset standard-display-table ?,LM(B [?E?'])
150 (aset standard-display-table ?,LN(B [?Y?u])
151 (aset standard-display-table ?,LO(B [?Y?a])
152
153 (aset standard-display-table ?,Lt(B [?i?e])
154 (aset standard-display-table ?,Lw(B [?i])
155 (aset standard-display-table ?,L~(B [?u])
156 (aset standard-display-table ?,Lr(B [?d?j])
157 (aset standard-display-table ?,L{(B [?c?h?j])
158 (aset standard-display-table ?,Ls(B [?g?j])
159 (aset standard-display-table ?,Lu(B [?s])
160 (aset standard-display-table ?,L|(B [?k])
161 (aset standard-display-table ?,Lv(B [?i])
162 (aset standard-display-table ?,Lx(B [?j])
163 (aset standard-display-table ?,Ly(B [?l?j])
164 (aset standard-display-table ?,Lz(B [?n?j])
165 (aset standard-display-table ?,L(B [?d?z])
166
167 (aset standard-display-table ?,L$(B [?Y?e])
168 (aset standard-display-table ?,L'(B [?Y?i])
169 (aset standard-display-table ?,L.(B [?U])
170 (aset standard-display-table ?,L"(B [?D?j])
171 (aset standard-display-table ?,L+(B [?C?h?j])
172 (aset standard-display-table ?,L#(B [?G?j])
173 (aset standard-display-table ?,L%(B [?S])
174 (aset standard-display-table ?,L,(B [?K])
175 (aset standard-display-table ?,L&(B [?I])
176 (aset standard-display-table ?,L((B [?J])
177 (aset standard-display-table ?,L)(B [?L?j])
178 (aset standard-display-table ?,L*(B [?N?j])
179 (aset standard-display-table ?,L/(B [?D?j])
180
181 (when (equal cyrillic-language "Bulgarian")
182 (aset standard-display-table ?,Li(B [?s?h?t])
183 (aset standard-display-table ?,LI(B [?S?h?t])
184 (aset standard-display-table ?,Ln(B [?i?u])
185 (aset standard-display-table ?,LN(B [?I?u])
186 (aset standard-display-table ?,Lo(B [?i?a])
187 (aset standard-display-table ?,LO(B [?I?a]))
188
189 (when (equal cyrillic-language "Ukrainian") ; based on the official
190 ; transliteration table
191 (aset standard-display-table ?,LX(B [?y])
192 (aset standard-display-table ?,L8(B [?Y])
193 (aset standard-display-table ?,LY(B [?i])
194 (aset standard-display-table ?,L9(B [?Y])
195 (aset standard-display-table ?,Ln(B [?i?u])
196 (aset standard-display-table ?,Lo(B [?i?a]))))
197
198
199 ;;
200 (provide 'cyril-util)
201
202 ;;; cyril-util.el ends here
203
204 ;; Local Variables:
205 ;; buffer-file-coding-system: iso-2022-7bit
206 ;; End: