aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2005-03-16 11:44:14 +0000
committerKenichi Handa2005-03-16 11:44:14 +0000
commit9017ac97cd64cd9886e686152db5dd874560a4dd (patch)
treefbca88c0b58db1cbd9a6b2113f62f3ad344fce83
parentd7fb7b9121faed24d57fcd6b28056d8dc71953d7 (diff)
downloademacs-9017ac97cd64cd9886e686152db5dd874560a4dd.tar.gz
emacs-9017ac97cd64cd9886e686152db5dd874560a4dd.zip
Encoding changed to utf-8-emacs. All
transliteration functions rewritten to use robin.el. (ethio-fidel-to-sera-map, ethio-fidel-to-tex-map) (ethio-sera-to-fidel-table, ethio-implicit-period-conversion) (ethio-prefer-ascii-punctuation): Deleted variables. (ethio-char-to-ethiocode, ethio-convert-digit) (ethio-ethiocode-to-char, ethio-fidel-to-sera-mail) (ethio-fidel-to-sera-mail-or-marker, ethio-lone-consonant-p) (ethio-sera-to-fidel-english, ethio-sera-to-fidel-ethio) (ethio-sera-to-fidel-mail, ethio-sera-to-fidel-mail-or-marker) (ethio-tilde-escape, ethio-toggle-punctuation): Deleted functions. (ethio-adjust-robin, ethio-composition-function) (ethio-get-consonant, ethio-prefer-amharic, ethio-process-digits) (ethio-sera-to-fidel-region-ethio) (ethio-sera-to-fidel-region-noethio) (ethio-use-colon-for-colon, ethio-use-three-dot-question): New functions.
-rw-r--r--lisp/language/ethio-util.el2839
1 files changed, 1421 insertions, 1418 deletions
diff --git a/lisp/language/ethio-util.el b/lisp/language/ethio-util.el
index 5a81f59f9dc..fb920e8f4e8 100644
--- a/lisp/language/ethio-util.el
+++ b/lisp/language/ethio-util.el
@@ -1,7 +1,10 @@
1;;; ethio-util.el --- utilities for Ethiopic -*- coding: iso-2022-7bit; -*- 1;;; ethio-util.el --- utilities for Ethiopic -*- coding: utf-8-emacs; -*-
2 2
3;; Copyright (C) 1997, 2001 Electrotechnical Laboratory, JAPAN. 3;; Copyright (C) 1997, 2001 Electrotechnical Laboratory, JAPAN.
4;; Licensed to the Free Software Foundation. 4;; Licensed to the Free Software Foundation.
5;; Copyright (C) 2005
6;; National Institute of Advanced Industrial Science and Technology (AIST)
7;; Registration Number: H15PRO 110
5 8
6;; Keywords: mule, multilingual, Ethiopic 9;; Keywords: mule, multilingual, Ethiopic
7 10
@@ -28,6 +31,8 @@
28 31
29;;; Code: 32;;; Code:
30 33
34(require 'robin)
35
31;; Information for exiting Ethiopic environment. 36;; Information for exiting Ethiopic environment.
32(defvar exit-ethiopic-environment-data nil) 37(defvar exit-ethiopic-environment-data nil)
33 38
@@ -35,36 +40,17 @@
35(defun setup-ethiopic-environment-internal () 40(defun setup-ethiopic-environment-internal ()
36 (let ((key-bindings '((" " . ethio-insert-space) 41 (let ((key-bindings '((" " . ethio-insert-space)
37 ([?\S- ] . ethio-insert-ethio-space) 42 ([?\S- ] . ethio-insert-ethio-space)
38 ([?\C-'] . ethio-gemination) 43 ;; ([?\C-'] . ethio-gemination)
39
40 ;; these old bindings conflict
41 ;; with Emacs' binding policy
42
43 ;; ([f2] . ethio-toggle-space)
44 ;; ([S-f2] . ethio-replace-space) ; as requested
45 ;; ([f3] . ethio-toggle-punctuation)
46 ;; ([f4] . ethio-sera-to-fidel-buffer)
47 ;; ([S-f4] . ethio-sera-to-fidel-region)
48 ;; ([C-f4] . ethio-sera-to-fidel-mail-or-marker)
49 ;; ([f5] . ethio-fidel-to-sera-buffer)
50 ;; ([S-f5] . ethio-fidel-to-sera-region)
51 ;; ([C-f5] . ethio-fidel-to-sera-mail-or-marker)
52 ;; ([f6] . ethio-modify-vowel)
53 ;; ([f7] . ethio-replace-space)
54 ;; ([f8] . ethio-input-special-character)
55
56 ;; this is the rewritten bindings
57
58 ([f3] . ethio-fidel-to-sera-buffer) 44 ([f3] . ethio-fidel-to-sera-buffer)
59 ([S-f3] . ethio-fidel-to-sera-region) 45 ([S-f3] . ethio-fidel-to-sera-region)
60 ([C-f3] . ethio-fidel-to-sera-mail-or-marker) 46 ([C-f3] . ethio-fidel-to-sera-marker)
61 ([f4] . ethio-sera-to-fidel-buffer) 47 ([f4] . ethio-sera-to-fidel-buffer)
62 ([S-f4] . ethio-sera-to-fidel-region) 48 ([S-f4] . ethio-sera-to-fidel-region)
63 ([C-f4] . ethio-sera-to-fidel-mail-or-marker) 49 ([C-f4] . ethio-sera-to-fidel-marker)
64 ([S-f5] . ethio-toggle-punctuation) 50 ([S-f5] . ethio-toggle-punctuation)
65 ([S-f6] . ethio-modify-vowel) 51 ([S-f6] . ethio-modify-vowel)
66 ([S-f7] . ethio-replace-space) 52 ([S-f7] . ethio-replace-space)
67 ([S-f8] . ethio-input-special-character) 53 ;; ([S-f8] . ethio-input-special-character) ; deprecated
68 ([C-f9] . ethio-toggle-space) 54 ([C-f9] . ethio-toggle-space)
69 ([S-f9] . ethio-replace-space) ; as requested 55 ([S-f9] . ethio-replace-space) ; as requested
70 )) 56 ))
@@ -77,7 +63,6 @@
77 (global-set-key kb (cdr (car key-bindings))) 63 (global-set-key kb (cdr (car key-bindings)))
78 (setq key-bindings (cdr key-bindings)))) 64 (setq key-bindings (cdr key-bindings))))
79 65
80 (add-hook 'quail-activate-hook 'ethio-select-a-translation)
81 (add-hook 'find-file-hook 'ethio-find-file) 66 (add-hook 'find-file-hook 'ethio-find-file)
82 (add-hook 'write-file-functions 'ethio-write-file) 67 (add-hook 'write-file-functions 'ethio-write-file)
83 (add-hook 'after-save-hook 'ethio-find-file)) 68 (add-hook 'after-save-hook 'ethio-find-file))
@@ -90,7 +75,6 @@
90 (setq exit-ethiopic-environment-data 75 (setq exit-ethiopic-environment-data
91 (cdr exit-ethiopic-environment-data))) 76 (cdr exit-ethiopic-environment-data)))
92 77
93 (remove-hook 'quail-activate-hook 'ethio-select-a-translation)
94 (remove-hook 'find-file-hook 'ethio-find-file) 78 (remove-hook 'find-file-hook 'ethio-find-file)
95 (remove-hook 'write-file-functions 'ethio-write-file) 79 (remove-hook 'write-file-functions 'ethio-write-file)
96 (remove-hook 'after-save-hook 'ethio-find-file)) 80 (remove-hook 'after-save-hook 'ethio-find-file))
@@ -108,15 +92,6 @@
108;; 92;;
109;; If the filename ends in ".tex", editing is done in fidel 93;; If the filename ends in ".tex", editing is done in fidel
110;; but file I/O is done in EthioTeX format. 94;; but file I/O is done in EthioTeX format.
111;;
112;; To automatically convert Ethiopic text to SERA format when sending mail,
113;; (add-hook 'mail-send-hook 'ethio-fidel-to-sera-mail)
114;;
115;; To automatically convert SERA format to Ethiopic when receiving mail,
116;; (add-hook 'rmail-show-message-hook 'ethio-sera-to-fidel-mail)
117;;
118;; To automatically convert Ethiopic text to SERA format when posting news,
119;; (add-hook 'news-inews-hook 'ethio-fidel-to-sera-mail)
120 95
121;; 96;;
122;; users' preference 97;; users' preference
@@ -143,7 +118,7 @@ mark. All SERA <--> FIDEL converters refer this variable.")
143 118
144(defvar ethio-quote-vowel-always nil 119(defvar ethio-quote-vowel-always nil
145 "*Non-nil means always put an apostrophe before an isolated vowel (except at word initial) in FIDEL --> SERA conversion. 120 "*Non-nil means always put an apostrophe before an isolated vowel (except at word initial) in FIDEL --> SERA conversion.
146If nil, put an apostrophe only between a sixth-form consonant and an 121If nil, put an apostrophe only between a 6th-form consonant and an
147isolated vowel.") 122isolated vowel.")
148 123
149(defvar ethio-W-sixth-always nil 124(defvar ethio-W-sixth-always nil
@@ -157,311 +132,98 @@ For example, ({10}{9}{100}{80}{7}) is converted into:
157 `109100807 if `ethio-numeric-reduction' is 1, 132 `109100807 if `ethio-numeric-reduction' is 1,
158 `10900807 if `ethio-numeric-reduction' is 2.") 133 `10900807 if `ethio-numeric-reduction' is 2.")
159 134
160(defvar ethio-implicit-period-conversion t
161 "*Non-nil means replacing the Ethiopic dot at the end of an Ethiopic sentence
162with an Ethiopic full stop.")
163
164(defvar ethio-java-save-lowercase nil 135(defvar ethio-java-save-lowercase nil
165 "*Non-nil means save Ethiopic characters in lowercase hex numbers to Java files. 136 "*Non-nil means save Ethiopic characters in lowercase hex numbers to Java files.
166If nil, use uppercases.") 137If nil, use uppercases.")
167 138
139(defun ethio-prefer-amharic-p ()
140 (or (eq ethio-primary-language 'amharic)
141 (and (not (eq ethio-primary-language 'tigrigna))
142 (eq ethio-secondary-language 'amharic))))
143
144(defun ethio-prefer-amharic (arg)
145 (if arg
146 (progn
147 (robin-modify-package "ethiopic-sera" "'a" ?አ)
148 (robin-modify-package "ethiopic-sera" "a" "አ")
149 (robin-modify-package "ethiopic-sera" "'A" ?ኣ)
150 (robin-modify-package "ethiopic-sera" "A" "ኣ"))
151 (robin-modify-package "ethiopic-sera" "'A" ?አ)
152 (robin-modify-package "ethiopic-sera" "A" "አ")
153 (robin-modify-package "ethiopic-sera" "'a" ?ኣ)
154 (robin-modify-package "ethiopic-sera" "a" "ኣ")))
155
156(defun ethio-use-colon-for-colon (arg)
157 (if arg
158 (progn
159 (robin-modify-package "ethiopic-sera" ":" ?፥)
160 (robin-modify-package "ethiopic-sera" "`:" ?፡))
161 (robin-modify-package "ethiopic-sera" " : " ?፡)
162 (robin-modify-package "ethiopic-sera" ":" "፡")
163 (robin-modify-package "ethiopic-sera" "-:" ?፥)))
164
165(defun ethio-use-three-dot-question (arg)
166 (if arg
167 (progn
168 (robin-modify-package "ethiopic-sera" "?" ?፧)
169 (robin-modify-package "ethiopic-sera" "`?" ??))
170 (robin-modify-package "ethiopic-sera" "?" ??)
171 (robin-modify-package "ethiopic-sera" "`?" ?፧)))
172
173(defun ethio-adjust-robin ()
174 (ethio-prefer-amharic (ethio-prefer-amharic-p))
175 (ethio-use-colon-for-colon ethio-use-colon-for-colon)
176 (ethio-use-three-dot-question ethio-use-three-dot-question))
177
178(add-hook 'robin-activate-hook 'ethio-adjust-robin)
179
168;; 180;;
169;; SERA to FIDEL 181;; SERA to FIDEL
170;; 182;;
171 183
172(defconst ethio-sera-to-fidel-table
173 [
174 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
175 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
176;;; SP
177 (" "
178 (?: (if ethio-use-colon-for-colon " $(3$l(B" "$(3$h(B")
179 (32 (if ethio-use-colon-for-colon " $(3$l(B " "$(3$h(B"))
180 (?- " $(3$m(B")
181 (?: " $(3$i(B")
182 (?| (if ethio-use-colon-for-colon " $(3$l(B|" " $(3$h(B|")
183 (?: " $(3$o(B"))))
184
185;;; ! " # $ % & '
186 nil nil nil nil nil nil ("" (?' "$(3%s(B"))
187;;; ( ) * + , - .
188 nil nil nil nil ("$(3$j(B") ("-" (?: "$(3$l(B")) ("$(3%u(B")
189;;; / 0 1 2 3 4 5 6 7 8 9
190 nil nil nil nil nil nil nil nil nil nil nil
191;;; :
192 ((if ethio-use-colon-for-colon "$(3$l(B" "$(3$h(B")
193 (32 (if ethio-use-colon-for-colon "$(3$l(B " "$(3$h(B"))
194 (?- "$(3$m(B")
195 (?: "$(3$i(B")
196 (?| (if ethio-use-colon-for-colon "$(3$l(B|" "$(3$h(B|")
197 (?: "$(3$o(B")))
198;;; ; < = >
199 ("$(3$k(B") ("<" (?< "$(3%v(B")) nil (">" (?> "$(3%w(B"))
200;;; ?
201 ((if ethio-use-three-dot-question "$(3$n(B" "$(3%x(B"))
202;;; @
203 nil
204;;; A
205 ("$(3"f(B" (?2 "$(3#8(B"))
206;;; B
207 ("$(3"((B" (?e "$(3"#(B") (?u "$(3"$(B") (?i "$(3"%(B") (?a "$(3"&(B") (?E "$(3"'(B") (?o "$(3")(B")
208 (?W "$(3%b(B" (?e "$(3%2(B") (?u "$(3%b(B") (?i "$(3%B(B") (?a "$(3"*(B") (?E "$(3%R(B")))
209;;; C
210 ("$(3$4(B" (?e "$(3$/(B") (?u "$(3$0(B") (?i "$(3$1(B") (?a "$(3$2(B") (?E "$(3$3(B") (?o "$(3$5(B")
211 (?W "$(3$6(B" (?a "$(3$6(B")
212 (?e "$(3$4%n(B") (?u "$(3$4%r(B") (?i "$(3$4%o(B") (?E "$(3$4%q(B")))
213;;; D
214 ("$(3#b(B" (?e "$(3#](B") (?u "$(3#^(B") (?i "$(3#_(B") (?a "$(3#`(B") (?E "$(3#a(B") (?o "$(3#c(B")
215 (?W "$(3#d(B" (?a "$(3#d(B")
216 (?e "$(3#b%n(B") (?u "$(3#b%r(B") (?i "$(3#b%o(B") (?E "$(3#b%q(B")))
217;;; E
218 ("$(3"g(B" (?2 "$(3#9(B"))
219;;; F
220 ("$(3$T(B" (?e "$(3$O(B") (?u "$(3$P(B") (?i "$(3$Q(B") (?a "$(3$R(B") (?E "$(3$S(B") (?o "$(3$U(B")
221 (?W "$(3%d(B" (?e "$(3%4(B") (?u "$(3%d(B") (?i "$(3%D(B") (?a "$(3$V(B") (?E "$(3%T(B"))
222 (?Y "$(3$a(B" (?a "$(3$a(B")))
223;;; G
224 ("$(3$$(B" (?e "$(3#}(B") (?u "$(3#~(B") (?i "$(3$!(B") (?a "$(3$"(B") (?E "$(3$#(B") (?o "$(3$%(B")
225 (?W "$(3%c(B" (?e "$(3%3(B") (?u "$(3%c(B") (?i "$(3%C(B") (?a "$(3$&(B") (?E "$(3%S(B")))
226;;; H
227 ("$(3!6(B" (?e "$(3!1(B") (?u "$(3!2(B") (?i "$(3!3(B") (?a "$(3!4(B") (?E "$(3!5(B") (?o "$(3!7(B")
228 (?W "$(3!8(B" (?a "$(3!8(B")
229 (?e "$(3!6%n(B") (?u "$(3!6%r(B") (?i "$(3!6%o(B") (?E "$(3!6%q(B")))
230;;; I
231 ("$(3"h(B" (?2 "$(3#:(B"))
232;;; J
233 ("$(3#j(B" (?e "$(3#e(B") (?u "$(3#f(B") (?i "$(3#g(B") (?a "$(3#h(B") (?E "$(3#i(B") (?o "$(3#k(B")
234 (?W "$(3#l(B" (?a "$(3#l(B")
235 (?e "$(3#j%n(B") (?u "$(3#j%r(B") (?i "$(3#j%o(B") (?E "$(3#j%q(B")))
236;;; K
237 ("$(3#"(B" (?e "$(3"{(B") (?u "$(3"|(B") (?i "$(3"}(B") (?a "$(3"~(B") (?E "$(3#!(B") (?o "$(3##(B")
238 (?W "$(3#*(B" (?e "$(3#%(B") (?u "$(3#*(B") (?i "$(3#'(B") (?a "$(3#((B") (?E "$(3#)(B")))
239;;; L
240 ("$(3!.(B" (?e "$(3!)(B") (?u "$(3!*(B") (?i "$(3!+(B") (?a "$(3!,(B") (?E "$(3!-(B") (?o "$(3!/(B")
241 (?W "$(3!0(B" (?a "$(3!0(B")
242 (?e "$(3!.%n(B") (?u "$(3!.%r(B") (?i "$(3!.%o(B") (?E "$(3!.%q(B")))
243;;; M
244 ("$(3!>(B" (?e "$(3!9(B") (?u "$(3!:(B") (?i "$(3!;(B") (?a "$(3!<(B") (?E "$(3!=(B") (?o "$(3!?(B")
245 (?W "$(3%a(B" (?e "$(3%1(B") (?u "$(3%a(B") (?i "$(3%A(B") (?a "$(3!@(B") (?E "$(3%Q(B"))
246 (?Y "$(3$_(B" (?a "$(3$_(B")))
247;;; N
248 ("$(3"`(B" (?e "$(3"[(B") (?u "$(3"\(B") (?i "$(3"](B") (?a "$(3"^(B") (?E "$(3"_(B") (?o "$(3"a(B")
249 (?W "$(3"b(B" (?a "$(3"b(B")
250 (?e "$(3"`%n(B") (?u "$(3"`%r(B") (?i "$(3"`%o(B") (?E "$(3"`%q(B")))
251;;; O
252 ("$(3"i(B" (?2 "$(3#;(B"))
253;;; P
254 ("$(3$<(B" (?e "$(3$7(B") (?u "$(3$8(B") (?i "$(3$9(B") (?a "$(3$:(B") (?E "$(3$;(B") (?o "$(3$=(B")
255 (?W "$(3$>(B" (?a "$(3$>(B")
256 (?e "$(3$<%n(B") (?u "$(3$<%r(B") (?i "$(3$<%o(B") (?E "$(3$<%q(B")))
257;;; Q
258 ("$(3!v(B" (?e "$(3!q(B") (?u "$(3!r(B") (?i "$(3!s(B") (?a "$(3!t(B") (?E "$(3!u(B") (?o "$(3!w(B")
259 (?W "$(3!~(B" (?e "$(3!y(B") (?u "$(3!~(B") (?i "$(3!{(B") (?a "$(3!|(B") (?E "$(3!}(B")))
260;;; R
261 ("$(3!N(B" (?e "$(3!I(B") (?u "$(3!J(B") (?i "$(3!K(B") (?a "$(3!L(B") (?E "$(3!M(B") (?o "$(3!O(B")
262 (?W "$(3!P(B" (?a "$(3!P(B")
263 (?e "$(3!N%n(B") (?u "$(3!N%r(B") (?i "$(3!N%o(B") (?E "$(3!N%q(B"))
264 (?Y "$(3$`(B" (?a "$(3$`(B")))
265;;; S
266 ("$(3$D(B" (?e "$(3$?(B") (?u "$(3$@(B") (?i "$(3$A(B") (?a "$(3$B(B") (?E "$(3$C(B") (?o "$(3$E(B")
267 (?W "$(3$F(B" (?a "$(3$F(B")
268 (?e "$(3$D%n(B") (?u "$(3$D%r(B") (?i "$(3$D%o(B") (?E "$(3$D%q(B"))
269 (?2 "$(3$L(B"
270 (?e "$(3$G(B") (?u "$(3$H(B") (?i "$(3$I(B") (?a "$(3$J(B") (?E "$(3$K(B") (?o "$(3$M(B")
271 (?W "$(3$F(B" (?a "$(3$F(B")
272 (?e "$(3$L%n(B") (?u "$(3$L%r(B") (?i "$(3$L%o(B") (?E "$(3$L%q(B"))))
273;;; T
274 ("$(3$,(B" (?e "$(3$'(B") (?u "$(3$((B") (?i "$(3$)(B") (?a "$(3$*(B") (?E "$(3$+(B") (?o "$(3$-(B")
275 (?W "$(3$.(B" (?a "$(3$.(B")
276 (?e "$(3$,%n(B") (?u "$(3$,%r(B") (?i "$(3$,%o(B") (?E "$(3$,%q(B")))
277;;; U
278 ("$(3"d(B" (?2 "$(3#6(B"))
279;;; V
280 ("$(3"0(B" (?e "$(3"+(B") (?u "$(3",(B") (?i "$(3"-(B") (?a "$(3".(B") (?E "$(3"/(B") (?o "$(3"1(B")
281 (?W "$(3"2(B" (?a "$(3"2(B")
282 (?e "$(3"0%n(B") (?u "$(3"0%r(B") (?i "$(3"0%o(B") (?E "$(3"0%q(B")))
283;;; W
284 ("$(3%r(B" (?e "$(3%n(B") (?u "$(3%r(B") (?i "$(3%o(B") (?a "$(3%p(B") (?E "$(3%q(B"))
285;;; X
286 ("$(3%N(B" (?e "$(3%I(B") (?u "$(3%J(B") (?i "$(3%K(B") (?a "$(3%L(B") (?E "$(3%M(B") (?o "$(3%O(B"))
287;;; Y
288 ("$(3#R(B" (?e "$(3#M(B") (?u "$(3#N(B") (?i "$(3#O(B") (?a "$(3#P(B") (?E "$(3#Q(B") (?o "$(3#S(B")
289 (?W "$(3#T(B" (?a "$(3#T(B")
290 (?e "$(3#R%n(B") (?u "$(3#R%r(B") (?i "$(3#R%o(B") (?E "$(3#R%q(B")))
291;;; Z
292 ("$(3#J(B" (?e "$(3#E(B") (?u "$(3#F(B") (?i "$(3#G(B") (?a "$(3#H(B") (?E "$(3#I(B") (?o "$(3#K(B")
293 (?W "$(3#L(B" (?a "$(3#L(B")
294 (?e "$(3#J%n(B") (?u "$(3#J%r(B") (?i "$(3#J%o(B") (?E "$(3#J%q(B")))
295;;; [ \ ] ^ _
296 nil nil nil nil nil
297;;; `
298 (""
299 (?: "$(3$h(B")
300 (?? (if ethio-use-three-dot-question "$(3%x(B" "$(3$n(B"))
301 (?! "$(3%t(B")
302 (?e "$(3#5(B") (?u "$(3#6(B") (?U "$(3#6(B") (?i "$(3#7(B") (?a "$(3#8(B") (?A "$(3#8(B")
303 (?E "$(3#9(B") (?I "$(3#:(B") (?o "$(3#;(B") (?O "$(3#;(B")
304 (?g "$(3%^(B"
305 (?e "$(3%Y(B") (?u "$(3%Z(B") (?i "$(3%[(B") (?a "$(3%\(B") (?E "$(3%](B") (?o "$(3%_(B"))
306 (?h "$(3"H(B"
307 (?e "$(3"C(B") (?u "$(3"D(B") (?i "$(3"E(B") (?a "$(3"F(B") (?E "$(3"G(B") (?o "$(3"I(B")
308 (?W "$(3"P(B" (?e "$(3"K(B") (?u "$(3"P(B") (?i "$(3"M(B") (?a "$(3"N(B") (?E "$(3"O(B")))
309 (?k "$(3%>(B"
310 (?e "$(3%9(B") (?u "$(3%:(B") (?i "$(3%;(B") (?a "$(3%<(B") (?E "$(3%=(B") (?o "$(3%?(B"))
311 (?s "$(3!F(B"
312 (?e "$(3!A(B") (?u "$(3!B(B") (?i "$(3!C(B") (?a "$(3!D(B") (?E "$(3!E(B") (?o "$(3!G(B")
313 (?W "$(3!H(B" (?a "$(3!H(B")
314 (?e "$(3!F%n(B") (?u "$(3!F%r(B") (?i "$(3!F%o(B") (?E "$(3!F%q(B")))
315 (?S "$(3$L(B"
316 (?e "$(3$G(B") (?u "$(3$H(B") (?i "$(3$I(B") (?a "$(3$J(B") (?E "$(3$K(B") (?o "$(3$M(B")
317 (?W "$(3$F(B" (?a "$(3$F(B")
318 (?e "$(3$L%n(B") (?u "$(3$L%r(B") (?i "$(3$L%o(B") (?E "$(3$L%q(B")))
319 (?q "$(3%.(B" (?e "$(3%)(B") (?u "$(3%*(B") (?i "$(3%+(B") (?a "$(3%,(B") (?E "$(3%-(B") (?o "$(3%/(B")))
320;;; a
321 ("$(3"f(B" (?2 "$(3#8(B"))
322;;; b
323 ("$(3"((B" (?e "$(3"#(B") (?u "$(3"$(B") (?i "$(3"%(B") (?a "$(3"&(B") (?E "$(3"'(B") (?o "$(3")(B")
324 (?W "$(3%b(B" (?e "$(3%2(B") (?u "$(3%b(B") (?i "$(3%B(B") (?a "$(3"*(B") (?E "$(3%R(B")))
325;;; c
326 ("$(3"@(B" (?e "$(3";(B") (?u "$(3"<(B") (?i "$(3"=(B") (?a "$(3">(B") (?E "$(3"?(B") (?o "$(3"A(B")
327 (?W "$(3"B(B" (?a "$(3"B(B")
328 (?e "$(3"@%n(B") (?u "$(3"@%r(B") (?i "$(3"@%o(B") (?E "$(3"@%q(B")))
329;;; d
330 ("$(3#Z(B" (?e "$(3#U(B") (?u "$(3#V(B") (?i "$(3#W(B") (?a "$(3#X(B") (?E "$(3#Y(B") (?o "$(3#[(B")
331 (?W "$(3#\(B" (?a "$(3#\(B")
332 (?e "$(3#Z%o(B") (?u "$(3#Z%r(B") (?i "$(3#Z%p(B") (?E "$(3#Z%q(B")))
333;;; e
334 ("$(3"c(B" (?2 "$(3#5(B") (?a "$(3"j(B"))
335;;; f
336 ("$(3$T(B" (?e "$(3$O(B") (?u "$(3$P(B") (?i "$(3$Q(B") (?a "$(3$R(B") (?E "$(3$S(B") (?o "$(3$U(B")
337 (?W "$(3%d(B" (?e "$(3%4(B") (?u "$(3%d(B") (?i "$(3%D(B") (?a "$(3$V(B") (?E "$(3%T(B"))
338 (?Y "$(3$a(B" (?a "$(3$a(B")))
339;;; g
340 ("$(3#r(B" (?e "$(3#m(B") (?u "$(3#n(B") (?i "$(3#o(B") (?a "$(3#p(B") (?E "$(3#q(B") (?o "$(3#s(B")
341 (?W "$(3#z(B" (?e "$(3#u(B") (?u "$(3#z(B") (?i "$(3#w(B") (?a "$(3#x(B") (?E "$(3#y(B"))
342 (?2 "$(3%^(B" (?e "$(3%Y(B") (?u "$(3%Z(B") (?i "$(3%[(B") (?a "$(3%\(B") (?E "$(3%](B") (?o "$(3%_(B")))
343;;; h
344 ("$(3!&(B" (?e "$(3!!(B") (?u "$(3!"(B") (?i "$(3!#(B") (?a "$(3!$(B") (?E "$(3!%(B") (?o "$(3!'(B")
345 (?W "$(3"P(B" (?e "$(3"K(B") (?u "$(3"P(B") (?i "$(3"M(B") (?a "$(3"N(B") (?E "$(3"O(B"))
346 (?2 "$(3"H(B" (?e "$(3"C(B") (?u "$(3"D(B") (?i "$(3"E(B") (?a "$(3"F(B") (?E "$(3"G(B") (?o "$(3"I(B")
347 (?W "$(3"P(B" (?e "$(3"K(B") (?u "$(3"P(B") (?i "$(3"M(B") (?a "$(3"N(B") (?E "$(3"O(B"))))
348;;; i
349 ("$(3"e(B" (?2 "$(3#7(B"))
350;;; j
351 ("$(3#j(B" (?e "$(3#e(B") (?u "$(3#f(B") (?i "$(3#g(B") (?a "$(3#h(B") (?E "$(3#i(B") (?o "$(3#k(B")
352 (?W "$(3#l(B" (?a "$(3#l(B")
353 (?e "$(3#j%n(B") (?u "$(3#j%r(B") (?i "$(3#j%o(B") (?E "$(3#j%q(B")))
354;;; k
355 ("$(3"p(B" (?e "$(3"k(B") (?u "$(3"l(B") (?i "$(3"m(B") (?a "$(3"n(B") (?E "$(3"o(B") (?o "$(3"q(B")
356 (?W "$(3"x(B" (?e "$(3"s(B") (?u "$(3"x(B") (?i "$(3"u(B") (?a "$(3"v(B") (?E "$(3"w(B"))
357 (?2 "$(3%>(B" (?e "$(3%9(B") (?u "$(3%:(B") (?i "$(3%;(B") (?a "$(3%<(B") (?E "$(3%=(B") (?o "$(3%?(B")))
358;;; l
359 ("$(3!.(B" (?e "$(3!)(B") (?u "$(3!*(B") (?i "$(3!+(B") (?a "$(3!,(B") (?E "$(3!-(B") (?o "$(3!/(B")
360 (?W "$(3!0(B" (?a "$(3!0(B")
361 (?e "$(3!.%n(B") (?u "$(3!.%r(B") (?i "$(3!.%o(B") (?E "$(3!.%q(B")))
362;;; m
363 ("$(3!>(B" (?e "$(3!9(B") (?u "$(3!:(B") (?i "$(3!;(B") (?a "$(3!<(B") (?E "$(3!=(B") (?o "$(3!?(B")
364 (?W "$(3%a(B" (?e "$(3%1(B") (?u "$(3%a(B") (?i "$(3%A(B") (?a "$(3!@(B") (?E "$(3%Q(B"))
365 (?Y "$(3$_(B" (?a "$(3$_(B")))
366;;; n
367 ("$(3"X(B" (?e "$(3"S(B") (?u "$(3"T(B") (?i "$(3"U(B") (?a "$(3"V(B") (?E "$(3"W(B") (?o "$(3"Y(B")
368 (?W "$(3"Z(B" (?a "$(3"Z(B")
369 (?e "$(3"X%n(B") (?u "$(3"X%r(B") (?i "$(3"X%o(B") (?E "$(3"X%q(B")))
370;;; o
371 ("$(3"i(B" (?2 "$(3#;(B"))
372;;; p
373 ("$(3$\(B" (?e "$(3$W(B") (?u "$(3$X(B") (?i "$(3$Y(B") (?a "$(3$Z(B") (?E "$(3$[(B") (?o "$(3$](B")
374 (?W "$(3%e(B" (?e "$(3%5(B") (?u "$(3%e(B") (?i "$(3%E(B") (?a "$(3$^(B") (?E "$(3%U(B")))
375;;; q
376 ("$(3!f(B" (?e "$(3!a(B") (?u "$(3!b(B") (?i "$(3!c(B") (?a "$(3!d(B") (?E "$(3!e(B") (?o "$(3!g(B")
377 (?W "$(3!n(B" (?e "$(3!i(B") (?u "$(3!n(B") (?i "$(3!k(B") (?a "$(3!l(B") (?E "$(3!m(B"))
378 (?2 "$(3%.(B" (?e "$(3%)(B") (?u "$(3%*(B") (?i "$(3%+(B") (?a "$(3%,(B") (?E "$(3%-(B") (?o "$(3%/(B")))
379;;; r
380 ("$(3!N(B" (?e "$(3!I(B") (?u "$(3!J(B") (?i "$(3!K(B") (?a "$(3!L(B") (?E "$(3!M(B") (?o "$(3!O(B")
381 (?W "$(3!P(B" (?a "$(3!P(B")
382 (?e "$(3!N%n(B") (?u "$(3!N%r(B") (?i "$(3!N%o(B") (?E "$(3!N%q(B"))
383 (?Y "$(3$`(B" (?a "$(3$`(B")))
384;;; s
385 ("$(3!V(B" (?e "$(3!Q(B") (?u "$(3!R(B") (?i "$(3!S(B") (?a "$(3!T(B") (?E "$(3!U(B") (?o "$(3!W(B")
386 (?W "$(3!X(B" (?a "$(3!X(B")
387 (?e "$(3!V%n(B") (?u "$(3!V%r(B") (?i "$(3!V%o(B") (?E "$(3!V%q(B"))
388 (?2 "$(3!F(B" (?e "$(3!A(B") (?u "$(3!B(B") (?i "$(3!C(B") (?a "$(3!D(B") (?E "$(3!E(B") (?o "$(3!G(B")
389 (?W "$(3!H(B" (?a "$(3!H(B")
390 (?e "$(3!F%n(B") (?u "$(3!F%r(B") (?i "$(3!F%o(B") (?E "$(3!F%q(B"))))
391;;; t
392 ("$(3"8(B" (?e "$(3"3(B") (?u "$(3"4(B") (?i "$(3"5(B") (?a "$(3"6(B") (?E "$(3"7(B") (?o "$(3"9(B")
393 (?W "$(3":(B" (?a "$(3":(B")
394 (?e "$(3"8%n(B") (?u "$(3"8%r(B") (?i "$(3"8%o(B") (?E "$(3"8%q(B")))
395;;; u
396 ("$(3"d(B" (?2 "$(3#6(B"))
397;;; v
398 ("$(3"0(B" (?e "$(3"+(B") (?u "$(3",(B") (?i "$(3"-(B") (?a "$(3".(B") (?E "$(3"/(B") (?o "$(3"1(B")
399 (?W "$(3"2(B" (?a "$(3"2(B")
400 (?e "$(3"0%n(B") (?u "$(3"0%r(B") (?i "$(3"0%o(B") (?E "$(3"0%q(B")))
401;;; w
402 ("$(3#2(B" (?e "$(3#-(B") (?u "$(3#.(B") (?i "$(3#/(B") (?a "$(3#0(B") (?E "$(3#1(B") (?o "$(3#3(B")
403 (?W "$(3%p(B" (?e "$(3%n(B") (?u "$(3%r(B") (?i "$(3%o(B") (?a "$(3%p(B") (?E "$(3%q(B")))
404;;; x
405 ("$(3!^(B" (?e "$(3!Y(B") (?u "$(3!Z(B") (?i "$(3![(B") (?a "$(3!\(B") (?E "$(3!](B") (?o "$(3!_(B")
406 (?W "$(3!`(B" (?a "$(3!`(B")
407 (?e "$(3!^%n(B") (?u "$(3!^%r(B") (?i "$(3!^%o(B") (?E "$(3!^%q(B")))
408;;; y
409 ("$(3#R(B" (?e "$(3#M(B") (?u "$(3#N(B") (?i "$(3#O(B") (?a "$(3#P(B") (?E "$(3#Q(B") (?o "$(3#S(B")
410 (?W "$(3#T(B" (?a "$(3#T(B")
411 (?e "$(3#R%n(B") (?u "$(3#R%r(B") (?i "$(3#R%o(B") (?E "$(3#R%q(B")))
412;;; z
413 ("$(3#B(B" (?e "$(3#=(B") (?u "$(3#>(B") (?i "$(3#?(B") (?a "$(3#@(B") (?E "$(3#A(B") (?o "$(3#C(B")
414 (?W "$(3#D(B" (?a "$(3#D(B")
415 (?e "$(3#B%n(B") (?u "$(3#B%r(B") (?i "$(3#B%o(B") (?E "$(3#B%q(B")))
416;;; { | } ~ DEL
417 nil nil nil nil nil
418 ])
419
420;; To avoid byte-compiler warnings. It should never be set globally.
421(defvar ethio-sera-being-called-by-w3)
422
423;;;###autoload 184;;;###autoload
424(defun ethio-sera-to-fidel-region (beg end &optional secondary force) 185(defun ethio-sera-to-fidel-buffer (&optional secondary force)
425 "Convert the characters in region from SERA to FIDEL. 186 "Convert the current buffer from SERA to FIDEL.
426The variable `ethio-primary-language' specifies the primary language
427and `ethio-secondary-language' specifies the secondary.
428 187
429If the 3rd parameter SECONDARY is given and non-nil, assume the region 188The variable `ethio-primary-language' specifies the primary
430begins begins with the secondary language; otherwise with the primary 189language and `ethio-secondary-language' specifies the secondary.
431language. 190
191If the 1st optional argument SECONDARY is non-nil, assume the
192buffer begins with the secondary language; otherwise with the
193primary language.
432 194
433If the 4th parameter FORCE is given and non-nil, perform conversion 195If the 2nd optional argument FORCE is non-nil, perform conversion
434even if the buffer is read-only. 196even if the buffer is read-only.
435 197
436See also the descriptions of the variables 198See also the descriptions of the variables
437`ethio-use-colon-for-colon' and 199`ethio-use-colon-for-colon' and `ethio-use-three-dot-question'."
438`ethio-use-three-dot-question'."
439 200
440 (interactive "r\nP") 201 (interactive "P")
441 (save-restriction 202 (ethio-sera-to-fidel-region (point-min) (point-max) secondary force))
442 (narrow-to-region beg end) 203
443 (ethio-sera-to-fidel-buffer secondary force))) 204;; To avoid byte-compiler warnings. It should never be set globally.
205(defvar ethio-sera-being-called-by-w3)
206;; This variable will be bound by some third-party package.
207(defvar sera-being-called-by-w3)
444 208
445;;;###autoload 209;;;###autoload
446(defun ethio-sera-to-fidel-buffer (&optional secondary force) 210(defun ethio-sera-to-fidel-region (begin end &optional secondary force)
447 "Convert the current buffer from SERA to FIDEL. 211 "Convert the characters in region from SERA to FIDEL.
448 212
449The variable `ethio-primary-language' specifies the primary 213The variable `ethio-primary-language' specifies the primary
450language and `ethio-secondary-language' specifies the secondary. 214language and `ethio-secondary-language' specifies the secondary.
451 215
452If the 1st optional parameter SECONDARY is non-nil, assume the buffer 216If the 3rd argument SECONDARY is given and non-nil, assume the
453begins with the secondary language; otherwise with the primary 217region begins with the secondary language; otherwise with the
454language. 218primary language.
455 219
456If the 2nd optional parametr FORCE is non-nil, perform conversion even if the 220If the 4th argument FORCE is given and non-nil, perform
457buffer is read-only. 221conversion even if the buffer is read-only.
458 222
459See also the descriptions of the variables 223See also the descriptions of the variables
460`ethio-use-colon-for-colon' and 224`ethio-use-colon-for-colon' and `ethio-use-three-dot-question'."
461`ethio-use-three-dot-question'."
462
463 (interactive "P")
464 225
226 (interactive "r\nP")
465 (if (and buffer-read-only 227 (if (and buffer-read-only
466 (not force) 228 (not force)
467 (not (y-or-n-p "Buffer is read-only. Force to convert? "))) 229 (not (y-or-n-p "Buffer is read-only. Force to convert? ")))
@@ -469,217 +231,165 @@ See also the descriptions of the variables
469 231
470 (let ((ethio-primary-language ethio-primary-language) 232 (let ((ethio-primary-language ethio-primary-language)
471 (ethio-secondary-language ethio-secondary-language) 233 (ethio-secondary-language ethio-secondary-language)
472 (ethio-use-colon-for-colon ethio-use-colon-for-colon) 234 ;; The above two variables may be changed temporarily by tilde
473 (ethio-use-three-dot-question ethio-use-three-dot-question) 235 ;; escapes during conversion. We bind them to the variables
474 ;; The above four variables may be changed temporary 236 ;; of the same names so that the original values are restored
475 ;; by tilde escapes during conversion. So we bind them to other 237 ;; when this function exits.
476 ;; variables but of the same names.
477 (buffer-read-only nil) 238 (buffer-read-only nil)
478 (case-fold-search nil) 239 (lang (if secondary ethio-secondary-language ethio-primary-language))
479 current-language 240 ret)
480 next-language)
481
482 (setq current-language
483 (if secondary
484 ethio-secondary-language
485 ethio-primary-language))
486
487 (goto-char (point-min))
488
489 (while (not (eobp))
490 (setq next-language
491 (cond
492 ((eq current-language 'english)
493 (ethio-sera-to-fidel-english))
494 ((eq current-language 'amharic)
495 (ethio-sera-to-fidel-ethio 'amharic))
496 ((eq current-language 'tigrigna)
497 (ethio-sera-to-fidel-ethio 'tigrigna))
498 (t ; we don't know what to do
499 (ethio-sera-to-fidel-english))))
500
501 (setq current-language
502 (cond
503
504 ;; when language tag is explicitly specified
505 ((not (eq next-language 'toggle))
506 next-language)
507
508 ;; found a toggle in a primary language section
509 ((eq current-language ethio-primary-language)
510 ethio-secondary-language)
511
512 ;; found a toggle in a secondary, third, fourth, ...
513 ;; language section
514 (t
515 ethio-primary-language))))
516
517 ;; If ethio-implicit-period-conversion is non-nil, the
518 ;; Ethiopic dot "$(3%u(B" at the end of an Ethiopic sentence is
519 ;; replaced with the Ethiopic full stop "$(3$i(B".
520 (if ethio-implicit-period-conversion
521 (progn
522 (goto-char (point-min))
523 (while (re-search-forward "\\([$(3!!(B-$(3$a%)(B-$(3%e%n(B-$(3%r%s(B]\\)$(3%u(B\\([ \t]\\)"
524 nil t)
525 (replace-match "\\1$(3$i(B\\2"))
526 (goto-char (point-min))
527 (while (re-search-forward "\\([$(3!!(B-$(3$a%)(B-$(3%e%n(B-$(3%r%s(B]\\)$(3%u(B$" nil t)
528 (replace-match "\\1$(3$i(B"))))
529
530 ;; gemination
531 (goto-char (point-min))
532 (while (re-search-forward "\\ce$(3%s(B" nil 0)
533 (compose-region
534 (save-excursion (backward-char 2) (point))
535 (point)))
536 ))
537
538(defun ethio-sera-to-fidel-english nil
539 "Handle English section in SERA to FIDEL conversion.
540Conversion stops when a language switch is found. Then delete that
541switch and return the name of the new language as a symbol."
542 (let ((new-language nil))
543
544 (while (and (not (eobp)) (null new-language))
545 (cond
546
547 ;; if no more "\", nothing to do.
548 ((not (search-forward "\\" nil 0)))
549 241
550 ;; hereafter point is put after a "\". 242 (ethio-use-colon-for-colon ethio-use-colon-for-colon)
551 ;; first delete that "\", then check the following chars 243 (ethio-use-three-dot-question ethio-use-three-dot-question)
552 244
553 ;; "\\" : leave the second "\" 245 (save-restriction
554 ((progn 246 (narrow-to-region begin end)
555 (delete-backward-char 1) 247 (goto-char (point-min))
556 (= (following-char) ?\\ )) 248 (while (not (eobp))
557 (forward-char 1)) 249 (setq ret
558 250 (cond
559 ;; "\ " : delete the following " " 251 ((eq lang 'amharic)
560 ((= (following-char) 32) 252 (ethio-prefer-amharic t)
561 (delete-char 1) 253 (ethio-sera-to-fidel-region-ethio 'amharic))
562 (setq new-language 'toggle)) 254 ((eq lang 'tigrigna)
563 255 (ethio-prefer-amharic nil)
564 ;; a language flag 256 (ethio-sera-to-fidel-region-ethio 'tigrigna))
565 ((setq new-language (ethio-process-language-flag))) 257 (t
566 258 (ethio-sera-to-fidel-region-noethio))))
567 ;; just a "\" : not special sequence. 259 (setq lang
568 (t 260 (if (eq ret 'toggle)
569 (setq new-language 'toggle)))) 261 (if (eq lang ethio-primary-language)
570 262 ethio-secondary-language
571 new-language)) 263 ethio-primary-language)
264 ret)))))
265
266 ;; Restore user's preference.
267 (ethio-adjust-robin))
268
269(defun ethio-sera-to-fidel-region-noethio ()
270 "Return next language as symbol: amharic, tigrigna, toggle or nil."
271 (let (lflag)
272 (cond
572 273
573(defun ethio-sera-to-fidel-ethio (lang) 274 ;; No more "\", i.e. nothing to do.
574 "Handle Ethiopic section in SERA to FIDEL conversion. 275 ((not (search-forward "\\" nil 0))
575Conversion stops when a language switch is found. Then delete that 276 nil)
576switch and return the name of the new language as a symbol.
577 277
578The parameter LANG (symbol, either `amharic' or `tigrigna') affects 278 ;; Hereafter point is put after a "\".
579the conversion of \"a\"." 279 ;; First delete that "\", then check the following chars.
580 280
581 (let ((new-language nil) 281 ;; A language flag.
582 (verbatim nil) 282 ((progn (delete-char -1) (setq lflag (ethio-process-language-flag)))
583 start table table2 ch) 283 lflag)
584 284
585 (setcar (aref ethio-sera-to-fidel-table ?a) 285 ;; "\\" : leave the second "\" and continue in the same language.
586 (if (eq lang 'tigrigna) "$(3"f(B" "$(3"c(B")) 286 ((= (following-char) ?\\)
287 (forward-char 1)
288 nil)
587 289
588 (while (and (not (eobp)) (null new-language)) 290 ;; "\ " : delete the following " " and toggle the language.
589 (setq ch (following-char)) 291 ((= (following-char) 32)
590 (cond 292 (delete-char 1)
293 'toggle)
591 294
592 ;; skip from "<" to ">" (or from "&" to ";") if in w3-mode 295 ;; A "\" but not a special sequence: simply toggle the language.
593 ((and (boundp 'ethio-sera-being-called-by-w3) 296 (t
594 ethio-sera-being-called-by-w3 297 'toggle))))
595 (or (= ch ?<) (= ch ?&)))
596 (search-forward (if (= ch ?<) ">" ";")
597 nil 0))
598 298
599 ;; leave non-ASCII characters as they are 299(defun ethio-sera-to-fidel-region-ethio (lang)
600 ((>= ch 128) 300 "Return next language as symbol: amharic, tigrigna, toggle or nil."
301 (save-restriction
302 (narrow-to-region
303 (point)
304 (if (re-search-forward "\\(`[1-9][0-9]*\\)\\|[\\<&]" nil t)
305 (match-beginning 0)
306 (point-max)))
307 (robin-convert-region (point-min) (point-max) "ethiopic-sera")
308 (goto-char (point-max)))
309
310 (let (lflag)
311 (cond
312 ((= (following-char) ?`)
313 (delete-char 1)
314 (ethio-process-digits)
315 lang)
316
317 ((looking-at "[<&]")
318 (if (or (and (boundp 'ethio-sera-being-called-by-w3)
319 ethio-sera-being-called-by-w3)
320 (and (boundp 'sera-being-called-by-w3)
321 sera-being-called-by-w3))
322 (search-forward (if (= (following-char) ?<) ">" ";") nil 0)
601 (forward-char 1)) 323 (forward-char 1))
324 lang)
602 325
603 ;; ethiopic digits 326 ((eobp)
604 ((looking-at "`[1-9][0-9]*") 327 nil)
605 (delete-char 1)
606 (ethio-convert-digit))
607 328
608 ;; if not seeing a "\", do sera to fidel conversion 329 ;; Now we must be looking at a "\".
609 ((/= ch ?\\ ) 330 ;; First delete that "\", then check the following chars.
610 (setq start (point))
611 (forward-char 1)
612 (setq table (aref ethio-sera-to-fidel-table ch))
613 (while (setq table2 (cdr (assoc (following-char) table)))
614 (setq table table2)
615 (forward-char 1))
616 (if (setq ch (car table))
617 (progn
618 (delete-region start (point))
619 (if (stringp ch)
620 (insert ch)
621 (insert (eval ch))))))
622 331
623 ;; if control reaches here, we must be looking at a "\" 332 ((progn (delete-char 1) (= (following-char) 32))
333 (delete-char 1)
334 'toggle)
624 335
625 ;; verbatim mode 336 ((looking-at "[,.;:'`?\\]+")
626 (verbatim 337 (goto-char (match-end 0))
627 (if (looking-at "\\\\~! ?") 338 lang)
628 339
629 ;; "\~!" or "\~! ". switch to non-verbatim mode 340 ((/= (following-char) ?~)
630 (progn 341 'toggle)
631 (replace-match "")
632 (setq verbatim nil))
633 342
634 ;; "\" but not "\~!" nor "\~! ". skip the current "\". 343 ;; Now we must be looking at a "~".
635 (forward-char 1)))
636 344
637 ;; hereafter, non-verbatim mode and looking at a "\" 345 ((setq lflag (ethio-process-language-flag))
638 ;; first delete that "\", then check the following chars. 346 lflag)
639 347
640 ;; "\ " : delete the following " " 348 ;; Delete the following "~" and check the following chars.
641 ((progn
642 (delete-char 1)
643 (setq ch (following-char))
644 (= ch 32))
645 (delete-char 1)
646 (setq new-language 'toggle))
647 349
648 ;; "\~!" or "\~! " : switch to verbatim mode 350 ((progn (delete-char 1) (looking-at "! ?"))
649 ((looking-at "~! ?") 351 (replace-match "")
650 (replace-match "") 352 (if (re-search-forward "\\\\~! ?" nil 0)
651 (setq verbatim t)) 353 (replace-match ""))
354 lang)
652 355
653 ;; a language flag 356 ((looking-at "-: ?")
654 ((setq new-language (ethio-process-language-flag))) 357 (replace-match "")
358 (ethio-use-colon-for-colon t)
359 lang)
655 360
656 ;; "\~" but not "\~!" nor a language flag 361 ((looking-at "`: ?")
657 ((= ch ?~) 362 (replace-match "")
658 (delete-char 1) 363 (ethio-use-colon-for-colon nil)
659 (ethio-tilde-escape)) 364 lang)
660 365
661 ;; ASCII punctuation escape. skip 366 ((looking-at "`| ?")
662 ((looking-at "\\(,\\|\\.\\|;\\|:\\|'\\|`\\|\?\\|\\\\\\)+") 367 (replace-match "")
663 (goto-char (match-end 0))) 368 (ethio-use-three-dot-question t)
369 lang)
664 370
665 ;; "\", but not special sequence 371 ((looking-at "\\? ?")
666 (t 372 (replace-match "")
667 (setq new-language 'toggle)))) 373 (ethio-use-three-dot-question nil)
374 lang)
668 375
669 new-language)) 376 ;; Unknown tilde escape. Recover the deleted chars.
377 (t
378 (insert "\\~")
379 lang))))
670 380
671(defun ethio-process-language-flag nil 381(defun ethio-process-language-flag nil
672 "Process a language flag of the form \"~lang\" or \"~lang1~lang2\". 382 "Process a language flag of the form \"~lang\" or \"~lang1~lang2\".
673 383
674If looking at \"~lang1~lang2\", set `ethio-primary-language' and 384If looking at \"~lang1~lang2\", set `ethio-primary-language' and
675`ethio-une-secondary-language' based on \"lang1\" and \"lang2\". 385`ethio-secondary-language' based on \"lang1\" and \"lang2\".
676Then delete the language flag \"~lang1~lang2\" from the buffer. 386Then delete the language flag \"~lang1~lang2\" from the buffer.
677Return value is the new primary language. 387Return value is the new primary language.
678 388
679If looking at \"~lang\", delete that language flag \"~lang\" from the 389If looking at \"~lang\", delete that language flag \"~lang\" from
680buffer and return that language. In this case 390the buffer and return that language. In this case
681`ethio-primary-language' and `ethio-uni-secondary-language' 391`ethio-primary-language' and `ethio-secondary-language' are left
682are left unchanged. 392unchanged.
683 393
684If an unsupported language flag is found, just return nil without 394If an unsupported language flag is found, just return nil without
685changing anything." 395changing anything."
@@ -690,12 +400,8 @@ changing anything."
690 ;; ~lang1~lang2 400 ;; ~lang1~lang2
691 ((and (looking-at 401 ((and (looking-at
692 "~\\([a-z][a-z][a-z]?\\)~\\([a-z][a-z][a-z]?\\)[ \t\n\\]") 402 "~\\([a-z][a-z][a-z]?\\)~\\([a-z][a-z][a-z]?\\)[ \t\n\\]")
693 (setq lang1 403 (setq lang1 (ethio-flag-to-language (match-string 1)))
694 (ethio-flag-to-language 404 (setq lang2 (ethio-flag-to-language (match-string 2))))
695 (buffer-substring (match-beginning 1) (match-end 1))))
696 (setq lang2
697 (ethio-flag-to-language
698 (buffer-substring (match-beginning 2) (match-end 2)))))
699 (setq ethio-primary-language lang1 405 (setq ethio-primary-language lang1
700 ethio-secondary-language lang2) 406 ethio-secondary-language lang2)
701 (delete-region (point) (match-end 2)) 407 (delete-region (point) (match-end 2))
@@ -705,9 +411,7 @@ changing anything."
705 411
706 ;; ~lang 412 ;; ~lang
707 ((and (looking-at "~\\([a-z][a-z][a-z]?\\)[ \t\n\\]") 413 ((and (looking-at "~\\([a-z][a-z][a-z]?\\)[ \t\n\\]")
708 (setq lang1 414 (setq lang1 (ethio-flag-to-language (match-string 1))))
709 (ethio-flag-to-language
710 (buffer-substring (match-beginning 1) (match-end 1)))))
711 (delete-region (point) (match-end 1)) 415 (delete-region (point) (match-end 1))
712 (if (= (following-char) 32) 416 (if (= (following-char) 32)
713 (delete-char 1)) 417 (delete-char 1))
@@ -717,59 +421,6 @@ changing anything."
717 (t 421 (t
718 nil)))) 422 nil))))
719 423
720(defun ethio-tilde-escape nil
721 "Handle a SERA tilde escape in Ethiopic section and delete it.
722Delete the escape even it is not recognised."
723
724 (let ((p (point)) command)
725 (skip-chars-forward "^ \t\n\\\\")
726 (setq command (buffer-substring p (point)))
727 (delete-region p (point))
728 (if (= (following-char) 32)
729 (delete-char 1))
730
731 (cond
732
733 ;; \~-:
734 ((string= command "-:")
735 (setq ethio-use-colon-for-colon t))
736
737 ;; \~`:
738 ((string= command "`:")
739 (setq ethio-use-colon-for-colon nil))
740
741 ;; \~?
742 ((string= command "?")
743 (setq ethio-use-three-dot-question nil))
744
745 ;; \~`|
746 ((string= command "`|")
747 (setq ethio-use-three-dot-question t))
748
749 ;; \~e
750 ((string= command "e")
751 (insert "$(3%j(B"))
752
753 ;; \~E
754 ((string= command "E")
755 (insert "$(3%k(B"))
756
757 ;; \~a
758 ((string= command "a")
759 (insert "$(3%l(B"))
760
761 ;; \~A
762 ((string= command "A")
763 (insert "$(3%m(B"))
764
765 ;; \~X
766 ((string= command "X")
767 (insert "$(3%i(B"))
768
769 ;; unsupported tilde escape
770 (t
771 nil))))
772
773(defun ethio-flag-to-language (flag) 424(defun ethio-flag-to-language (flag)
774 (cond 425 (cond
775 ((or (string= flag "en") (string= flag "eng")) 'english) 426 ((or (string= flag "en") (string= flag "eng")) 'english)
@@ -777,7 +428,7 @@ Delete the escape even it is not recognised."
777 ((or (string= flag "am") (string= flag "amh")) 'amharic) 428 ((or (string= flag "am") (string= flag "amh")) 'amharic)
778 (t nil))) 429 (t nil)))
779 430
780(defun ethio-convert-digit nil 431(defun ethio-process-digits nil
781 "Convert Arabic digits to Ethiopic digits." 432 "Convert Arabic digits to Ethiopic digits."
782 (let (ch z) 433 (let (ch z)
783 (while (and (>= (setq ch (following-char)) ?1) 434 (while (and (>= (setq ch (following-char)) ?1)
@@ -794,97 +445,23 @@ Delete the escape even it is not recognised."
794 445
795 ;; first digit is 10, 20, ..., or 90 446 ;; first digit is 10, 20, ..., or 90
796 ((= (mod z 2) 1) 447 ((= (mod z 2) 1)
797 (insert (aref [?$(3$y(B ?$(3$z(B ?$(3${(B ?$(3$|(B ?$(3$}(B ?$(3$~(B ?$(3%!(B ?$(3%"(B ?$(3%#(B] (- ch ?1))) 448 (insert (aref [?፲ ?፳ ?፴ ?፵ ?፶ ?፷ ?፸ ?፹ ?፺] (- ch ?1)))
798 (setq z (1- z))) 449 (setq z (1- z)))
799 450
800 ;; first digit is 2, 3, ..., or 9 451 ;; first digit is 2, 3, ..., or 9
801 ((/= ch ?1) 452 ((/= ch ?1)
802 (insert (aref [?$(3$q(B ?$(3$r(B ?$(3$s(B ?$(3$t(B ?$(3$u(B ?$(3$v(B ?$(3$w(B ?$(3$x(B] (- ch ?2)))) 453 (insert (aref [? ? ? ? ? ? ? ?] (- ch ?2))))
803 454
804 ;; single 1 455 ;; single 1
805 ((= z 0) 456 ((= z 0)
806 (insert "$(3$p(B"))) 457 (insert "")))
807 458
808 ;; 100 459 ;; 100
809 (if (= (mod z 4) 2) 460 (if (= (mod z 4) 2)
810 (insert "$(3%$(B")) 461 (insert ""))
811 462
812 ;; 10000 463 ;; 10000
813 (insert-char ?$(3%%(B (/ z 4))))) 464 (insert-char ?፼ (/ z 4)))))
814
815;;;###autoload
816(defun ethio-sera-to-fidel-mail-or-marker (&optional arg)
817 "Execute ethio-sera-to-fidel-mail or ethio-sera-to-fidel-marker depending on the current major mode.
818If in rmail-mode or in mail-mode, execute the former; otherwise latter."
819
820 (interactive "P")
821 (if (or (eq major-mode 'rmail-mode)
822 (eq major-mode 'mail-mode))
823 (ethio-sera-to-fidel-mail (prefix-numeric-value arg))
824 (ethio-sera-to-fidel-marker arg)))
825
826;;;###autoload
827(defun ethio-sera-to-fidel-mail (&optional arg)
828 "Convert SERA to FIDEL to read/write mail and news.
829
830If the buffer contains the markers \"<sera>\" and \"</sera>\",
831convert the segments between them into FIDEL.
832
833If invoked interactively and there is no marker, convert the subject field
834and the body into FIDEL using `ethio-sera-to-fidel-region'."
835
836 (interactive "p")
837 (let ((buffer-read-only nil)
838 border)
839 (save-excursion
840
841 ;; follow RFC822 rules instead of looking for a fixed separator
842 (rfc822-goto-eoh)
843 (forward-line 1)
844 (setq border (point))
845
846 ;; note that the point is placed at the border
847 (if (or (re-search-forward "^<sera>$" nil t)
848 (progn
849 (goto-char (point-min))
850 (re-search-forward "^Subject: <sera>" border t)))
851
852 ;; there are markers
853 (progn
854 ;; we start with the body so that the border will not change
855 ;; use "^<sera>\n" instead of "^<sera>$" not to leave a blank line
856 (goto-char border)
857 (while (re-search-forward "^<sera>\n" nil t)
858 (replace-match "")
859 (ethio-sera-to-fidel-region
860 (point)
861 (progn
862 (if (re-search-forward "^</sera>\n" nil 0)
863 (replace-match ""))
864 (point))))
865 ;; now process the subject
866 (goto-char (point-min))
867 (if (re-search-forward "^Subject: <sera>" border t)
868 (ethio-sera-to-fidel-region
869 (progn (delete-backward-char 6) (point))
870 (progn
871 (if (re-search-forward "</sera>$" (line-end-position) 0)
872 (replace-match ""))
873 (point)))))
874
875 ;; in case there are no marks but invoked interactively
876 (if arg
877 (progn
878 (ethio-sera-to-fidel-region border (point-max))
879 (goto-char (point-min))
880 (if (re-search-forward "^Subject: " border t)
881 (ethio-sera-to-fidel-region (point) (line-end-position))))))
882
883 ;; adjust the rmail marker
884 (if (eq major-mode 'rmail-mode)
885 (set-marker
886 (aref rmail-message-vector (1+ rmail-current-message))
887 (point-max))))))
888 465
889;;;###autoload 466;;;###autoload
890(defun ethio-sera-to-fidel-marker (&optional force) 467(defun ethio-sera-to-fidel-marker (&optional force)
@@ -898,10 +475,10 @@ The markers \"<sera>\" and \"</sera>\" themselves are not deleted."
898 (error "")) 475 (error ""))
899 (save-excursion 476 (save-excursion
900 (goto-char (point-min)) 477 (goto-char (point-min))
901 (while (re-search-forward "<sera>" nil t) 478 (while (search-forward "<sera>" nil t)
902 (ethio-sera-to-fidel-region 479 (ethio-sera-to-fidel-region
903 (point) 480 (point)
904 (if (re-search-forward "</sera>" nil t) 481 (if (search-forward "</sera>" nil t)
905 (match-beginning 0) 482 (match-beginning 0)
906 (point-max)) 483 (point-max))
907 nil 484 nil
@@ -911,71 +488,6 @@ The markers \"<sera>\" and \"</sera>\" themselves are not deleted."
911;; FIDEL to SERA 488;; FIDEL to SERA
912;; 489;;
913 490
914(defconst ethio-fidel-to-sera-map
915 [ "he" "hu" "hi" "ha" "hE" "h" "ho" "" ;; 0 - 7
916 "le" "lu" "li" "la" "lE" "l" "lo" "lWa" ;; 8
917 "He" "Hu" "Hi" "Ha" "HE" "H" "Ho" "HWa" ;; 16
918 "me" "mu" "mi" "ma" "mE" "m" "mo" "mWa" ;; 24
919 "`se" "`su" "`si" "`sa" "`sE" "`s" "`so" "`sWa" ;; 32
920 "re" "ru" "ri" "ra" "rE" "r" "ro" "rWa" ;; 40
921 "se" "su" "si" "sa" "sE" "s" "so" "sWa" ;; 48
922 "xe" "xu" "xi" "xa" "xE" "x" "xo" "xWa" ;; 56
923 "qe" "qu" "qi" "qa" "qE" "q" "qo" "" ;; 64
924 "qWe" "" "qWi" "qWa" "qWE" "qW'" "" "" ;; 72
925 "Qe" "Qu" "Qi" "Qa" "QE" "Q" "Qo" "" ;; 80
926 "QWe" "" "QWi" "QWa" "QWE" "QW'" "" "" ;; 88
927 "be" "bu" "bi" "ba" "bE" "b" "bo" "bWa" ;; 96
928 "ve" "vu" "vi" "va" "vE" "v" "vo" "vWa" ;; 104
929 "te" "tu" "ti" "ta" "tE" "t" "to" "tWa" ;; 112
930 "ce" "cu" "ci" "ca" "cE" "c" "co" "cWa" ;; 120
931 "`he" "`hu" "`hi" "`ha" "`hE" "`h" "`ho" "" ;; 128
932 "hWe" "" "hWi" "hWa" "hWE" "hW'" "" "" ;; 136
933 "ne" "nu" "ni" "na" "nE" "n" "no" "nWa" ;; 144
934 "Ne" "Nu" "Ni" "Na" "NE" "N" "No" "NWa" ;; 152
935 "e" "u" "i" "A" "E" "I" "o" "ea" ;; 160
936 "ke" "ku" "ki" "ka" "kE" "k" "ko" "" ;; 168
937 "kWe" "" "kWi" "kWa" "kWE" "kW'" "" "" ;; 176
938 "Ke" "Ku" "Ki" "Ka" "KE" "K" "Ko" "" ;; 184
939 "KWe" "" "KWi" "KWa" "KWE" "KW'" "" "" ;; 192
940 "we" "wu" "wi" "wa" "wE" "w" "wo" "" ;; 200
941 "`e" "`u" "`i" "`a" "`E" "`I" "`o" "" ;; 208
942 "ze" "zu" "zi" "za" "zE" "z" "zo" "zWa" ;; 216
943 "Ze" "Zu" "Zi" "Za" "ZE" "Z" "Zo" "ZWa" ;; 224
944 "ye" "yu" "yi" "ya" "yE" "y" "yo" "yWa" ;; 232
945 "de" "du" "di" "da" "dE" "d" "do" "dWa" ;; 240
946 "De" "Du" "Di" "Da" "DE" "D" "Do" "DWa" ;; 248
947 "je" "ju" "ji" "ja" "jE" "j" "jo" "jWa" ;; 256
948 "ge" "gu" "gi" "ga" "gE" "g" "go" "" ;; 264
949 "gWe" "" "gWi" "gWa" "gWE" "gW'" "" "" ;; 272
950 "Ge" "Gu" "Gi" "Ga" "GE" "G" "Go" "GWa" ;; 280
951 "Te" "Tu" "Ti" "Ta" "TE" "T" "To" "TWa" ;; 288
952 "Ce" "Cu" "Ci" "Ca" "CE" "C" "Co" "CWa" ;; 296
953 "Pe" "Pu" "Pi" "Pa" "PE" "P" "Po" "PWa" ;; 304
954 "Se" "Su" "Si" "Sa" "SE" "S" "So" "SWa" ;; 312
955 "`Se" "`Su" "`Si" "`Sa" "`SE" "`S" "`So" "" ;; 320
956 "fe" "fu" "fi" "fa" "fE" "f" "fo" "fWa" ;; 328
957 "pe" "pu" "pi" "pa" "pE" "p" "po" "pWa" ;; 336
958 "mYa" "rYa" "fYa" "" "" "" "" "" ;; 344
959 " " " : " "::" "," ";" "-:" ":-" "`?" ;; 352
960 ":|:" "1" "2" "3" "4" "5" "6" "7" ;; 360
961 "8" "9" "10" "20" "30" "40" "50" "60" ;; 368
962 "70" "80" "90" "100" "10000" "" "" "" ;; 376
963 "`qe" "`qu" "`qi" "`qa" "`qE" "`q" "`qo" "" ;; 384
964 "mWe" "bWe" "GWe" "fWe" "pWe" "" "" "" ;; 392
965 "`ke" "`ku" "`ki" "`ka" "`kE" "`k" "`ko" "" ;; 400
966 "mWi" "bWi" "GWi" "fWi" "pWi" "" "" "" ;; 408
967 "Xe" "Xu" "Xi" "Xa" "XE" "X" "Xo" "" ;; 416
968 "mWE" "bWE" "GWE" "fWE" "pWE" "" "" "" ;; 424
969 "`ge" "`gu" "`gi" "`ga" "`gE" "`g" "`go" "" ;; 432
970 "mW'" "bW'" "GW'" "fW'" "pW'" "" "" "" ;; 440
971 "\\~X " "\\~e " "\\~E " "\\~a " "\\~A " "wWe" "wWi" "wWa" ;; 448
972 "wWE" "wW'" "''" "`!" "." "<<" ">>" "?" ]) ;; 456
973
974(defun ethio-prefer-amharic-p nil
975 (or (eq ethio-primary-language 'amharic)
976 (and (not (eq ethio-primary-language 'tigrigna))
977 (eq ethio-secondary-language 'amharic))))
978
979(defun ethio-language-to-flag (lang) 491(defun ethio-language-to-flag (lang)
980 (cond 492 (cond
981 ((eq lang 'english) "eng") 493 ((eq lang 'english) "eng")
@@ -984,282 +496,142 @@ The markers \"<sera>\" and \"</sera>\" themselves are not deleted."
984 (t ""))) 496 (t "")))
985 497
986;;;###autoload 498;;;###autoload
987(defun ethio-fidel-to-sera-region (begin end &optional secondary force) 499(defun ethio-fidel-to-sera-buffer (&optional secondary force)
988 "Replace all the FIDEL characters in the region to the SERA format. 500 "Replace all the FIDEL characters in the current buffer to the SERA format.
989The variable `ethio-primary-language' specifies the primary 501The variable `ethio-primary-language' specifies the primary
990language and `ethio-secondary-language' specifies the secondary. 502language and `ethio-secondary-language' specifies the secondary.
991 503
992If the 3dr parameter SECONDARY is given and non-nil, try to convert 504If the 1st optional argument SECONDARY is non-nil, try to convert the
993the region so that it begins in the secondary language; otherwise with 505region so that it begins with the secondary language; otherwise with the
994the primary language. 506primary language.
995 507
996If the 4th parameter FORCE is given and non-nil, convert even if the 508If the 2nd optional argument FORCE is non-nil, convert even if the
997buffer is read-only. 509buffer is read-only.
998 510
999See also the descriptions of the variables 511See also the descriptions of the variables
1000`ethio-use-colon-for-colon', `ethio-use-three-dot-question', 512`ethio-use-colon-for-colon', `ethio-use-three-dot-question',
1001`ethio-quote-vowel-always' and `ethio-numeric-reduction'." 513`ethio-quote-vowel-always' and `ethio-numeric-reduction'."
1002 514
1003 (interactive "r\nP") 515 (interactive "P")
1004 (save-restriction 516 (ethio-fidel-to-sera-region (point-min) (point-max) secondary force))
1005 (narrow-to-region begin end)
1006 (ethio-fidel-to-sera-buffer secondary force)))
1007 517
1008;;;###autoload 518;;;###autoload
1009(defun ethio-fidel-to-sera-buffer (&optional secondary force) 519(defun ethio-fidel-to-sera-region (begin end &optional secondary force)
1010 "Replace all the FIDEL characters in the current buffer to the SERA format. 520 "Replace all the FIDEL characters in the region to the SERA format.
521
1011The variable `ethio-primary-language' specifies the primary 522The variable `ethio-primary-language' specifies the primary
1012language and `ethio-secondary-language' specifies the secondary. 523language and `ethio-secondary-language' specifies the secondary.
1013 524
1014If the 1st optional parameter SECONDARY is non-nil, try to convert the 525If the 3rd argument SECONDARY is given and non-nil, convert
1015region so that it begins in the secondary language; otherwise with the 526the region so that it begins with the secondary language; otherwise with
1016primary language. 527the primary language.
1017 528
1018If the 2nd optional parameter FORCE is non-nil, convert even if the 529If the 4th argument FORCE is given and non-nil, convert even if the
1019buffer is read-only. 530buffer is read-only.
1020 531
1021See also the descriptions of the variables 532See also the descriptions of the variables
1022`ethio-use-colon-for-colon', `ethio-use-three-dot-question', 533`ethio-use-colon-for-colon', `ethio-use-three-dot-question',
1023`ethio-quote-vowel-always' and `ethio-numeric-reduction'." 534`ethio-quote-vowel-always' and `ethio-numeric-reduction'."
1024 535
1025 (interactive "P") 536 (interactive "r\nP")
1026 (if (and buffer-read-only 537 (if (and buffer-read-only
1027 (not force) 538 (not force)
1028 (not (y-or-n-p "Buffer is read-only. Force to convert? "))) 539 (not (y-or-n-p "Buffer is read-only. Force to convert? ")))
1029 (error "")) 540 (error ""))
1030 541
1031 (let ((buffer-read-only nil) 542 (save-restriction
1032 (case-fold-search nil) 543 (narrow-to-region begin end)
1033 (lonec nil) ;; t means previous char was a lone consonant
1034 (fidel nil) ;; t means previous char was a FIDEL
1035 (digit nil) ;; t means previous char was an Ethiopic digit
1036 (flag (if (ethio-prefer-amharic-p) "\\~amh " "\\~tir "))
1037 mode ch)
1038
1039 ;; user's preference in transcription
1040 (if ethio-use-colon-for-colon
1041 (progn
1042 (aset ethio-fidel-to-sera-map 353 "`:")
1043 (aset ethio-fidel-to-sera-map 357 ":"))
1044 (aset ethio-fidel-to-sera-map 353 " : ")
1045 (aset ethio-fidel-to-sera-map 357 "-:"))
1046
1047 (if ethio-use-three-dot-question
1048 (progn
1049 (aset ethio-fidel-to-sera-map 359 "?")
1050 (aset ethio-fidel-to-sera-map 463 "`?"))
1051 (aset ethio-fidel-to-sera-map 359 "`?")
1052 (aset ethio-fidel-to-sera-map 463 "?"))
1053
1054 (mapcar
1055 '(lambda (x)
1056 (aset (aref ethio-fidel-to-sera-map x)
1057 2
1058 (if ethio-W-sixth-always ?' ?u)))
1059 '(77 93 141 181 197 277 440 441 442 443 444 457))
1060
1061 (if (ethio-prefer-amharic-p)
1062 (aset ethio-fidel-to-sera-map 160 "a")
1063 (aset ethio-fidel-to-sera-map 160 "e"))
1064 ;; end of user's preference
1065
1066 ;; first, decompose geminated characters
1067 (decompose-region (point-min) (point-max))
1068
1069 ;; main conversion routine
1070 (goto-char (point-min))
1071 (while (not (eobp))
1072 (setq ch (following-char))
1073
1074 (cond ; ethiopic, english, neutral
1075
1076 ;; ethiopic character. must go to ethiopic mode, if not in it.
1077 ((eq (char-charset ch) 'ethiopic)
1078 (setq ch (ethio-char-to-ethiocode ch))
1079 (delete-char 1)
1080 (if (not (eq mode 'ethiopic))
1081 (progn
1082 (insert flag)
1083 (setq mode 'ethiopic)))
1084
1085 (cond ; fidel, punc, digit
1086
1087 ;; fidels
1088 ((or (<= ch 346) ; he - fYa
1089 (and (>= ch 384) (<= ch 444)) ; `qe - pw
1090 (and (>= ch 453) (<= ch 457))) ; wWe - wW
1091 (if (and (memq ch '(160 161 162 163 164 166 167)) ; (e - ea)
1092 (or lonec
1093 (and ethio-quote-vowel-always
1094 fidel)))
1095 (insert "'"))
1096 (insert (aref ethio-fidel-to-sera-map ch))
1097 (setq lonec (ethio-lone-consonant-p ch)
1098 fidel t
1099 digit nil))
1100
1101 ;; punctuations or icons
1102 ((or (and (>= ch 353) (<= ch 360)) ; : - :|:
1103 (>= ch 458) ; '' - ?
1104 (and (>= ch 448) (<= ch 452))) ; \~X \~e \~E \~a \~A
1105 (insert (aref ethio-fidel-to-sera-map ch))
1106 (setq lonec nil
1107 fidel nil
1108 digit nil))
1109
1110 ;; now CH must be an ethiopic digit
1111
1112 ;; reduction = 0 or not preceded by Ethiopic number(s)
1113 ((or (= ethio-numeric-reduction 0)
1114 (not digit))
1115 (insert "`" (aref ethio-fidel-to-sera-map ch))
1116 (setq lonec nil
1117 fidel nil
1118 digit t))
1119
1120 ;; reduction = 2 and following 10s, 100s, 10000s
1121 ((and (= ethio-numeric-reduction 2)
1122 (memq ch '(370 379 380)))
1123 (insert (substring (aref ethio-fidel-to-sera-map ch) 1))
1124 (setq lonec nil
1125 fidel nil
1126 digit t))
1127
1128 ;; ordinary following digits
1129 (t
1130 (insert (aref ethio-fidel-to-sera-map ch))
1131 (setq lonec nil
1132 fidel nil
1133 digit t))))
1134
1135 ;; english character. must go to english mode, if not in it.
1136 ((or (and (>= ch ?a) (<= ch ?z))
1137 (and (>= ch ?A) (<= ch ?Z)))
1138 (if (not (eq mode 'english))
1139 (insert "\\~eng "))
1140 (forward-char 1)
1141 (setq mode 'english
1142 lonec nil
1143 fidel nil
1144 digit nil))
1145 544
1146 ;; ch can appear both in ethiopic section and in english section. 545 (let ((buffer-read-only nil)
1147 (t 546 (mode (if secondary
547 ethio-secondary-language
548 ethio-primary-language))
549 (flag (if (ethio-prefer-amharic-p) "\\~amh " "\\~tir "))
550 p ch)
1148 551
1149 ;; we must decide the mode, if not decided yet 552 (goto-char (point-min))
1150 (if (null mode) 553 (ethio-adjust-robin)
554 (unless (eq mode 'english)
555 (setq mode 'ethiopic))
556 (if (and (eq mode 'english) (looking-at "\\ce"))
557 (setq mode 'ethiopic))
558 (if (and (eq mode 'ethiopic) (looking-at "\\Ce"))
559 (setq mode 'english))
560 (insert (if (eq mode 'english) "\\~eng " flag))
561
562 (while (not (eobp))
563
564 (if (eq mode 'english)
1151 (progn 565 (progn
1152 (setq mode 566 (if (re-search-forward "\\(\\ce\\|\\\\\\)" nil 0)
1153 (if secondary 567 (forward-char -1))
1154 ethio-secondary-language 568 (cond
1155 ethio-primary-language)) 569 ((eq (following-char) ?\\)
1156 (if (eq mode 'english) 570 (insert "\\")
1157 (insert "\\~eng ") 571 (forward-char 1))
572 ((looking-at "\\ce")
1158 (insert flag) 573 (insert flag)
1159 (setq mode 'ethiopic)))) ; tigrigna & amharic --> ethiopic 574 (setq mode 'ethiopic))))
1160
1161 (cond ; \ , eng-mode , punc , w3 , other
1162
1163 ;; backslash is always quoted
1164 ((= ch ?\\ )
1165 (insert "\\")
1166 (forward-char 1))
1167 575
1168 ;; nothing to do if in english mode 576 ;; If we reach here, mode is ethiopic.
1169 ((eq mode 'english) 577 (setq p (point))
1170 (forward-char 1)) 578 (if (re-search-forward "[a-z,.;:'`?\\<&]" nil 0)
579 (forward-char -1))
580 (save-restriction
581 (narrow-to-region p (point))
582 (robin-invert-region (point-min) (point-max) "ethiopic-sera")
1171 583
1172 ;; now we must be in ethiopic mode and seeing a non-"\" 584 ;; ethio-quote-vowel-alwyas
1173 585 (goto-char (point-min))
1174 ;; ascii punctuations in ethiopic mode 586 (while (re-search-forward "'[eauio]" nil t)
1175 ((looking-at "[,.;:'`?]+") 587 (save-excursion
1176 (insert "\\") 588 (forward-char -2)
1177 (goto-char (1+ (match-end 0)))) ; because we inserted one byte (\) 589 (setq ch (preceding-char))
1178 590 (if (or (and (>= ch ?a) (<= ch ?z))
1179 ;; skip from "<" to ">" (or from "&" to ";") if called from w3 591 (and (>= ch ?A) (<= ch ?Z)))
1180 ((and (boundp 'ethio-sera-being-called-by-w3) 592 (if (and (not ethio-quote-vowel-always)
1181 ethio-sera-being-called-by-w3 593 (memq ch '(?e ?a ?u ?i ?o ?E ?A ?I)))
1182 (or (= ch ?<) (= ch ?&))) 594 (delete-char 1))
1183 (search-forward (if (= ch ?<) ">" ";") 595 (delete-char 1))))
1184 nil 0)) 596
1185 597 ;; ethio-W-sixth-always
1186 ;; neutral character. no need to quote. just skip it. 598 (unless ethio-W-sixth-always
1187 (t 599 (goto-char (point-min))
1188 (forward-char 1))) 600 (while (search-forward "W'" nil t)
1189 601 (delete-char -1)
1190 (setq lonec nil 602 (insert "u")))
1191 fidel nil
1192 digit nil)))
1193 ;; end of main conversion routine
1194 )))
1195
1196(defun ethio-lone-consonant-p (ethiocode)
1197 "If ETHIOCODE is an Ethiopic lone consonant, return t."
1198 (or (and (< ethiocode 344) (= (% ethiocode 8) 5))
1199
1200 ;; `q `k X `g mW bW GW fW pW wW
1201 (memq ethiocode '(389 405 421 437 440 441 442 443 444 457))))
1202
1203;;;###autoload
1204(defun ethio-fidel-to-sera-mail-or-marker (&optional arg)
1205 "Execute ethio-fidel-to-sera-mail or ethio-fidel-to-sera-marker depending on the current major mode.
1206If in rmail-mode or in mail-mode, execute the former; otherwise latter."
1207
1208 (interactive "P")
1209 (if (or (eq major-mode 'rmail-mode)
1210 (eq major-mode 'mail-mode))
1211 (ethio-fidel-to-sera-mail)
1212 (ethio-fidel-to-sera-marker arg)))
1213
1214;;;###autoload
1215(defun ethio-fidel-to-sera-mail nil
1216 "Convert FIDEL to SERA to read/write mail and news.
1217
1218If the body contains at least one Ethiopic character,
1219 1) insert the string \"<sera>\" at the beginning of the body,
1220 2) insert \"</sera>\" at the end of the body, and
1221 3) convert the body into SERA.
1222
1223The very same procedure applies to the subject field, too."
1224
1225 (interactive)
1226 (let ((buffer-read-only nil)
1227 border)
1228 (save-excursion
1229
1230 ;; follow RFC822 rules instead of looking for a fixed separator
1231 (rfc822-goto-eoh)
1232 (forward-line 1)
1233 (setq border (point))
1234
1235 ;; process body first not to change the border
1236 ;; note that the point is already at the border
1237 (if (re-search-forward "\\ce" nil t)
1238 (progn
1239 (ethio-fidel-to-sera-region border (point-max))
1240 (goto-char border)
1241 (insert "<sera>")
1242 (goto-char (point-max))
1243 (insert "</sera>")))
1244 603
1245 ;; process subject 604 ;; ethio-numeric-reduction
1246 (goto-char (point-min)) 605 (when (> ethio-numeric-reduction 0)
1247 (if (re-search-forward "^Subject: " border t) 606 (goto-char (point-min))
1248 (let ((beg (point)) 607 (while (re-search-forward "\\([0-9]\\)`\\([0-9]\\)" nil t)
1249 (end (line-end-position))) 608 (replace-match "\\1\\2")
1250 (if (re-search-forward "\\ce" end t) 609 (forward-char -1)))
1251 (progn 610 (when (= ethio-numeric-reduction 2)
1252 (ethio-fidel-to-sera-region beg end) 611 (goto-char (point-min))
1253 (goto-char beg) 612 (while (re-search-forward "\\([0-9]\\)1\\(0+\\)" nil t)
1254 (insert "<sera>") 613 (replace-match "\\1\\2")))
1255 (end-of-line) 614
1256 (insert "</sera>"))))) 615 (goto-char (point-max)))
1257 616
1258 ;; adjust the rmail marker 617 (cond
1259 (if (eq major-mode 'rmail-mode) 618 ((looking-at "[a-z]")
1260 (set-marker 619 (insert"\\~eng ")
1261 (aref rmail-message-vector (1+ rmail-current-message)) 620 (setq mode 'english))
1262 (point-max)))))) 621 ((looking-at "[,.;:'`\\]+")
622 (insert "\\")
623 (goto-char (1+ (match-end 0))))
624 ((= (following-char) ??)
625 (if ethio-use-three-dot-question
626 (insert "\\"))
627 (forward-char 1))
628 ((looking-at "[<&]")
629 (if (or (and (boundp 'ethio-sera-being-called-by-w3)
630 ethio-sera-being-called-by-w3)
631 (and (boundp 'sera-being-called-by-w3)
632 sera-being-called-by-w3))
633 (search-forward (if (= (following-char) ?<) ">" "&") nil 0)
634 (forward-char 1)))))))))
1263 635
1264;;;###autoload 636;;;###autoload
1265(defun ethio-fidel-to-sera-marker (&optional force) 637(defun ethio-fidel-to-sera-marker (&optional force)
@@ -1273,10 +645,10 @@ The markers \"<sera>\" and \"</sera>\" themselves are not deleted."
1273 (error "")) 645 (error ""))
1274 (save-excursion 646 (save-excursion
1275 (goto-char (point-min)) 647 (goto-char (point-min))
1276 (while (re-search-forward "<sera>" nil t) 648 (while (search-forward "<sera>" nil t)
1277 (ethio-fidel-to-sera-region 649 (ethio-fidel-to-sera-region
1278 (point) 650 (point)
1279 (if (re-search-forward "</sera>" nil t) 651 (if (search-forward "</sera>" nil t)
1280 (match-beginning 0) 652 (match-beginning 0)
1281 (point-max)) 653 (point-max))
1282 nil 654 nil
@@ -1290,225 +662,31 @@ The markers \"<sera>\" and \"</sera>\" themselves are not deleted."
1290(defun ethio-modify-vowel nil 662(defun ethio-modify-vowel nil
1291 "Modify the vowel of the FIDEL that is under the cursor." 663 "Modify the vowel of the FIDEL that is under the cursor."
1292 (interactive) 664 (interactive)
1293 (let ((ch (following-char)) 665 (ethio-adjust-robin)
1294 (composite nil) ; geminated or not 666 (let ((consonant (ethio-get-consonant (following-char)))
1295 newch base vowel modulo) 667 vowel)
1296 668 (if (null consonant)
1297 (cond 669 (error "") ; not an Ethiopic char
1298 ;; in case of gemination 670 (setq vowel (read-char "Modify vowel to: "))
1299 ((eq (char-charset ch) 'composition)
1300 (setq ch (string-to-char (char-to-string ch))
1301 composite t))
1302 ;; neither gemination nor fidel
1303 ((not (eq (char-charset ch) 'ethiopic))
1304 (error "Not a valid character")))
1305
1306 ;; set frequently referred character features
1307 (setq ch (ethio-char-to-ethiocode ch)
1308 base (* (/ ch 8) 8)
1309 modulo (% ch 8))
1310
1311 (if (or (and (>= ch 344) (<= ch 380)) ;; mYa - `10000
1312 (and (>= ch 448) (<= ch 452)) ;; \~X - \~A
1313 (>= ch 458)) ;; private punctuations
1314 (error "Not a valid character"))
1315
1316 (setq
1317 newch
1318 (cond
1319
1320 ;; first standalone vowels
1321 ((= base 160)
1322 (if (ethio-prefer-amharic-p)
1323 (message "Modify vowel to: [auiAEIoW\"] ")
1324 (message "Modify vowel to: [euiAEIoW\"] "))
1325 (setq vowel (read-char))
1326 (cond
1327 ((= vowel ?e) 160)
1328 ((= vowel ?u) 161)
1329 ((= vowel ?i) 162)
1330 ((= vowel ?A) 163)
1331 ((= vowel ?E) 164)
1332 ((= vowel ?I) 165)
1333 ((= vowel ?o) 166)
1334 ((= vowel ?W) 167)
1335 ((= vowel ?a) (if (ethio-prefer-amharic-p) 160 163))
1336 ((= vowel ?\") (setq composite t) ch)
1337 (t nil)))
1338
1339 ;; second standalone vowels
1340 ((= base 208)
1341 (message "Modify vowel to: [euiaEIo\"] ")
1342 (setq vowel (read-char))
1343 (cond
1344 ((= vowel ?e) 208)
1345 ((= vowel ?u) 209)
1346 ((= vowel ?i) 210)
1347 ((= vowel ?a) 211)
1348 ((= vowel ?E) 212)
1349 ((= vowel ?I) 213)
1350 ((= vowel ?o) 214)
1351 ((= vowel ?\") (setq composite t) ch)
1352 (t nil)))
1353
1354 ;; 12-form consonants, *W* form
1355 ((memq base '(72 88 136 176 192 272)) ; qW QW hW kW KW gW
1356 (message "Modify vowel to: [euiaE'\"] ")
1357 (setq vowel (read-char))
1358 (cond
1359 ((= vowel ?e) base)
1360 ((= vowel ?u) (+ base 5))
1361 ((= vowel ?i) (+ base 2))
1362 ((= vowel ?a) (+ base 3))
1363 ((= vowel ?E) (+ base 4))
1364 ((= vowel ?') (+ base 5))
1365 ((= vowel ?\") (setq composite t) ch)
1366 (t nil)))
1367
1368 ;; extended 12-form consonants, mWa bWa GWa fWa pWa
1369 ((= ch 31) ; mWa
1370 (message "Modify vowel to: [euiaE'\"] ")
1371 (setq vowel (read-char))
1372 (cond
1373 ((= vowel ?e) 392)
1374 ((= vowel ?u) 440)
1375 ((= vowel ?i) 408)
1376 ((= vowel ?a) ch)
1377 ((= vowel ?E) 424)
1378 ((= vowel ?') 440)
1379 ((= vowel ?\") (setq composite t) ch)
1380 (t nil)))
1381 ((= ch 103) ; bWa
1382 (message "Modify vowel to: [euiaE'\"] ")
1383 (setq vowel (read-char))
1384 (cond
1385 ((= vowel ?e) 393)
1386 ((= vowel ?u) 441)
1387 ((= vowel ?i) 409)
1388 ((= vowel ?a) ch)
1389 ((= vowel ?E) 425)
1390 ((= vowel ?') 441)
1391 ((= vowel ?\") (setq composite t) ch)
1392 (t nil)))
1393 ((= ch 287) ; GWa
1394 (message "Modify vowel to: [euiaE'\"] ")
1395 (setq vowel (read-char))
1396 (cond
1397 ((= vowel ?e) 394)
1398 ((= vowel ?u) 442)
1399 ((= vowel ?i) 410)
1400 ((= vowel ?a) ch)
1401 ((= vowel ?E) 426)
1402 ((= vowel ?') 442)
1403 ((= vowel ?\") (setq composite t) ch)
1404 (t nil)))
1405 ((= ch 335) ; fWa
1406 (message "Modify vowel to: [euiaE'\"] ")
1407 (setq vowel (read-char))
1408 (cond
1409 ((= vowel ?e) 395)
1410 ((= vowel ?u) 443)
1411 ((= vowel ?i) 411)
1412 ((= vowel ?a) ch)
1413 ((= vowel ?E) 427)
1414 ((= vowel ?') 443)
1415 ((= vowel ?\") (setq composite t) ch)
1416 (t nil)))
1417 ((= ch 343) ; pWa
1418 (message "Modify vowel to: [euiaE'\"] ")
1419 (setq vowel (read-char))
1420 (cond
1421 ((= vowel ?e) 396)
1422 ((= vowel ?u) 444)
1423 ((= vowel ?i) 412)
1424 ((= vowel ?a) ch)
1425 ((= vowel ?E) 428)
1426 ((= vowel ?') 444)
1427 ((= vowel ?\") (setq composite t) ch)
1428 (t nil)))
1429
1430 ;; extended 12-form consonatns, mW* bW* GW* fW* pW*
1431 ((memq base '(392 408 424 440)) ; *We *Wi *WE *W
1432 (message "Modify vowel to: [eiEau'\"] ")
1433 (setq vowel (read-char))
1434 (cond
1435 ((= vowel ?e) (+ 392 modulo))
1436 ((= vowel ?i) (+ 408 modulo))
1437 ((= vowel ?E) (+ 424 modulo))
1438 ((= vowel ?a) (cond
1439 ((= modulo 0) 31) ; mWa
1440 ((= modulo 1) 103) ; bWa
1441 ((= modulo 2) 287) ; GWa
1442 ((= modulo 3) 335) ; fWa
1443 ((= modulo 4) 343) ; pWa
1444 (t nil))) ; never reach here
1445 ((= vowel ?') (+ 440 modulo))
1446 ((= vowel ?u) (+ 440 modulo))
1447 ((= vowel ?\") (setq composite t) ch)
1448 (t nil)))
1449
1450 ((and (>= ch 453) (<= ch 457)) ; wWe wWi wWa wWE wW
1451 (message "Modify vowel to: [eiaE'u\"] ")
1452 (setq vowel (read-char))
1453 (cond
1454 ((= vowel ?e) 453)
1455 ((= vowel ?i) 454)
1456 ((= vowel ?a) 455)
1457 ((= vowel ?E) 456)
1458 ((= vowel ?') 457)
1459 ((= vowel ?u) 457)
1460 ((= vowel ?\") (setq composite t) ch)
1461 (t nil)))
1462
1463 ;; 7-form consonants, or
1464 ;; first 7 of 8-form consonants
1465 ((<= modulo 6)
1466 (message "Modify vowel to: [euiaE'o\"] ")
1467 (setq vowel (read-char))
1468 (cond
1469 ((= vowel ?e) base)
1470 ((= vowel ?u) (+ base 1))
1471 ((= vowel ?i) (+ base 2))
1472 ((= vowel ?a) (+ base 3))
1473 ((= vowel ?E) (+ base 4))
1474 ((= vowel ?') (+ base 5))
1475 ((= vowel ?o) (+ base 6))
1476 ((= vowel ?\") (setq composite t) ch)
1477 (t nil)))
1478
1479 ;; otherwise
1480 (t
1481 nil)))
1482
1483 (cond
1484
1485 ;; could not get new character
1486 ((null newch)
1487 (error "Invalid vowel"))
1488
1489 ;; vowel changed on a composite Fidel
1490 (composite
1491 (delete-char 1)
1492 (insert
1493 (compose-string
1494 (concat (char-to-string (ethio-ethiocode-to-char newch)) "$(3%s(B"))))
1495
1496 ;; simple vowel modification
1497 (t
1498 (delete-char 1) 671 (delete-char 1)
1499 (insert (ethio-ethiocode-to-char newch)))))) 672 (if (and (string= consonant "'") (= vowel ?W))
1500 673 (insert ?ኧ)
1501(defun ethio-ethiocode-to-char (ethiocode) 674 (save-restriction
1502 (make-char 675 (narrow-to-region (point) (point))
1503 'ethiopic 676 (insert consonant vowel)
1504 (+ (/ ethiocode 94) 33) 677 (robin-convert-region (point-min) (point-max) "ethiopic-sera"))))))
1505 (+ (mod ethiocode 94) 33))) 678
1506 679(defun ethio-get-consonant (ch)
1507(defun ethio-char-to-ethiocode (ch) 680 "Return the consonant part of CH's SERA spelling in ethiopic-sera."
1508 (and (eq (char-charset ch) 'ethiopic) 681 (let ((sera (get-char-code-property ch 'ethiopic-sera)))
1509 (let ((char-components (split-char ch))) 682 (cond
1510 (+ (* (- (nth 1 char-components) 33) 94) 683 ((null sera) nil)
1511 (- (nth 2 char-components) 33))))) 684 ((= ch ?ኧ) "'") ; Only this has two vowel letters.
685 (t (with-temp-buffer
686 (insert sera)
687 (if (memq (preceding-char) '(?e ?u ?i ?a ?o ?E ?I ?A ?'))
688 (delete-char -1))
689 (buffer-substring (point-min) (point-max)))))))
1512 690
1513;; 691;;
1514;; space replacement 692;; space replacement
@@ -1519,14 +697,14 @@ The markers \"<sera>\" and \"</sera>\" themselves are not deleted."
1519 "Replace ASCII spaces with Ethiopic word separators in the region. 697 "Replace ASCII spaces with Ethiopic word separators in the region.
1520 698
1521In the specified region, replace word separators surrounded by two 699In the specified region, replace word separators surrounded by two
1522Ethiopic characters, depending on the first parameter CH, which should 700Ethiopic characters, depending on the first argument CH, which should
1523be 1, 2, or 3. 701be 1, 2, or 3.
1524 702
1525If CH = 1, word separator will be replaced with an ASCII space. 703If CH = 1, word separator will be replaced with an ASCII space.
1526If CH = 2, with two ASCII spaces. 704If CH = 2, with two ASCII spaces.
1527If CH = 3, with the Ethiopic colon-like word separator. 705If CH = 3, with the Ethiopic colon-like word separator.
1528 706
1529The second and third parameters BEGIN and END specify the region." 707The 2nd and 3rd arguments BEGIN and END specify the region."
1530 708
1531 (interactive "*cReplace spaces to: 1 (sg col), 2 (dbl col), 3 (Ethiopic)\nr") 709 (interactive "*cReplace spaces to: 1 (sg col), 2 (dbl col), 3 (Ethiopic)\nr")
1532 (if (not (memq ch '(?1 ?2 ?3))) 710 (if (not (memq ch '(?1 ?2 ?3)))
@@ -1539,61 +717,62 @@ The second and third parameters BEGIN and END specify the region."
1539 ((= ch ?1) 717 ((= ch ?1)
1540 ;; an Ethiopic word separator --> an ASCII space 718 ;; an Ethiopic word separator --> an ASCII space
1541 (goto-char (point-min)) 719 (goto-char (point-min))
1542 (while (search-forward "$(3$h(B" nil t) 720 (while (search-forward "" nil t)
1543 (replace-match " " nil t)) 721 (replace-match " "))
1544 722
1545 ;; two ASCII spaces between Ethiopic characters --> an ASCII space 723 ;; two ASCII spaces between Ethiopic characters --> an ASCII space
1546 (goto-char (point-min)) 724 (goto-char (point-min))
1547 (while (re-search-forward "\\(\\ce\\) \\(\\ce\\)" nil t) 725 (while (re-search-forward "\\(\\ce\\) \\(\\ce\\)" nil t)
1548 (replace-match "\\1 \\2") 726 (replace-match "\\1 \\2")
1549 (goto-char (match-beginning 2)))) 727 (forward-char -1)))
1550 728
1551 ((= ch ?2) 729 ((= ch ?2)
1552 ;; An Ethiopic word separator --> two ASCII spaces 730 ;; An Ethiopic word separator --> two ASCII spaces
1553 (goto-char (point-min)) 731 (goto-char (point-min))
1554 (while (search-forward "$(3$h(B" nil t) 732 (while (search-forward "" nil t)
1555 (replace-match " ")) 733 (replace-match " "))
1556 734
1557 ;; An ASCII space between Ethiopic characters --> two ASCII spaces 735 ;; An ASCII space between Ethiopic characters --> two ASCII spaces
1558 (goto-char (point-min)) 736 (goto-char (point-min))
1559 (while (re-search-forward "\\(\\ce\\) \\(\\ce\\)" nil t) 737 (while (re-search-forward "\\(\\ce\\) \\(\\ce\\)" nil t)
1560 (replace-match "\\1 \\2") 738 (replace-match "\\1 \\2")
1561 (goto-char (match-beginning 2)))) 739 (forward-char -1)))
1562 740
1563 (t 741 (t
1564 ;; One or two ASCII spaces between Ethiopic characters 742 ;; One or two ASCII spaces between Ethiopic characters
1565 ;; --> An Ethiopic word separator 743 ;; --> An Ethiopic word separator
1566 (goto-char (point-min)) 744 (goto-char (point-min))
1567 (while (re-search-forward "\\(\\ce\\) ?\\(\\ce\\)" nil t) 745 (while (re-search-forward "\\(\\ce\\) ?\\(\\ce\\)" nil t)
1568 (replace-match "\\1$(3$h(B\\2") 746 (replace-match "\\1\\2")
1569 (goto-char (match-beginning 2))) 747 (forward-char -1))
1570 748
1571 ;; Three or more ASCII spaces between Ethiopic characters 749 ;; Three or more ASCII spaces between Ethiopic characters
1572 ;; --> An Ethiopic word separator + (N - 2) ASCII spaces 750 ;; --> An Ethiopic word separator + (N - 2) ASCII spaces
1573 (goto-char (point-min)) 751 (goto-char (point-min))
1574 (while (re-search-forward "\\(\\ce\\) \\( *\\ce\\)" nil t) 752 (while (re-search-forward "\\(\\ce\\) \\( +\\ce\\)" nil t)
1575 (replace-match "\\1$(3$h(B\\2") 753 (replace-match "\\1\\2")
1576 (goto-char (match-beginning 2)))))))) 754 (forward-char -1)))))))
1577 755
1578;; 756;;
1579;; special icons 757;; special icons
1580;; 758;;
1581 759
760;; This function is deprecated.
1582;;;###autoload 761;;;###autoload
1583(defun ethio-input-special-character (arg) 762(defun ethio-input-special-character (arg)
1584 "Allow the user to input special characters." 763 "This function is deprecated."
1585 (interactive "*cInput number: 1.$(3%j(B 2.$(3%k(B 3.$(3%l(B 4.$(3%m(B 5.$(3%i(B") 764 (interactive "*cInput number: 1. 2. 3. 4. 5.")
1586 (cond 765 (cond
1587 ((= arg ?1) 766 ((= arg ?1)
1588 (insert "$(3%j(B")) 767 (insert ""))
1589 ((= arg ?2) 768 ((= arg ?2)
1590 (insert "$(3%k(B")) 769 (insert ""))
1591 ((= arg ?3) 770 ((= arg ?3)
1592 (insert "$(3%l(B")) 771 (insert ""))
1593 ((= arg ?4) 772 ((= arg ?4)
1594 (insert "$(3%m(B")) 773 (insert ""))
1595 ((= arg ?5) 774 ((= arg ?5)
1596 (insert "$(3%i(B")) 775 (insert ""))
1597 (t 776 (t
1598 (error "")))) 777 (error ""))))
1599 778
@@ -1601,120 +780,49 @@ The second and third parameters BEGIN and END specify the region."
1601;; TeX support 780;; TeX support
1602;; 781;;
1603 782
1604(defconst ethio-fidel-to-tex-map
1605 [ "heG" "huG" "hiG" "haG" "hEG" "hG" "hoG" "" ;; 0 - 7
1606 "leG" "luG" "liG" "laG" "lEG" "lG" "loG" "lWaG" ;; 8
1607 "HeG" "HuG" "HiG" "HaG" "HEG" "HG" "HoG" "HWaG" ;; 16
1608 "meG" "muG" "miG" "maG" "mEG" "mG" "moG" "mWaG" ;; 24
1609 "sseG" "ssuG" "ssiG" "ssaG" "ssEG" "ssG" "ssoG" "ssWaG" ;; 32
1610 "reG" "ruG" "riG" "raG" "rEG" "rG" "roG" "rWaG" ;; 40
1611 "seG" "suG" "siG" "saG" "sEG" "sG" "soG" "sWaG" ;; 48
1612 "xeG" "xuG" "xiG" "xaG" "xEG" "xG" "xoG" "xWaG" ;; 56
1613 "qeG" "quG" "qiG" "qaG" "qEG" "qG" "qoG" "" ;; 64
1614 "qWeG" "" "qWiG" "qWaG" "qWEG" "qWG" "" "" ;; 72
1615 "QeG" "QuG" "QiG" "QaG" "QEG" "QG" "QoG" "" ;; 80
1616 "QWeG" "" "QWiG" "QWaG" "QWEG" "QWG" "" "" ;; 88
1617 "beG" "buG" "biG" "baG" "bEG" "bG" "boG" "bWaG" ;; 96
1618 "veG" "vuG" "viG" "vaG" "vEG" "vG" "voG" "vWaG" ;; 104
1619 "teG" "tuG" "tiG" "taG" "tEG" "tG" "toG" "tWaG" ;; 112
1620 "ceG" "cuG" "ciG" "caG" "cEG" "cG" "coG" "cWaG" ;; 120
1621 "hheG" "hhuG" "hhiG" "hhaG" "hhEG" "hhG" "hhoG" "" ;; 128
1622 "hWeG" "" "hWiG" "hWaG" "hWEG" "hWG" "" "" ;; 136
1623 "neG" "nuG" "niG" "naG" "nEG" "nG" "noG" "nWaG" ;; 144
1624 "NeG" "NuG" "NiG" "NaG" "NEG" "NG" "NoG" "NWaG" ;; 152
1625 "eG" "uG" "iG" "AG" "EG" "IG" "oG" "eaG" ;; 160
1626 "keG" "kuG" "kiG" "kaG" "kEG" "kG" "koG" "" ;; 168
1627 "kWeG" "" "kWiG" "kWaG" "kWEG" "kWG" "" "" ;; 176
1628 "KeG" "KuG" "KiG" "KaG" "KEG" "KG" "KoG" "" ;; 184
1629 "KWeG" "" "KWiG" "KWaG" "KWEG" "KWG" "" "" ;; 192
1630 "weG" "wuG" "wiG" "waG" "wEG" "wG" "woG" "" ;; 200
1631 "eeG" "uuG" "iiG" "aaG" "EEG" "IIG" "ooG" "" ;; 208
1632 "zeG" "zuG" "ziG" "zaG" "zEG" "zG" "zoG" "zWaG" ;; 216
1633 "ZeG" "ZuG" "ZiG" "ZaG" "ZEG" "ZG" "ZoG" "ZWaG" ;; 224
1634 "yeG" "yuG" "yiG" "yaG" "yEG" "yG" "yoG" "yWaG" ;; 232
1635 "deG" "duG" "diG" "daG" "dEG" "dG" "doG" "dWaG" ;; 240
1636 "DeG" "DuG" "DiG" "DaG" "DEG" "DG" "DoG" "DWaG" ;; 248
1637 "jeG" "juG" "jiG" "jaG" "jEG" "jG" "joG" "jWaG" ;; 256
1638 "geG" "guG" "giG" "gaG" "gEG" "gG" "goG" "" ;; 264
1639 "gWeG" "" "gWiG" "gWaG" "gWEG" "gWG" "" "" ;; 272
1640 "GeG" "GuG" "GiG" "GaG" "GEG" "GG" "GoG" "GWaG" ;; 280
1641 "TeG" "TuG" "TiG" "TaG" "TEG" "TG" "ToG" "TWaG" ;; 288
1642 "CeG" "CuG" "CiG" "CaG" "CEG" "CG" "CoG" "CWaG" ;; 296
1643 "PeG" "PuG" "PiG" "PaG" "PEG" "PG" "PoG" "PWaG" ;; 304
1644 "SeG" "SuG" "SiG" "SaG" "SEG" "SG" "SoG" "SWaG" ;; 312
1645 "SSeG" "SSuG" "SSiG" "SSaG" "SSEG" "SSG" "SSoG" "" ;; 320
1646 "feG" "fuG" "fiG" "faG" "fEG" "fG" "foG" "fWaG" ;; 328
1647 "peG" "puG" "piG" "paG" "pEG" "pG" "poG" "pWaG" ;; 336
1648 "mYaG" "rYaG" "fYaG" "" "" "" "" "" ;; 344
1649 "" "spaceG" "periodG" "commaG" ;; 352
1650 "semicolonG" "colonG" "precolonG" "oldqmarkG" ;; 356
1651 "pbreakG" "andG" "huletG" "sostG" "aratG" "amstG" "sadstG" "sabatG" ;; 360
1652 "smntG" "zeteNG" "asrG" "heyaG" "selasaG" "arbaG" "hemsaG" "slsaG" ;; 368
1653 "sebaG" "semanyaG" "zeTanaG" "metoG" "asrxiG" "" "" "" ;; 376
1654 "qqeG" "qquG" "qqiG" "qqaG" "qqEG" "qqG" "qqoG" "" ;; 384
1655 "mWeG" "bWeG" "GWeG" "fWeG" "pWeG" "" "" "" ;; 392
1656 "kkeG" "kkuG" "kkiG" "kkaG" "kkEG" "kkG" "kkoG" "" ;; 400
1657 "mWiG" "bWiG" "GWiG" "fWiG" "pWiG" "" "" "" ;; 408
1658 "XeG" "XuG" "GXiG" "XaG" "XEG" "XG" "XoG" "" ;; 416
1659 "mWEG" "bWEG" "GWEG" "fWEG" "pWEG" "" "" "" ;; 424
1660 "ggeG" "gguG" "ggiG" "ggaG" "ggEG" "ggG" "ggoG" "" ;; 432
1661 "mWG" "bWG" "GWG" "fWG" "pWG" "" "" "" ;; 440
1662 "ornamentG" "flandG" "iflandG" "africaG" ;; 448
1663 "iafricaG" "wWeG" "wWiG" "wWaG" ;; 452
1664 "wWEG" "wWG" "" "slaqG" "dotG" "lquoteG" "rquoteG" "qmarkG" ]) ;; 456
1665
1666;;
1667;; To make tex-to-fidel mapping.
1668;; The following code makes
1669;; (get 'ethio-tex-command-he 'ethio-fidel-char) ==> ?$(3!!(B
1670;; etc.
1671;;
1672
1673(let ((i 0) str)
1674 (while (< i (length ethio-fidel-to-tex-map))
1675 (setq str (aref ethio-fidel-to-tex-map i))
1676 (if (not (string= str ""))
1677 (put
1678 (intern (concat "ethio-tex-command-" (aref ethio-fidel-to-tex-map i)))
1679 'ethio-fidel-char
1680 (ethio-ethiocode-to-char i)))
1681 (setq i (1+ i))))
1682
1683;;;###autoload 783;;;###autoload
1684(defun ethio-fidel-to-tex-buffer nil 784(defun ethio-fidel-to-tex-buffer nil
1685 "Convert each fidel characters in the current buffer into a fidel-tex command. 785 "Convert each fidel characters in the current buffer into a fidel-tex command."
1686Each command is always surrounded by braces."
1687 (interactive) 786 (interactive)
1688 (let ((buffer-read-only nil)) 787 (let ((buffer-read-only nil)
788 comp ch)
1689 789
1690 ;; Isolated gemination marks need special treatement 790 ;; Special treatment for geminated characters.
791 ;; Geminated characters la", etc. change into \geminateG{\laG}, etc.
1691 (goto-char (point-min)) 792 (goto-char (point-min))
1692 (while (search-forward "$(3%s(B" nil t) 793 (while (search-forward "" nil t)
1693 (replace-match "\\geminateG{}" t t)) 794 (setq comp (find-composition (match-beginning 0)))
1694 795 (if (null comp)
1695 ;; First, decompose geminations 796 (replace-match "\\\\geminateG{}" t)
1696 ;; Here we assume that each composed character consists of 797 (decompose-region (car comp) (cadr comp))
1697 ;; one Ethiopic character and the Ethiopic gemination mark. 798 (delete-char -1)
1698 (decompose-region (point-min) (point-max)) 799 (forward-char -1)
800 (insert "\\geminateG{")
801 (forward-char 1)
802 (insert "}")))
1699 803
1700 ;; Special treatment for geminated characters 804 ;; Special Ethiopic punctuations.
1701 ;; The geminated character (la'') will be "\geminateG{\la}".
1702 (goto-char (point-min)) 805 (goto-char (point-min))
1703 (while (search-forward "$(3%s(B" nil t) 806 (while (re-search-forward "\\ce[»\\.\\?]\\|«\\ce" nil t)
1704 (delete-backward-char 1) 807 (cond
1705 (backward-char 1) 808 ((= (setq ch (preceding-char)) ?\»)
1706 (insert "\\geminateG") 809 (delete-char -1)
1707 (forward-char 1)) 810 (insert "\\rquoteG"))
811 ((= ch ?.)
812 (delete-char -1)
813 (insert "\\dotG"))
814 ((= ch ??)
815 (delete-char -1)
816 (insert "\\qmarkG"))
817 (t
818 (forward-char -1)
819 (delete-char -1)
820 (insert "\\lquoteG")
821 (forward-char 1))))
1708 822
1709 ;; Ethiopic characters to TeX macros 823 ;; Ethiopic characters to TeX macros
1710 (goto-char (point-min)) 824 (robin-invert-region (point-min) (point-max) "ethiopic-tex")
1711 (while (re-search-forward "\\ce" nil t) 825
1712 (insert
1713 "{\\"
1714 (aref ethio-fidel-to-tex-map
1715 (prog1 (ethio-char-to-ethiocode (preceding-char))
1716 (backward-delete-char 1)))
1717 "}"))
1718 (goto-char (point-min)) 826 (goto-char (point-min))
1719 (set-buffer-modified-p nil))) 827 (set-buffer-modified-p nil)))
1720 828
@@ -1725,43 +833,18 @@ Each command is always surrounded by braces."
1725 (let ((buffer-read-only nil) 833 (let ((buffer-read-only nil)
1726 (p) (ch)) 834 (p) (ch))
1727 835
1728 ;; Special treatment for gemination
1729 ;; "\geminateG{\la}" or "\geminateG{{\la}}" will be "\la$(3%s(B"
1730 ;; "\geminateG{}" remains unchanged.
1731 (goto-char (point-min))
1732 (while (re-search-forward "\\\\geminateG{\\(\\\\[a-zA-Z]+\\)}" nil t)
1733 (replace-match "\\1$(3%s(B"))
1734
1735 ;; TeX macros to Ethiopic characters 836 ;; TeX macros to Ethiopic characters
1736 (goto-char (point-min)) 837 (robin-convert-region (point-min) (point-max) "ethiopic-tex")
1737 (while (search-forward "\\" nil t)
1738 (setq p (point))
1739 (skip-chars-forward "a-zA-Z")
1740 (setq ch
1741 (get (intern (concat "ethio-tex-command-"
1742 (buffer-substring p (point))))
1743 'ethio-fidel-char))
1744 (if ch
1745 (progn
1746 (delete-region (1- p) (point)) ; don't forget the preceding "\"
1747 (if (and (= (preceding-char) ?{)
1748 (= (following-char) ?}))
1749 (progn
1750 (backward-delete-char 1)
1751 (delete-char 1)))
1752 (insert ch))))
1753 838
1754 ;; compose geminated characters 839 ;; compose geminated characters
1755 (goto-char (point-min)) 840 (goto-char (point-min))
1756 (while (re-search-forward "\\ce$(3%s(B" nil 0) 841 (while (re-search-forward "\\\\geminateG{\\(\\ce?\\)}" nil t)
1757 (compose-region 842 (replace-match "\\1"))
1758 (save-excursion (backward-char 2) (point))
1759 (point)))
1760 843
1761 ;; Now it's time to convert isolated gemination marks. 844 ;; remove redundant braces, if any
1762 (goto-char (point-min)) 845 (goto-char (point-min))
1763 (while (search-forward "\\geminateG{}" nil t) 846 (while (re-search-forward "{\\(\\ce\\)}" nil t)
1764 (replace-match "$(3%s(B")) 847 (replace-match "\\1"))
1765 848
1766 (goto-char (point-min)) 849 (goto-char (point-min))
1767 (set-buffer-modified-p nil))) 850 (set-buffer-modified-p nil)))
@@ -1781,47 +864,24 @@ If `ethio-java-save-lowercase' is non-nil, use [0-9a-f].
1781Otherwise, [0-9A-F]." 864Otherwise, [0-9A-F]."
1782 (let ((ucode)) 865 (let ((ucode))
1783 866
1784 ;; first, decompose geminations
1785 (decompose-region (point-min) (point-max))
1786
1787 (goto-char (point-min)) 867 (goto-char (point-min))
1788 (while (re-search-forward "\\ce" nil t) 868 (while (re-search-forward "[ሀ-፼]" nil t)
1789 (setq ucode (+ ?\x1200 (ethio-char-to-ethiocode (preceding-char)))) 869 (setq ucode (preceding-char))
1790 (if (> ucode ?\x13bc)
1791 (setq ucode (+ ucode 59952)))
1792 (delete-backward-char 1) 870 (delete-backward-char 1)
1793 (if ethio-java-save-lowercase 871 (insert
1794 (insert (format "\\u%4x" ucode)) 872 (format (if ethio-java-save-lowercase "\\u%4x" "\\u%4X")
1795 (insert (upcase (format "\\u%4x" ucode))))))) 873 ucode)))))
1796 874
1797;;;###autoload 875;;;###autoload
1798(defun ethio-java-to-fidel-buffer nil 876(defun ethio-java-to-fidel-buffer nil
1799 "Convert the Java escape sequences into corresponding Ethiopic characters." 877 "Convert the Java escape sequences into corresponding Ethiopic characters."
1800 (let ((ucode)) 878 (let ((case-fold-search t)
1801 (goto-char (point-min)) 879 (ucode))
1802 (while (re-search-forward "\\\\u\\([0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]\\)" nil t)
1803 (setq ucode
1804 (read
1805 (concat
1806 "?\\x"
1807 (buffer-substring (match-beginning 1) (match-end 1)))))
1808 (cond
1809 ((and (>= ucode ?\x1200) (<= ucode ?\x13bc))
1810 (replace-match "")
1811 (insert (ethio-ethiocode-to-char (- ucode ?\x1200))))
1812 ((and (>= ucode ?\xfdf1) (<= ucode ?\xfdff))
1813 (replace-match "")
1814 (insert (ethio-ethiocode-to-char (- ucode 64560))))
1815 (t
1816 nil)))
1817
1818 ;; gemination
1819 (goto-char (point-min)) 880 (goto-char (point-min))
1820 (while (re-search-forward "\\ce$(3%s(B" nil 0) 881 (while (re-search-forward "\\\\u\\([0-9a-f][0-9a-f][0-9a-f][0-9a-f]\\)" nil t)
1821 (compose-region 882 (setq ucode (read (concat "#x" (match-string 1))))
1822 (save-excursion (backward-char 2) (point)) 883 (when (and (>= ucode #x1200) (<= ucode #x137f))
1823 (point))) 884 (replace-match (char-to-string ucode))))))
1824 ))
1825 885
1826;; 886;;
1827;; file I/O hooks 887;; file I/O hooks
@@ -1829,7 +889,7 @@ Otherwise, [0-9A-F]."
1829 889
1830;;;###autoload 890;;;###autoload
1831(defun ethio-find-file nil 891(defun ethio-find-file nil
1832 "Transcribe file content into Ethiopic depending on filename suffix." 892 "Transliterate file content into Ethiopic dependig on filename suffix."
1833 (cond 893 (cond
1834 894
1835 ((string-match "\\.sera$" (buffer-file-name)) 895 ((string-match "\\.sera$" (buffer-file-name))
@@ -1842,10 +902,10 @@ Otherwise, [0-9A-F]."
1842 (save-excursion 902 (save-excursion
1843 (ethio-sera-to-fidel-marker 'force) 903 (ethio-sera-to-fidel-marker 'force)
1844 (goto-char (point-min)) 904 (goto-char (point-min))
1845 (while (re-search-forward "&[lr]aquote;" nil t) 905 (while (re-search-forward "&[lr]aquo;" nil t)
1846 (if (= (char-after (1+ (match-beginning 0))) ?l) 906 (if (= (char-after (1+ (match-beginning 0))) ?l)
1847 (replace-match "$(3%v(B") 907 (replace-match "«")
1848 (replace-match "$(3%w(B"))) 908 (replace-match "»")))
1849 (set-buffer-modified-p nil)))) 909 (set-buffer-modified-p nil))))
1850 910
1851 ((string-match "\\.tex$" (buffer-file-name)) 911 ((string-match "\\.tex$" (buffer-file-name))
@@ -1863,7 +923,7 @@ Otherwise, [0-9A-F]."
1863 923
1864;;;###autoload 924;;;###autoload
1865(defun ethio-write-file nil 925(defun ethio-write-file nil
1866 "Transcribe Ethiopic characters in ASCII depending on the file extension." 926 "Transliterate Ethiopic characters in ASCII depending on the file extension."
1867 (cond 927 (cond
1868 928
1869 ((string-match "\\.sera$" (buffer-file-name)) 929 ((string-match "\\.sera$" (buffer-file-name))
@@ -1875,17 +935,14 @@ Otherwise, [0-9A-F]."
1875 935
1876 ((string-match "\\.html$" (buffer-file-name)) 936 ((string-match "\\.html$" (buffer-file-name))
1877 (save-excursion 937 (save-excursion
1878 (let ((ethio-sera-being-called-by-w3 t) 938 (let ((ethio-sera-being-called-by-w3 t))
1879 (lq (aref ethio-fidel-to-sera-map 461))
1880 (rq (aref ethio-fidel-to-sera-map 462)))
1881 (aset ethio-fidel-to-sera-map 461 "&laquote;")
1882 (aset ethio-fidel-to-sera-map 462 "&raquote;")
1883 (ethio-fidel-to-sera-marker 'force) 939 (ethio-fidel-to-sera-marker 'force)
1884 (goto-char (point-min)) 940 (goto-char (point-min))
941 (while (re-search-forward "[«»]" nil t)
942 (replace-match (if (= (preceding-char) ?«) "&laquo;" "&raquo;")))
943 (goto-char (point-min))
1885 (if (search-forward "<sera>" nil t) 944 (if (search-forward "<sera>" nil t)
1886 (ethio-record-user-preference)) 945 (ethio-record-user-preference))
1887 (aset ethio-fidel-to-sera-map 461 lq)
1888 (aset ethio-fidel-to-sera-map 462 rq)
1889 (set-buffer-modified-p nil)))) 946 (set-buffer-modified-p nil))))
1890 947
1891 ((string-match "\\.tex$" (buffer-file-name)) 948 ((string-match "\\.tex$" (buffer-file-name))
@@ -1902,11 +959,8 @@ Otherwise, [0-9A-F]."
1902 nil))) 959 nil)))
1903 960
1904(defun ethio-record-user-preference nil 961(defun ethio-record-user-preference nil
1905 (if (looking-at "\\\\~\\(tir?\\|amh?\\) ")
1906 (goto-char (match-end 0))
1907 (insert (if (ethio-prefer-amharic-p) "\\~amh " "\\~tir ")))
1908 (insert (if ethio-use-colon-for-colon "\\~-: " "\\~`: ") 962 (insert (if ethio-use-colon-for-colon "\\~-: " "\\~`: ")
1909 (if ethio-use-three-dot-question "\\~`| " "\\~`? "))) 963 (if ethio-use-three-dot-question "\\~`| " "\\~? ")))
1910 964
1911;; 965;;
1912;; Ethiopic word separator vs. ASCII space 966;; Ethiopic word separator vs. ASCII space
@@ -1919,10 +973,7 @@ Otherwise, [0-9A-F]."
1919 "Toggle ASCII space and Ethiopic separator for keyboard input." 973 "Toggle ASCII space and Ethiopic separator for keyboard input."
1920 (interactive) 974 (interactive)
1921 (setq ethio-prefer-ascii-space 975 (setq ethio-prefer-ascii-space
1922 (not ethio-prefer-ascii-space)) 976 (not ethio-prefer-ascii-space)))
1923 (if (equal current-input-method "ethiopic")
1924 (setq current-input-method-title (quail-title)))
1925 (force-mode-line-update))
1926 977
1927(defun ethio-insert-space (arg) 978(defun ethio-insert-space (arg)
1928 "Insert ASCII spaces or Ethiopic word separators depending on context. 979 "Insert ASCII spaces or Ethiopic word separators depending on context.
@@ -1945,68 +996,1020 @@ many Ethiopic word separators."
1945 ((save-excursion 996 ((save-excursion
1946 (skip-chars-backward " ") 997 (skip-chars-backward " ")
1947 (memq (preceding-char) 998 (memq (preceding-char)
1948 '(?$(3$h(B ?$(3$i(B ?$(3$j(B ?$(3$k(B ?$(3$l(B ?$(3$m(B ?$(3$n(B ?$(3$o(B ?$(3%t(B ?$(3%u(B ?$(3%v(B ?$(3%w(B ?$(3%x(B))) 999 '(?፡ ?። ?፣ ?፤ ?፥ ?፦ ?፧ ?፨ ? ? ? ? ?)))
1949 (insert-char 32 arg)) 1000 (insert-char 32 arg))
1950 (t 1001 (t
1951 (insert-char ?$(3$h(B arg)))) 1002 (insert-char ? arg))))
1952 1003
1004;;;###autoload
1953(defun ethio-insert-ethio-space (arg) 1005(defun ethio-insert-ethio-space (arg)
1954 "Insert the Ethiopic word delimiter (the colon-like character). 1006 "Insert the Ethiopic word delimiter (the colon-like character).
1955With ARG, insert that many delimiters." 1007With ARG, insert that many delimiters."
1956 (interactive "*p") 1008 (interactive "*p")
1957 (insert-char ?$(3$h(B arg)) 1009 (insert-char ?፡ arg))
1958
1959;;
1960;; Ethiopic punctuation vs. ASCII punctuation
1961;;
1962
1963(defvar ethio-prefer-ascii-punctuation nil)
1964(make-variable-buffer-local 'ethio-prefer-ascii-punctuation)
1965
1966(defun ethio-toggle-punctuation nil
1967 "Toggle Ethiopic punctuations and ASCII punctuations for keyboard input."
1968 (interactive)
1969 (setq ethio-prefer-ascii-punctuation
1970 (not ethio-prefer-ascii-punctuation))
1971 (let* ((keys '("." ".." "..." "," ",," ";" ";;" ":" "::" ":::" "*" "**"))
1972 (puncs
1973 (if ethio-prefer-ascii-punctuation
1974 '(?. [".."] ["..."] ?, [",,"] ?\; [";;"] ?: ["::"] [":::"] ?* ["**"])
1975 '(?$(3$i(B ?$(3%u(B ?. ?$(3$j(B ?, ?$(3$k(B ?\; ?$(3$h(B ?$(3$i(B ?: ?* ?$(3$o(B))))
1976 (while keys
1977 (quail-defrule (car keys) (car puncs) "ethiopic")
1978 (setq keys (cdr keys)
1979 puncs (cdr puncs)))
1980 (if (equal current-input-method "ethiopic")
1981 (setq current-input-method-title (quail-title)))
1982 (force-mode-line-update)))
1983 1010
1984;; 1011;;
1985;; Gemination 1012;; Gemination
1986;; 1013;;
1987 1014
1015;;;###autoload
1016(defun ethio-composition-function (pos &optional string)
1017 (setq pos (1- pos))
1018 (let ((pattern "\\ce"))
1019 (if string
1020 (if (and (>= pos 0)
1021 (eq (string-match pattern string pos) pos))
1022 (prog1 (match-end 0)
1023 (compose-string string pos (match-end 0))))
1024 (if (>= pos (point-min))
1025 (progn
1026 (goto-char pos)
1027 (if (looking-at pattern)
1028 (prog1 (match-end 0)
1029 (compose-region pos (match-end 0)))))))))
1030
1031;; This function is not used any more.
1988(defun ethio-gemination nil 1032(defun ethio-gemination nil
1989 "Compose the character before the point with the Ethiopic gemination mark. 1033 "Compose the character before the point with the Ethiopic gemination mark.
1990If the character is already composed, decompose it and remove the gemination 1034If the character is already composed, decompose it and remove the gemination
1991mark." 1035mark."
1992 (interactive "*") 1036 (interactive "*")
1993 (cond 1037 (let ((ch (preceding-char)))
1994 ((eq (char-charset (preceding-char)) 'ethiopic) 1038 (cond
1995 (insert "$(3%s(B") 1039 ((and (= ch ?) (find-composition (1- (point))))
1996 (compose-region 1040 (decompose-region (- (point) 2) (point)))
1997 (save-excursion (backward-char 2) (point)) 1041 ((and (>= ch #x1200) (<= ch #x137f))
1998 (point)) 1042 (insert "")
1999 (forward-char 1)) 1043 (compose-region (- (point) 2) (point)))
2000 ((eq (char-charset (preceding-char)) 'leading-code-composition) 1044 (t
2001 (decompose-region 1045 (error "")))))
2002 (save-excursion (backward-char 1) (point)) 1046
2003 (point)) 1047;;;
2004 (delete-backward-char 1)) 1048;;; Robin packages
2005 (t 1049;;;
2006 (error "")))) 1050
1051(robin-define-package "ethiopic-sera"
1052 "SERA transliteration system for Ethiopic."
1053
1054 ("he" ?ሀ)
1055 ("hu" ?ሁ)
1056 ("hi" ?ሂ)
1057 ("ha" ?ሃ)
1058 ("hE" ?ሄ) ("hee" "ሄ")
1059 ("h" ?ህ)
1060 ("ho" ?ሆ)
1061
1062 ("le" ?ለ) ("Le" "ለ")
1063 ("lu" ?ሉ) ("Lu" "ሉ")
1064 ("li" ?ሊ) ("Li" "ሊ")
1065 ("la" ?ላ) ("La" "ላ")
1066 ("lE" ?ሌ) ("LE" "ሌ") ("lee" "ሌ") ("Lee" "ሌ")
1067 ("l" ?ል) ("L" "ል")
1068 ("lo" ?ሎ) ("Lo" "ሎ")
1069 ("lWa" ?ሏ) ("LWa" "ሏ") ("lW" "ሏ") ("LW" "ሏ")
1070
1071 ("He" ?ሐ)
1072 ("Hu" ?ሑ)
1073 ("Hi" ?ሒ)
1074 ("Ha" ?ሓ)
1075 ("HE" ?ሔ) ("Hee" "ሔ")
1076 ("H" ?ሕ)
1077 ("Ho" ?ሖ)
1078 ("HWa" ?ሗ) ("HW" "ሗ")
1079
1080 ("me" ?መ) ("Me" "መ")
1081 ("mu" ?ሙ) ("Mu" "ሙ")
1082 ("mi" ?ሚ) ("Mi" "ሚ")
1083 ("ma" ?ማ) ("Ma" "ማ")
1084 ("mE" ?ሜ) ("ME" "ሜ") ("mee" "ሜ") ("Mee" "ሜ")
1085 ("m" ?ም) ("M" "ም")
1086 ("mo" ?ሞ) ("Mo" "ሞ")
1087 ("mWa" ?ሟ) ("MWa" "ሟ") ("mW" "ሟ") ("MW" "ሟ")
1088
1089 ("`se" ?ሠ) ("sse" "ሠ") ("s2e" "ሠ")
1090 ("`su" ?ሡ) ("ssu" "ሡ") ("s2u" "ሡ")
1091 ("`si" ?ሢ) ("ssi" "ሢ") ("s2i" "ሢ")
1092 ("`sa" ?ሣ) ("ssa" "ሣ") ("s2a" "ሣ")
1093 ("`sE" ?ሤ) ("ssE" "ሤ") ("s2E" "ሤ")
1094 ("`see" "ሤ") ("ssee" "ሤ") ("s2ee" "ሤ")
1095 ("`s" ?ሥ) ("ss" "ሥ") ("s2" "ሥ")
1096 ("`so" ?ሦ) ("sso" "ሦ") ("s2o" "ሦ")
1097 ("`sWa" ?ሧ) ("ssWa" "ሧ") ("s2Wa" "ሧ")
1098 ("`sW" "ሧ") ("ssW" "ሧ") ("s2W" "ሧ")
1099
1100 ("re" ?ረ) ("Re" "ረ")
1101 ("ru" ?ሩ) ("Ru" "ሩ")
1102 ("ri" ?ሪ) ("Ri" "ሪ")
1103 ("ra" ?ራ) ("Ra" "ራ")
1104 ("rE" ?ሬ) ("RE" "ሬ") ("ree" "ሬ") ("Ree" "ሬ")
1105 ("r" ?ር) ("R" "ር")
1106 ("ro" ?ሮ) ("Ro" "ሮ")
1107 ("rWa" ?ሯ) ("RWa" "ሯ") ("rW" "ሯ") ("RW" "ሯ")
1108
1109 ("se" ?ሰ)
1110 ("su" ?ሱ)
1111 ("si" ?ሲ)
1112 ("sa" ?ሳ)
1113 ("sE" ?ሴ) ("see" "ሴ")
1114 ("s" ?ስ)
1115 ("so" ?ሶ)
1116 ("sWa" ?ሷ) ("sW" "ሷ")
1117
1118 ("xe" ?ሸ)
1119 ("xu" ?ሹ)
1120 ("xi" ?ሺ)
1121 ("xa" ?ሻ)
1122 ("xE" ?ሼ) ("xee" "ሼ")
1123 ("x" ?ሽ)
1124 ("xo" ?ሾ)
1125 ("xWa" ?ሿ) ("xW" "ሿ")
1126
1127 ("qe" ?ቀ)
1128 ("qu" ?ቁ)
1129 ("qi" ?ቂ)
1130 ("qa" ?ቃ)
1131 ("qE" ?ቄ) ("qee" "ቄ")
1132 ("q" ?ቅ)
1133 ("qo" ?ቆ)
1134 ("qWe" ?ቈ)
1135 ("qWi" ?ቊ)
1136 ("qWa" ?ቋ) ("qW" "ቋ")
1137 ("qWE" ?ቌ) ("qWee" "ቌ")
1138 ("qW'" ?ቍ) ("qWu" "ቍ")
1139
1140 ("Qe" ?ቐ)
1141 ("Qu" ?ቑ)
1142 ("Qi" ?ቒ)
1143 ("Qa" ?ቓ)
1144 ("QE" ?ቔ) ("Qee" "ቔ")
1145 ("Q" ?ቕ)
1146 ("Qo" ?ቖ)
1147 ("QWe" ?ቘ)
1148 ("QWi" ?ቚ)
1149 ("QWa" ?ቛ) ("QW" "ቛ")
1150 ("QWE" ?ቜ) ("QWee" "ቜ")
1151 ("QW'" ?ቝ) ("QWu" "ቝ")
1152
1153 ("be" ?በ) ("Be" "በ")
1154 ("bu" ?ቡ) ("Bu" "ቡ")
1155 ("bi" ?ቢ) ("Bi" "ቢ")
1156 ("ba" ?ባ) ("Ba" "ባ")
1157 ("bE" ?ቤ) ("BE" "ቤ") ("bee" "ቤ") ("Bee" "ቤ")
1158 ("b" ?ብ) ("B" "ብ")
1159 ("bo" ?ቦ) ("Bo" "ቦ")
1160 ("bWa" ?ቧ) ("BWa" "ቧ") ("bW" "ቧ") ("BW" "ቧ")
1161
1162 ("ve" ?ቨ) ("Ve" "ቨ")
1163 ("vu" ?ቩ) ("Vu" "ቩ")
1164 ("vi" ?ቪ) ("Vi" "ቪ")
1165 ("va" ?ቫ) ("Va" "ቫ")
1166 ("vE" ?ቬ) ("VE" "ቬ") ("vee" "ቬ") ("Vee" "ቬ")
1167 ("v" ?ቭ) ("V" "ቭ")
1168 ("vo" ?ቮ) ("Vo" "ቮ")
1169 ("vWa" ?ቯ) ("VWa" "ቯ") ("vW" "ቯ") ("VW" "ቯ")
1170
1171 ("te" ?ተ)
1172 ("tu" ?ቱ)
1173 ("ti" ?ቲ)
1174 ("ta" ?ታ)
1175 ("tE" ?ቴ) ("tee" "ቴ")
1176 ("t" ?ት)
1177 ("to" ?ቶ)
1178 ("tWa" ?ቷ) ("tW" "ቷ")
1179
1180 ("ce" ?ቸ)
1181 ("cu" ?ቹ)
1182 ("ci" ?ቺ)
1183 ("ca" ?ቻ)
1184 ("cE" ?ቼ) ("cee" "ቼ")
1185 ("c" ?ች)
1186 ("co" ?ቾ)
1187 ("cWa" ?ቿ) ("cW" "ቿ")
1188
1189 ("`he" ?ኀ) ("hhe" "ኀ") ("h2e" "ኀ")
1190 ("`hu" ?ኁ) ("hhu" "ኁ") ("h2u" "ኁ")
1191 ("`hi" ?ኂ) ("hhi" "ኂ") ("h2i" "ኂ")
1192 ("`ha" ?ኃ) ("hha" "ኃ") ("h2a" "ኃ")
1193 ("`hE" ?ኄ) ("hhE" "ኄ") ("h2E" "ኄ")
1194 ("`hee" "ኄ") ("hhee" "ኄ") ("h2ee" "ኄ")
1195 ("`h" ?ኅ) ("hh" "ኅ") ("h2" "ኅ")
1196 ("`ho" ?ኆ) ("hho" "ኆ") ("h2o" "ኆ")
1197 ("`hWe" ?ኈ) ("hhWe" "ኈ") ("h2We" "ኈ") ("hWe" "ኈ")
1198 ("`hWi" ?ኊ) ("hhWi" "ኊ") ("h2Wi" "ኊ") ("hWi" "ኊ")
1199 ("`hWa" ?ኋ) ("hhWa" "ኋ") ("h2Wa" "ኋ") ("hWa" "ኋ")
1200 ("`hW" "ኋ") ("hhW" "ኋ") ("h2W" "ኋ")
1201 ("`hWE" ?ኌ) ("hhWE" "ኌ") ("h2WE" "ኌ") ("hWE" "ኌ")
1202 ("`hWee" "ኌ") ("hhWee" "ኌ") ("h2Wee" "ኌ") ("hWee" "ኌ")
1203 ("`hW'" ?ኍ) ("hhW'" "ኍ") ("h2W'" "ኍ") ("hW'" "ኍ")
1204 ("`hWu" "ኍ") ("hhWu" "ኍ") ("h2Wu" "ኍ") ("hWu" "ኍ")
1205
1206 ("ne" ?ነ)
1207 ("nu" ?ኑ)
1208 ("ni" ?ኒ)
1209 ("na" ?ና)
1210 ("nE" ?ኔ) ("nee" "ኔ")
1211 ("n" ?ን)
1212 ("no" ?ኖ)
1213 ("nWa" ?ኗ) ("nW" "ኗ")
1214
1215 ("Ne" ?ኘ)
1216 ("Nu" ?ኙ)
1217 ("Ni" ?ኚ)
1218 ("Na" ?ኛ)
1219 ("NE" ?ኜ) ("Nee" "ኜ")
1220 ("N" ?ኝ)
1221 ("No" ?ኞ)
1222 ("NWa" ?ኟ) ("NW" "ኟ")
1223
1224 ("'A" ?አ) ("A" "አ")
1225 ("'u" ?ኡ) ("u" "ኡ") ("'U" "ኡ") ("U" "ኡ")
1226 ("'i" ?ኢ) ("i" "ኢ")
1227 ("'a" ?ኣ) ("a" "ኣ")
1228 ("'E" ?ኤ) ("E" "ኤ")
1229 ("'I" ?እ) ("I" "እ") ("'e" "እ") ("e" "እ")
1230 ("'o" ?ኦ) ("o" "ኦ") ("'O" "ኦ") ("O" "ኦ")
1231 ("'ea" ?ኧ) ("ea" "ኧ")
1232
1233 ("ke" ?ከ)
1234 ("ku" ?ኩ)
1235 ("ki" ?ኪ)
1236 ("ka" ?ካ)
1237 ("kE" ?ኬ) ("kee" "ኬ")
1238 ("k" ?ክ)
1239 ("ko" ?ኮ)
1240 ("kWe" ?ኰ)
1241 ("kWi" ?ኲ)
1242 ("kWa" ?ኳ) ("kW" "ኳ")
1243 ("kWE" ?ኴ) ("kWee" "ኴ")
1244 ("kW'" ?ኵ) ("kWu" "ኵ")
1245
1246 ("Ke" ?ኸ)
1247 ("Ku" ?ኹ)
1248 ("Ki" ?ኺ)
1249 ("Ka" ?ኻ)
1250 ("KE" ?ኼ) ("Kee" "ኼ")
1251 ("K" ?ኽ)
1252 ("Ko" ?ኾ)
1253 ("KWe" ?ዀ)
1254 ("KWi" ?ዂ)
1255 ("KWa" ?ዃ) ("KW" "ዃ")
1256 ("KWE" ?ዄ) ("KWee" "ዄ")
1257 ("KW'" ?ዅ) ("KWu" "ዅ")
1258
1259 ("we" ?ወ)
1260 ("wu" ?ዉ)
1261 ("wi" ?ዊ)
1262 ("wa" ?ዋ)
1263 ("wE" ?ዌ) ("wee" "ዌ")
1264 ("w" ?ው)
1265 ("wo" ?ዎ)
1266
1267 ("`e" ?ዐ) ("ae" "ዐ") ("aaa" "ዐ") ("e2" "ዐ")
1268 ("`u" ?ዑ) ("uu" "ዑ") ("u2" "ዑ") ("`U" "ዑ") ("UU" "ዑ") ("U2" "ዑ")
1269 ("`i" ?ዒ) ("ii" "ዒ") ("i2" "ዒ")
1270 ("`a" ?ዓ) ("aa" "ዓ") ("a2" "ዓ") ("`A" "ዓ") ("AA" "ዓ") ("A2" "ዓ")
1271 ("`E" ?ዔ) ("EE" "ዔ") ("E2" "ዔ")
1272 ("`I" ?ዕ) ("II" "ዕ") ("I2" "ዕ") ("ee" "ዕ")
1273 ("`o" ?ዖ) ("oo" "ዖ") ("o2" "ዖ") ("`O" "ዖ") ("OO" "ዖ") ("O2" "ዖ")
1274
1275 ("ze" ?ዘ)
1276 ("zu" ?ዙ)
1277 ("zi" ?ዚ)
1278 ("za" ?ዛ)
1279 ("zE" ?ዜ) ("zee" "ዜ")
1280 ("z" ?ዝ)
1281 ("zo" ?ዞ)
1282 ("zWa" ?ዟ) ("zW" "ዟ")
1283
1284 ("Ze" ?ዠ)
1285 ("Zu" ?ዡ)
1286 ("Zi" ?ዢ)
1287 ("Za" ?ዣ)
1288 ("ZE" ?ዤ) ("Zee" "ዤ")
1289 ("Z" ?ዥ)
1290 ("Zo" ?ዦ)
1291 ("ZWa" ?ዧ) ("ZW" "ዧ")
1292
1293 ("ye" ?የ) ("Ye" "የ")
1294 ("yu" ?ዩ) ("Yu" "ዩ")
1295 ("yi" ?ዪ) ("Yi" "ዪ")
1296 ("ya" ?ያ) ("Ya" "ያ")
1297 ("yE" ?ዬ) ("YE" "ዬ") ("yee" "ዬ") ("Yee" "ዬ")
1298 ("y" ?ይ) ("Y" "ይ")
1299 ("yo" ?ዮ) ("Yo" "ዮ")
1300
1301 ("de" ?ደ)
1302 ("du" ?ዱ)
1303 ("di" ?ዲ)
1304 ("da" ?ዳ)
1305 ("dE" ?ዴ) ("dee" "ዴ")
1306 ("d" ?ድ)
1307 ("do" ?ዶ)
1308 ("dWa" ?ዷ) ("dW" "ዷ")
1309
1310 ("De" ?ዸ)
1311 ("Du" ?ዹ)
1312 ("Di" ?ዺ)
1313 ("Da" ?ዻ)
1314 ("DE" ?ዼ) ("Dee" "ዼ")
1315 ("D" ?ዽ)
1316 ("Do" ?ዾ)
1317 ("DWa" ?ዿ) ("DW" "ዿ")
1318
1319 ("je" ?ጀ) ("Je" "ጀ")
1320 ("ju" ?ጁ) ("Ju" "ጁ")
1321 ("ji" ?ጂ) ("Ji" "ጂ")
1322 ("ja" ?ጃ) ("Ja" "ጃ")
1323 ("jE" ?ጄ) ("JE" "ጄ") ("jee" "ጄ") ("Jee" "ጄ")
1324 ("j" ?ጅ) ("J" "ጅ")
1325 ("jo" ?ጆ) ("Jo" "ጆ")
1326 ("jWa" ?ጇ) ("jW" "ጇ") ("JWa" "ጇ") ("JW" "ጇ")
1327
1328 ("ge" ?ገ)
1329 ("gu" ?ጉ)
1330 ("gi" ?ጊ)
1331 ("ga" ?ጋ)
1332 ("gE" ?ጌ) ("gee" "ጌ")
1333 ("g" ?ግ)
1334 ("go" ?ጎ)
1335 ("gWe" ?ጐ)
1336 ("gWi" ?ጒ)
1337 ("gWa" ?ጓ) ("gW" "ጓ")
1338 ("gWE" ?ጔ) ("gWee" "ጔ")
1339 ("gW'" ?ጕ) ("gWu" "ጕ")
1340
1341 ("Ge" ?ጘ)
1342 ("Gu" ?ጙ)
1343 ("Gi" ?ጚ)
1344 ("Ga" ?ጛ)
1345 ("GE" ?ጜ) ("Gee" "ጜ")
1346 ("G" ?ጝ)
1347 ("Go" ?ጞ)
1348
1349 ("Te" ?ጠ)
1350 ("Tu" ?ጡ)
1351 ("Ti" ?ጢ)
1352 ("Ta" ?ጣ)
1353 ("TE" ?ጤ) ("Tee" "ጤ")
1354 ("T" ?ጥ)
1355 ("To" ?ጦ)
1356 ("TWa" ?ጧ) ("TW" "ጧ")
1357
1358 ("Ce" ?ጨ)
1359 ("Cu" ?ጩ)
1360 ("Ci" ?ጪ)
1361 ("Ca" ?ጫ)
1362 ("CE" ?ጬ) ("Cee" "ጬ")
1363 ("C" ?ጭ)
1364 ("Co" ?ጮ)
1365 ("CWa" ?ጯ) ("CW" "ጯ")
1366
1367 ("Pe" ?ጰ)
1368 ("Pu" ?ጱ)
1369 ("Pi" ?ጲ)
1370 ("Pa" ?ጳ)
1371 ("PE" ?ጴ) ("Pee" "ጴ")
1372 ("P" ?ጵ)
1373 ("Po" ?ጶ)
1374 ("PWa" ?ጷ) ("PW" "ጷ")
1375
1376 ("Se" ?ጸ)
1377 ("Su" ?ጹ)
1378 ("Si" ?ጺ)
1379 ("Sa" ?ጻ)
1380 ("SE" ?ጼ) ("See" "ጼ")
1381 ("S" ?ጽ)
1382 ("So" ?ጾ)
1383 ("SWa" ?ጿ) ("`SWa" "ጿ") ("SSWa" "ጿ") ("S2Wa" "ጿ")
1384 ("SW" "ጿ") ("`SW" "ጿ") ("SSW" "ጿ") ("S2W" "ጿ")
1385
1386 ("`Se" ?ፀ) ("SSe" "ፀ") ("S2e" "ፀ")
1387 ("`Su" ?ፁ) ("SSu" "ፁ") ("S2u" "ፁ")
1388 ("`Si" ?ፂ) ("SSi" "ፂ") ("S2i" "ፂ")
1389 ("`Sa" ?ፃ) ("SSa" "ፃ") ("S2a" "ፃ")
1390 ("`SE" ?ፄ) ("SSE" "ፄ") ("S2E" "ፄ")
1391 ("`See" "ፄ") ("SSee" "ፄ") ("S2ee" "ፄ")
1392 ("`S" ?ፅ) ("SS" "ፅ") ("S2" "ፅ")
1393 ("`So" ?ፆ) ("SSo" "ፆ") ("S2o" "ፆ")
1394
1395 ("fe" ?ፈ) ("Fe" "ፈ")
1396 ("fu" ?ፉ) ("Fu" "ፉ")
1397 ("fi" ?ፊ) ("Fi" "ፊ")
1398 ("fa" ?ፋ) ("Fa" "ፋ")
1399 ("fE" ?ፌ) ("FE" "ፌ") ("fee" "ፌ") ("Fee" "ፌ")
1400 ("f" ?ፍ) ("F" "ፍ")
1401 ("fo" ?ፎ) ("Fo" "ፎ")
1402 ("fWa" ?ፏ) ("FWa" "ፏ") ("fW" "ፏ") ("FW" "ፏ")
1403
1404 ("pe" ?ፐ)
1405 ("pu" ?ፑ)
1406 ("pi" ?ፒ)
1407 ("pa" ?ፓ)
1408 ("pE" ?ፔ) ("pee" "ፔ")
1409 ("p" ?ፕ)
1410 ("po" ?ፖ)
1411 ("pWa" ?ፗ) ("pW" "ፗ")
1412
1413 ("rYa" ?ፘ) ("RYa" "ፘ") ("rY" "ፘ") ("RY" "ፘ")
1414 ("mYa" ?ፙ) ("MYa" "ፙ") ("mY" "ፙ") ("MY" "ፙ")
1415 ("fYa" ?ፚ) ("FYa" "ፚ") ("fY" "ፚ") ("FY" "ፚ")
1416
1417 (" : " ?፡) (":" "፡") ("`:" "፡")
1418 ("::" ?።) ("." "።")
1419 ("," ?፣)
1420 (";" ?፤)
1421 ("-:" ?፥)
1422 (":-" ?፦)
1423 ("`?" ?፧) ("??" "፧")
1424 (":|:" ?፨) ("**" "፨")
1425
1426 ;; Explicit syllable delimiter
1427 ("'" "")
1428
1429 ;; Quick ASCII input
1430 ("''" "'")
1431 (":::" ":")
1432 (".." ".")
1433 (",," ",")
1434 (";;" ";")
1435
1436 ("`1" ?፩)
1437 ("`2" ?፪)
1438 ("`3" ?፫)
1439 ("`4" ?፬)
1440 ("`5" ?፭)
1441 ("`6" ?፮)
1442 ("`7" ?፯)
1443 ("`8" ?፰)
1444 ("`9" ?፱)
1445 ("`10" ?፲)
1446 ("`20" ?፳)
1447 ("`30" ?፴)
1448 ("`40" ?፵)
1449 ("`50" ?፶)
1450 ("`60" ?፷)
1451 ("`70" ?፸)
1452 ("`80" ?፹)
1453 ("`90" ?፺)
1454 ("`100" ?፻)
1455 ("`10000" ?፼)
1456
1457 ("`200" "፪፻")
1458 ("`300" "፫፻")
1459 ("`400" "፬፻")
1460 ("`500" "፭፻")
1461 ("`600" "፮፻")
1462 ("`700" "፯፻")
1463 ("`800" "፰፻")
1464 ("`900" "፱፻")
1465 ("`1000" "፲፻")
1466 ("`2000" "፳፻")
1467 ("`3000" "፴፻")
1468 ("`4000" "፵፻")
1469 ("`5000" "፶፻")
1470 ("`6000" "፷፻")
1471 ("`7000" "፸፻")
1472 ("`8000" "፹፻")
1473 ("`9000" "፺፻")
1474 ("`20000" "፪፼")
1475 ("`30000" "፫፼")
1476 ("`40000" "፬፼")
1477 ("`50000" "፭፼")
1478 ("`60000" "፮፼")
1479 ("`70000" "፯፼")
1480 ("`80000" "፰፼")
1481 ("`90000" "፱፼")
1482 ("`100000" "፲፼")
1483 ("`200000" "፳፼")
1484 ("`300000" "፴፼")
1485 ("`400000" "፵፼")
1486 ("`500000" "፶፼")
1487 ("`600000" "፷፼")
1488 ("`700000" "፸፼")
1489 ("`800000" "፹፼")
1490 ("`900000" "፺፼")
1491 ("`1000000" "፻፼")
1492 )
1493
1494(register-input-method
1495 "ethiopic-sera" "Ethiopic"
1496 'robin-use-package "et" "An input method for Ethiopic.")
1497
1498(robin-define-package "ethiopic-tex"
1499 "TeX transliteration system for Ethiopic."
1500
1501 ("\\heG" ?ሀ) ; U+1200 ..
1502 ("\\huG" ?ሁ)
1503 ("\\hiG" ?ሂ)
1504 ("\\haG" ?ሃ)
1505 ("\\hEG" ?ሄ)
1506 ("\\hG" ?ህ)
1507 ("\\hoG" ?ሆ)
1508 ;; reserved
1509 ("\\leG" ?ለ)
1510 ("\\luG" ?ሉ)
1511 ("\\liG" ?ሊ)
1512 ("\\laG" ?ላ)
1513 ("\\lEG" ?ሌ)
1514 ("\\lG" ?ል)
1515 ("\\loG" ?ሎ)
1516 ("\\lWaG" ?ሏ)
1517
1518 ("\\HeG" ?ሐ) ; U+1210 ..
1519 ("\\HuG" ?ሑ)
1520 ("\\HiG" ?ሒ)
1521 ("\\HaG" ?ሓ)
1522 ("\\HEG" ?ሔ)
1523 ("\\HG" ?ሕ)
1524 ("\\HoG" ?ሖ)
1525 ("\\HWaG" ?ሗ)
1526 ("\\meG" ?መ)
1527 ("\\muG" ?ሙ)
1528 ("\\miG" ?ሚ)
1529 ("\\maG" ?ማ)
1530 ("\\mEG" ?ሜ)
1531 ("\\mG" ?ም)
1532 ("\\moG" ?ሞ)
1533 ("\\mWaG" ?ሟ)
1534
1535 ("\\sseG" ?ሠ) ; U+1220 ..
1536 ("\\ssuG" ?ሡ)
1537 ("\\ssiG" ?ሢ)
1538 ("\\ssaG" ?ሣ)
1539 ("\\ssEG" ?ሤ)
1540 ("\\ssG" ?ሥ)
1541 ("\\ssoG" ?ሦ)
1542 ("\\ssWaG" ?ሧ)
1543 ("\\reG" ?ረ)
1544 ("\\ruG" ?ሩ)
1545 ("\\riG" ?ሪ)
1546 ("\\raG" ?ራ)
1547 ("\\rEG" ?ሬ)
1548 ("\\rG" ?ር)
1549 ("\\roG" ?ሮ)
1550 ("\\rWaG" ?ሯ)
1551
1552 ("\\seG" ?ሰ) ; U+1230 ..
1553 ("\\suG" ?ሱ)
1554 ("\\siG" ?ሲ)
1555 ("\\saG" ?ሳ)
1556 ("\\sEG" ?ሴ)
1557 ("\\sG" ?ስ)
1558 ("\\soG" ?ሶ)
1559 ("\\sWaG" ?ሷ)
1560 ("\\xeG" ?ሸ)
1561 ("\\xuG" ?ሹ)
1562 ("\\xiG" ?ሺ)
1563 ("\\xaG" ?ሻ)
1564 ("\\xEG" ?ሼ)
1565 ("\\xG" ?ሽ)
1566 ("\\xoG" ?ሾ)
1567 ("\\xWaG" ?ሿ)
1568
1569 ("\\qeG" ?ቀ) ; U+1240 ..
1570 ("\\quG" ?ቁ)
1571 ("\\qiG" ?ቂ)
1572 ("\\qaG" ?ቃ)
1573 ("\\qEG" ?ቄ)
1574 ("\\qG" ?ቅ)
1575 ("\\qoG" ?ቆ)
1576 ;; reserved
1577 ("\\qWeG" ?ቈ)
1578 ;; reserved
1579 ("\\qWiG" ?ቊ)
1580 ("\\qWaG" ?ቋ)
1581 ("\\qWEG" ?ቌ)
1582 ("\\qWG" ?ቍ)
1583 ;; reserved
1584 ;; reserved
1585
1586 ("\\QeG" ?ቐ) ; U+1250 ..
1587 ("\\QuG" ?ቑ)
1588 ("\\QiG" ?ቒ)
1589 ("\\QaG" ?ቓ)
1590 ("\\QEG" ?ቔ)
1591 ("\\QG" ?ቕ)
1592 ("\\QoG" ?ቖ)
1593 ;; reserved
1594 ("\\QWeG" ?ቘ)
1595 ;; reserved
1596 ("\\QWiG" ?ቚ)
1597 ("\\QWaG" ?ቛ)
1598 ("\\QWEG" ?ቜ)
1599 ("\\QWG" ?ቝ)
1600 ;; reserved
1601 ;; reserved
1602
1603 ("\\beG" ?በ) ; U+1260 ..
1604 ("\\buG" ?ቡ)
1605 ("\\biG" ?ቢ)
1606 ("\\baG" ?ባ)
1607 ("\\bEG" ?ቤ)
1608 ("\\bG" ?ብ)
1609 ("\\boG" ?ቦ)
1610 ("\\bWaG" ?ቧ)
1611 ("\\veG" ?ቨ)
1612 ("\\vuG" ?ቩ)
1613 ("\\viG" ?ቪ)
1614 ("\\vaG" ?ቫ)
1615 ("\\vEG" ?ቬ)
1616 ("\\vG" ?ቭ)
1617 ("\\voG" ?ቮ)
1618 ("\\vWaG" ?ቯ)
1619
1620 ("\\teG" ?ተ) ; U+1270 ..
1621 ("\\tuG" ?ቱ)
1622 ("\\tiG" ?ቲ)
1623 ("\\taG" ?ታ)
1624 ("\\tEG" ?ቴ)
1625 ("\\tG" ?ት)
1626 ("\\toG" ?ቶ)
1627 ("\\tWaG" ?ቷ)
1628 ("\\ceG" ?ቸ)
1629 ("\\cuG" ?ቹ)
1630 ("\\ciG" ?ቺ)
1631 ("\\caG" ?ቻ)
1632 ("\\cEG" ?ቼ)
1633 ("\\cG" ?ች)
1634 ("\\coG" ?ቾ)
1635 ("\\cWaG" ?ቿ)
1636
1637 ("\\hheG" ?ኀ) ; U+1280 ..
1638 ("\\hhuG" ?ኁ)
1639 ("\\hhiG" ?ኂ)
1640 ("\\hhaG" ?ኃ)
1641 ("\\hhEG" ?ኄ)
1642 ("\\hhG" ?ኅ)
1643 ("\\hhoG" ?ኆ)
1644 ;; reserved
1645 ("\\hWeG" ?ኈ)
1646 ;; reserved
1647 ("\\hWiG" ?ኊ)
1648 ("\\hWaG" ?ኋ)
1649 ("\\hWEG" ?ኌ)
1650 ("\\hWG" ?ኍ)
1651 ;; reserved
1652 ;; reserved
1653
1654 ("\\neG" ?ነ) ; U+1290 ..
1655 ("\\nuG" ?ኑ)
1656 ("\\niG" ?ኒ)
1657 ("\\naG" ?ና)
1658 ("\\nEG" ?ኔ)
1659 ("\\nG" ?ን)
1660 ("\\noG" ?ኖ)
1661 ("\\nWaG" ?ኗ)
1662 ("\\NeG" ?ኘ)
1663 ("\\NuG" ?ኙ)
1664 ("\\NiG" ?ኚ)
1665 ("\\NaG" ?ኛ)
1666 ("\\NEG" ?ኜ)
1667 ("\\NG" ?ኝ)
1668 ("\\NoG" ?ኞ)
1669 ("\\NWaG" ?ኟ)
1670
1671 ("\\eG" ?አ) ; U+12A0 ..
1672 ("\\uG" ?ኡ)
1673 ("\\iG" ?ኢ)
1674 ("\\AG" ?ኣ)
1675 ("\\EG" ?ኤ)
1676 ("\\IG" ?እ)
1677 ("\\oG" ?ኦ)
1678 ("\\eaG" ?ኧ)
1679 ("\\keG" ?ከ)
1680 ("\\kuG" ?ኩ)
1681 ("\\kiG" ?ኪ)
1682 ("\\kaG" ?ካ)
1683 ("\\kEG" ?ኬ)
1684 ("\\kG" ?ክ)
1685 ("\\koG" ?ኮ)
1686 ;; reserved
1687
1688 ("\\kWeG" ?ኰ) ; U+12B0 ..
1689 ;; reserved
1690 ("\\kWiG" ?ኲ)
1691 ("\\kWaG" ?ኳ)
1692 ("\\kWEG" ?ኴ)
1693 ("\\kWG" ?ኵ)
1694 ;; reserved
1695 ;; reserved
1696 ("\\KeG" ?ኸ)
1697 ("\\KuG" ?ኹ)
1698 ("\\KiG" ?ኺ)
1699 ("\\KaG" ?ኻ)
1700 ("\\KEG" ?ኼ)
1701 ("\\KG" ?ኽ)
1702 ("\\KoG" ?ኾ)
1703 ;; reserved
1704
1705 ("\\KWeG" ?ዀ) ; U+12C0 ..
1706 ;; reserved
1707 ("\\KWiG" ?ዂ)
1708 ("\\KWaG" ?ዃ)
1709 ("\\KWEG" ?ዄ)
1710 ("\\KWG" ?ዅ)
1711 ;; reserved
1712 ;; reserved
1713 ("\\weG" ?ወ)
1714 ("\\wuG" ?ዉ)
1715 ("\\wiG" ?ዊ)
1716 ("\\waG" ?ዋ)
1717 ("\\wEG" ?ዌ)
1718 ("\\wG" ?ው)
1719 ("\\woG" ?ዎ)
1720 ;; reserved
1721
1722 ("\\eeG" ?ዐ) ; U+12D0 ..
1723 ("\\uuG" ?ዑ)
1724 ("\\iiG" ?ዒ)
1725 ("\\aaG" ?ዓ)
1726 ("\\EEG" ?ዔ)
1727 ("\\IIG" ?ዕ)
1728 ("\\ooG" ?ዖ)
1729 ;; reserved
1730 ("\\zeG" ?ዘ)
1731 ("\\zuG" ?ዙ)
1732 ("\\ziG" ?ዚ)
1733 ("\\zaG" ?ዛ)
1734 ("\\zEG" ?ዜ)
1735 ("\\zG" ?ዝ)
1736 ("\\zoG" ?ዞ)
1737 ("\\zWaG" ?ዟ)
1738
1739 ("\\ZeG" ?ዠ) ; U+12E0 ..
1740 ("\\ZuG" ?ዡ)
1741 ("\\ZiG" ?ዢ)
1742 ("\\ZaG" ?ዣ)
1743 ("\\ZEG" ?ዤ)
1744 ("\\ZG" ?ዥ)
1745 ("\\ZoG" ?ዦ)
1746 ("\\ZWaG" ?ዧ)
1747 ("\\yeG" ?የ)
1748 ("\\yuG" ?ዩ)
1749 ("\\yiG" ?ዪ)
1750 ("\\yaG" ?ያ)
1751 ("\\yEG" ?ዬ)
1752 ("\\yG" ?ይ)
1753 ("\\yoG" ?ዮ)
1754 ;; reserved
1755
1756 ("\\deG" ?ደ) ; U+12F0 ..
1757 ("\\duG" ?ዱ)
1758 ("\\diG" ?ዲ)
1759 ("\\daG" ?ዳ)
1760 ("\\dEG" ?ዴ)
1761 ("\\dG" ?ድ)
1762 ("\\doG" ?ዶ)
1763 ("\\dWaG" ?ዷ)
1764 ("\\DeG" ?ዸ)
1765 ("\\DuG" ?ዹ)
1766 ("\\DiG" ?ዺ)
1767 ("\\DaG" ?ዻ)
1768 ("\\DEG" ?ዼ)
1769 ("\\DG" ?ዽ)
1770 ("\\DoG" ?ዾ)
1771 ("\\DWaG" ?ዿ)
1772
1773 ("\\jeG" ?ጀ) ; U+1300 ..
1774 ("\\juG" ?ጁ)
1775 ("\\jiG" ?ጂ)
1776 ("\\jaG" ?ጃ)
1777 ("\\jEG" ?ጄ)
1778 ("\\jG" ?ጅ)
1779 ("\\joG" ?ጆ)
1780 ("\\jWaG" ?ጇ)
1781 ("\\geG" ?ገ)
1782 ("\\guG" ?ጉ)
1783 ("\\giG" ?ጊ)
1784 ("\\gaG" ?ጋ)
1785 ("\\gEG" ?ጌ)
1786 ("\\gG" ?ግ)
1787 ("\\goG" ?ጎ)
1788 ;; reserved
1789
1790 ("\\gWeG" ?ጐ) ; U+1310 ..
1791 ;; reserved
1792 ("\\gWiG" ?ጒ)
1793 ("\\gWaG" ?ጓ)
1794 ("\\gWEG" ?ጔ)
1795 ("\\gWG" ?ጕ)
1796 ;; reserved
1797 ;; reserved
1798 ("\\GeG" ?ጘ)
1799 ("\\GuG" ?ጙ)
1800 ("\\GiG" ?ጚ)
1801 ("\\GaG" ?ጛ)
1802 ("\\GEG" ?ጜ)
1803 ("\\GG" ?ጝ)
1804 ("\\GoG" ?ጞ)
1805 ;; reserved
1806
1807 ("\\TeG" ?ጠ) ; U+1320 ..
1808 ("\\TuG" ?ጡ)
1809 ("\\TiG" ?ጢ)
1810 ("\\TaG" ?ጣ)
1811 ("\\TEG" ?ጤ)
1812 ("\\TG" ?ጥ)
1813 ("\\ToG" ?ጦ)
1814 ("\\TWaG" ?ጧ)
1815 ("\\CeG" ?ጨ)
1816 ("\\CuG" ?ጩ)
1817 ("\\CiG" ?ጪ)
1818 ("\\CaG" ?ጫ)
1819 ("\\CEG" ?ጬ)
1820 ("\\CG" ?ጭ)
1821 ("\\CoG" ?ጮ)
1822 ("\\CWaG" ?ጯ)
1823
1824 ("\\PeG" ?ጰ) ; U+1330 ..
1825 ("\\PuG" ?ጱ)
1826 ("\\PiG" ?ጲ)
1827 ("\\PaG" ?ጳ)
1828 ("\\PEG" ?ጴ)
1829 ("\\PG" ?ጵ)
1830 ("\\PoG" ?ጶ)
1831 ("\\PWaG" ?ጷ)
1832 ("\\SeG" ?ጸ)
1833 ("\\SuG" ?ጹ)
1834 ("\\SiG" ?ጺ)
1835 ("\\SaG" ?ጻ)
1836 ("\\SEG" ?ጼ)
1837 ("\\SG" ?ጽ)
1838 ("\\SoG" ?ጾ)
1839 ("\\SWaG" ?ጿ)
1840
1841 ("\\SSeG" ?ፀ) ; U+1340 ..
1842 ("\\SSuG" ?ፁ)
1843 ("\\SSiG" ?ፂ)
1844 ("\\SSaG" ?ፃ)
1845 ("\\SSEG" ?ፄ)
1846 ("\\SSG" ?ፅ)
1847 ("\\SSoG" ?ፆ)
1848 ;; reserved
1849 ("\\feG" ?ፈ)
1850 ("\\fuG" ?ፉ)
1851 ("\\fiG" ?ፊ)
1852 ("\\faG" ?ፋ)
1853 ("\\fEG" ?ፌ)
1854 ("\\fG" ?ፍ)
1855 ("\\foG" ?ፎ)
1856 ("\\fWaG" ?ፏ)
1857
1858 ("\\peG" ?ፐ) ; U+1350 ..
1859 ("\\puG" ?ፑ)
1860 ("\\piG" ?ፒ)
1861 ("\\paG" ?ፓ)
1862 ("\\pEG" ?ፔ)
1863 ("\\pG" ?ፕ)
1864 ("\\poG" ?ፖ)
1865 ("\\pWaG" ?ፗ)
1866 ("\\mYaG" ?ፘ)
1867 ("\\rYaG" ?ፙ)
1868 ("\\fYaG" ?ፚ)
1869 ;; reserved
1870 ;; reserved
1871 ;; reserved
1872 ;; reserved
1873 ;; reserved
1874
1875 ;; reserved ; U+1360 ..
1876 ("\\spaceG" ?፡)
1877 ("\\periodG" ?።)
1878 ("\\commaG" ?፣)
1879 ("\\semicolonG" ?፤)
1880 ("\\colonG" ?፥)
1881 ("\\precolonG" ?፦)
1882 ("\\oldqmarkG" ?፧)
1883 ("\\pbreakG" ?፨)
1884 ("\\andG" ?፩)
1885 ("\\huletG" ?፪)
1886 ("\\sostG" ?፫)
1887 ("\\aratG" ?፬)
1888 ("\\amstG" ?፭)
1889 ("\\sadstG" ?፮)
1890 ("\\sabatG" ?፯)
1891
1892 ("\\smntG" ?፰) ; U+1370 ..
1893 ("\\zeteNG" ?፱)
1894 ("\\asrG" ?፲)
1895 ("\\heyaG" ?፳)
1896 ("\\selasaG" ?፴)
1897 ("\\arbaG" ?፵)
1898 ("\\hemsaG" ?፶)
1899 ("\\slsaG" ?፷)
1900 ("\\sebaG" ?፸)
1901 ("\\semanyaG" ?፹)
1902 ("\\zeTanaG" ?፺)
1903 ("\\metoG" ?፻)
1904 ("\\asrxiG" ?፼)
1905 ;; reserved
1906 ;; reserved
1907 ;; reserved
1908
1909 ;;
1910 ;; private extension
1911 ;;
1912
1913 ("\\yWaG" ?) ; U+1A00EF (was U+12EF)
1914
1915 ("\\GWaG" ?) ; U+1A011F (was U+131F)
1916
1917 ("\\qqeG" ?) ; U+1A0180 .. (was U+1380 ..)
1918 ("\\qquG" ?)
1919 ("\\qqiG" ?)
1920 ("\\qqaG" ?)
1921 ("\\qqEG" ?)
1922 ("\\qqG" ?)
1923 ("\\qqoG" ?)
1924 ;; unused
1925 ("\\MWeG" ?)
1926 ("\\bWeG" ?)
1927 ("\\GWeG" ?)
1928 ("\\fWeG" ?)
1929 ("\\pWeG" ?)
1930 ;; unused
1931 ;; unused
1932 ;; unused
1933
1934 ("\\kkeG" ?) ; U+1A0190 .. (was U+1390 ..)
1935 ("\\kkuG" ?)
1936 ("\\kkiG" ?)
1937 ("\\kkaG" ?)
1938 ("\\kkEG" ?)
1939 ("\\kkG" ?)
1940 ("\\kkoG" ?)
1941 ;; unused
1942 ("\\mWiG" ?)
1943 ("\\bWiG" ?)
1944 ("\\GWiG" ?)
1945 ("\\fWiG" ?)
1946 ("\\pWiG" ?)
1947 ;; unused
1948 ;; unused
1949 ;; unused
1950
1951 ("\\XeG" ?) ; U+1A01A0 .. (was U+13A0 ..)
1952 ("\\XuG" ?)
1953 ("\\XiG" ?)
1954 ("\\XaG" ?)
1955 ("\\XEG" ?)
1956 ("\\XG" ?)
1957 ("\\XoG" ?)
1958 ;; unused
1959 ("\\mWEG" ?)
1960 ("\\bWEG" ?)
1961 ("\\GWEG" ?)
1962 ("\\fWEG" ?)
1963 ("\\pWEG" ?)
1964 ;; unused
1965 ;; unused
1966 ;; unused
1967
1968 ("\\ggeG" ?) ; U+1A01B0 .. (was U+13B0 ..)
1969 ("\\gguG" ?)
1970 ("\\ggiG" ?)
1971 ("\\ggaG" ?)
1972 ("\\ggEG" ?)
1973 ("\\ggG" ?)
1974 ("\\ggoG" ?)
1975 ;; unused
1976 ("\\mWG" ?)
1977 ("\\bWG" ?)
1978 ("\\GWG" ?)
1979 ("\\fWG" ?)
1980 ("\\pWG" ?)
1981 ;; unused
1982 ;; unused
1983 ;; unused
1984
1985 ("\\ornamentG" ?) ; U+1A01C0 .. (was U+FDF0 ..)
1986 ("\\flandG" ?)
1987 ("\\iflandG" ?)
1988 ("\\africaG" ?)
1989 ("\\iafricaG" ?)
1990 ("\\wWeG" ?)
1991 ("\\wWiG" ?)
1992 ("\\wWaG" ?)
1993 ("\\wWEG" ?)
1994 ("\\wWG" ?)
1995 ;; Gemination () is handled in a special way.
1996 ("\\slaqG" ?)
1997
1998 ;; Assign reverse conversion to Fidel chars.
1999 ;; Then override forward conversion with ASCII chars.
2000 ;; ASCII chars should not have reverse conversions.
2001 ("\\dotG" ?) ("\\dotG" ".")
2002 ("\\lquoteG" ?) ("\\lquoteG" "«")
2003 ("\\rquoteG" ?) ("\\rquoteG" "»")
2004 ("\\qmarkG" ?) ("\\qmarkG" "?")
2005 )
2006
2007;; The ethiopic-tex package is not used for keyboard input, therefore
2008;; not registered with the register-input-method function.
2007 2009
2008;;
2009(provide 'ethio-util) 2010(provide 'ethio-util)
2010 2011
2012;;; ethio-util.el ends here
2013
2011;;; arch-tag: c8feb3d6-39bf-4b0a-b6ef-26f03fbc8140 2014;;; arch-tag: c8feb3d6-39bf-4b0a-b6ef-26f03fbc8140
2012;;; ethio-util.el ends here 2015;;; ethio-util.el ends here