annotate lisp/language/ethio-util.el @ 203:850242ba4a81 r20-3b28

Import from CVS: tag r20-3b28
author cvs
date Mon, 13 Aug 2007 10:02:21 +0200
parents 5a88923fcbfe
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1 ;;; ethio-util.el --- utilities for Ethiopic
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
2
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
3 ;; Copyright (C) 1995 Free Software Foundation, Inc.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
4 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
5 ;; Copyright (C) 1997 MORIOKA Tomohiko
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
6
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
7 ;; Keywords: mule, multilingual, Ethiopic
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
8
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
10
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
14 ;; any later version.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
15
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
19 ;; General Public License for more details.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
20
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
24 ;; 02111-1307, USA.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
25
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
26 ;; Author: TAKAHASHI Naoto <ntakahas@etl.go.jp>
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
27 ;; modified by MORIOKA Tomohiko <morioka@jaist.ac.jp> for XEmacs.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
28
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
29 ;;; Code:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
30
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
31 (eval-when-compile
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
32 (require 'rmail)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
33 (require 'w3)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
34 )
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
35
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
36 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
37 ;; ETHIOPIC UTILITY FUNCTIONS
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
38 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
39
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
40 ;; If the filename ends in ".sera", editing is done in fidel
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
41 ;; but file I/O is done in SERA.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
42 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
43 ;; If the filename ends in ".java", editing is done in fidel
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
44 ;; but file I/O is done in the \uXXXX style, where XXXX is
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
45 ;; the Unicode codepoint for the Ethiopic character.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
46 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
47 ;; If the filename ends in ".tex", editing is done in fidel
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
48 ;; but file I/O is done in EthioTeX format.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
49 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
50 ;; To automatically convert Ethiopic text to SERA format when sending mail,
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
51 ;; (add-hook 'mail-send-hook 'ethio-fidel-to-sera-mail)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
52 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
53 ;; To automatically convert SERA format to Ethiopic when receiving mail,
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
54 ;; (add-hook 'rmail-show-message-hook 'ethio-sera-to-fidel-mail)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
55 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
56 ;; To automatically convert Ethiopic text to SERA format when posting news,
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
57 ;; (add-hook 'news-inews-hook 'ethio-fidel-to-sera-mail)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
58
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
59 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
60 ;; users' preference
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
61 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
62
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
63 (defvar ethio-primary-language 'tigrigna
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
64 "*Symbol that defines the primary language in SERA --> FIDEL conversion.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
65 The value should be one of: `tigrigna', `amharic' or `english'.")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
66
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
67 (defvar ethio-secondary-language 'english
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
68 "*Symbol that defines the secondary language in SERA --> FIDEL conversion.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
69 The value should be one of: `tigrigna', `amharic' or `english'.")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
70
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
71 (defvar ethio-use-colon-for-colon nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
72 "*Non-nil means associate ASCII colon with Ethiopic colon.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
73 If nil, associate ASCII colon with Ethiopic word separator, i.e., two
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
74 vertically stacked dots. All SERA <--> FIDEL converters refer this
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
75 variable.")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
76
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
77 (defvar ethio-use-three-dot-question nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
78 "*Non-nil means associate ASCII question mark with Ethiopic old style question mark (three vertically stacked dots).
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
79 If nil, associate ASCII question mark with Ethiopic stylised question
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
80 mark. All SERA <--> FIDEL converters refer this variable.")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
81
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
82 (defvar ethio-quote-vowel-always nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
83 "*Non-nil means always put an apostrophe before an isolated vowel (except at word initial) in FIDEL --> SERA conversion.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
84 If nil, put an apostrophe only between a sixth-form consonant and an
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
85 isolated vowel.")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
86
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
87 (defvar ethio-W-sixth-always nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
88 "*Non-nil means convert the Wu-form of a 12-form consonant to \"W'\" instead of \"Wu\" in FIDEL --> SERA conversion.")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
89
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
90 (defvar ethio-numeric-reduction 0
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
91 "*Degree of reduction in converting Ethiopic digits into Arabic digits.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
92 Should be 0, 1 or 2.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
93 For example, ({10}{9}{100}{80}{7}) is converted into:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
94 `10`9`100`80`7 if `ethio-numeric-reduction' is 0,
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
95 `109100807 if `ethio-numeric-reduction' is 1,
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
96 `10900807 if `ethio-numeric-reduction' is 2.")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
97
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
98 (defvar ethio-implicit-period-conversion t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
99 "*Non-nil means replacing the Ethiopic dot at the end of an Ethiopic sentence
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
100 with an Ethiopic full stop.")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
101
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
102 (defvar ethio-java-save-lowercase nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
103 "*Non-nil means save Ethiopic characters in lowercase hex numbers to Java files.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
104 If nil, use uppercases.")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
105
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
106 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
107 ;; SERA to FIDEL
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
108 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
109
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
110 (defconst ethio-sera-to-fidel-table
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
111 [
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
112 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
113 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
114 ;;; SP
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
115 (" "
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
116 (?: (if ethio-use-colon-for-colon " $(3$l(B" "$(3$h(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
117 (32 (if ethio-use-colon-for-colon " $(3$l(B " "$(3$h(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
118 (?- " $(3$m(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
119 (?: " $(3$i(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
120 (?| (if ethio-use-colon-for-colon " $(3$l(B|" " $(3$h(B|")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
121 (?: " $(3$o(B"))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
122
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
123 ;;; ! " # $ % & '
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
124 nil nil nil nil nil nil ("" (?' "$(3%s(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
125 ;;; ( ) * + , - .
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
126 nil nil nil nil ("$(3$j(B") ("-" (?: "$(3$l(B")) ("$(3%u(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
127 ;;; / 0 1 2 3 4 5 6 7 8 9
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
128 nil nil nil nil nil nil nil nil nil nil nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
129 ;;; :
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
130 ((if ethio-use-colon-for-colon "$(3$l(B" "$(3$h(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
131 (32 (if ethio-use-colon-for-colon "$(3$l(B " "$(3$h(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
132 (?- "$(3$m(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
133 (?: "$(3$i(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
134 (?| (if ethio-use-colon-for-colon "$(3$l(B|" "$(3$h(B|")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
135 (?: "$(3$o(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
136 ;;; ; < = >
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
137 ("$(3$k(B") ("<" (?< "$(3%v(B")) nil (">" (?> "$(3%w(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
138 ;;; ?
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
139 ((if ethio-use-three-dot-question "$(3$n(B" "$(3%x(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
140 ;;; @
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
141 nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
142 ;;; A
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
143 ("$(3"f(B" (?2 "$(3#8(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
144 ;;; B
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
145 ("$(3"((B" (?e "$(3"#(B") (?u "$(3"$(B") (?i "$(3"%(B") (?a "$(3"&(B") (?E "$(3"'(B") (?o "$(3")(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
146 (?W "$(3%b(B" (?e "$(3%2(B") (?u "$(3%b(B") (?i "$(3%B(B") (?a "$(3"*(B") (?E "$(3%R(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
147 ;;; C
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
148 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
149 (?W "$(3$6(B" (?a "$(3$6(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
150 (?e "$(3$4%n(B") (?u "$(3$4%r(B") (?i "$(3$4%o(B") (?E "$(3$4%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
151 ;;; D
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
152 ("$(3#b(B" (?e "$(3#](B") (?u "$(3#^(B") (?i "$(3#_(B") (?a "$(3#`(B") (?E "$(3#a(B") (?o "$(3#c(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
153 (?W "$(3#d(B" (?a "$(3#d(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
154 (?e "$(3#b%n(B") (?u "$(3#b%r(B") (?i "$(3#b%o(B") (?E "$(3#b%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
155 ;;; E
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
156 ("$(3"g(B" (?2 "$(3#9(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
157 ;;; F
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
158 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
159 (?W "$(3%d(B" (?e "$(3%4(B") (?u "$(3%d(B") (?i "$(3%D(B") (?a "$(3$V(B") (?E "$(3%T(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
160 (?Y "$(3$a(B" (?a "$(3$a(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
161 ;;; G
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
162 ("$(3$$(B" (?e "$(3#}(B") (?u "$(3#~(B") (?i "$(3$!(B") (?a "$(3$"(B") (?E "$(3$#(B") (?o "$(3$%(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
163 (?W "$(3%c(B" (?e "$(3%3(B") (?u "$(3%c(B") (?i "$(3%C(B") (?a "$(3$&(B") (?E "$(3%S(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
164 ;;; H
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
165 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
166 (?W "$(3!8(B" (?a "$(3!8(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
167 (?e "$(3!6%n(B") (?u "$(3!6%r(B") (?i "$(3!6%o(B") (?E "$(3!6%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
168 ;;; I
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
169 ("$(3"h(B" (?2 "$(3#:(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
170 ;;; J
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
171 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
172 (?W "$(3#l(B" (?a "$(3#l(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
173 (?e "$(3#j%n(B") (?u "$(3#j%r(B") (?i "$(3#j%o(B") (?E "$(3#j%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
174 ;;; K
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
175 ("$(3#"(B" (?e "$(3"{(B") (?u "$(3"|(B") (?i "$(3"}(B") (?a "$(3"~(B") (?E "$(3#!(B") (?o "$(3##(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
176 (?W "$(3#*(B" (?e "$(3#%(B") (?u "$(3#*(B") (?i "$(3#'(B") (?a "$(3#((B") (?E "$(3#)(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
177 ;;; L
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
178 ("$(3!.(B" (?e "$(3!)(B") (?u "$(3!*(B") (?i "$(3!+(B") (?a "$(3!,(B") (?E "$(3!-(B") (?o "$(3!/(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
179 (?W "$(3!0(B" (?a "$(3!0(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
180 (?e "$(3!.%n(B") (?u "$(3!.%r(B") (?i "$(3!.%o(B") (?E "$(3!.%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
181 ;;; M
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
182 ("$(3!>(B" (?e "$(3!9(B") (?u "$(3!:(B") (?i "$(3!;(B") (?a "$(3!<(B") (?E "$(3!=(B") (?o "$(3!?(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
183 (?W "$(3%a(B" (?e "$(3%1(B") (?u "$(3%a(B") (?i "$(3%A(B") (?a "$(3!@(B") (?E "$(3%Q(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
184 (?Y "$(3$_(B" (?a "$(3$_(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
185 ;;; N
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
186 ("$(3"`(B" (?e "$(3"[(B") (?u "$(3"\(B") (?i "$(3"](B") (?a "$(3"^(B") (?E "$(3"_(B") (?o "$(3"a(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
187 (?W "$(3"b(B" (?a "$(3"b(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
188 (?e "$(3"`%n(B") (?u "$(3"`%r(B") (?i "$(3"`%o(B") (?E "$(3"`%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
189 ;;; O
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
190 ("$(3"i(B" (?2 "$(3#;(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
191 ;;; P
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
192 ("$(3$<(B" (?e "$(3$7(B") (?u "$(3$8(B") (?i "$(3$9(B") (?a "$(3$:(B") (?E "$(3$;(B") (?o "$(3$=(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
193 (?W "$(3$>(B" (?a "$(3$>(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
194 (?e "$(3$<%n(B") (?u "$(3$<%r(B") (?i "$(3$<%o(B") (?E "$(3$<%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
195 ;;; Q
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
196 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
197 (?W "$(3!~(B" (?e "$(3!y(B") (?u "$(3!~(B") (?i "$(3!{(B") (?a "$(3!|(B") (?E "$(3!}(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
198 ;;; R
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
199 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
200 (?W "$(3!P(B" (?a "$(3!P(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
201 (?e "$(3!N%n(B") (?u "$(3!N%r(B") (?i "$(3!N%o(B") (?E "$(3!N%q(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
202 (?Y "$(3$`(B" (?a "$(3$`(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
203 ;;; S
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
204 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
205 (?W "$(3$F(B" (?a "$(3$F(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
206 (?e "$(3$D%n(B") (?u "$(3$D%r(B") (?i "$(3$D%o(B") (?E "$(3$D%q(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
207 (?2 "$(3$L(B"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
208 (?e "$(3$G(B") (?u "$(3$H(B") (?i "$(3$I(B") (?a "$(3$J(B") (?E "$(3$K(B") (?o "$(3$M(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
209 (?W "$(3$F(B" (?a "$(3$F(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
210 (?e "$(3$L%n(B") (?u "$(3$L%r(B") (?i "$(3$L%o(B") (?E "$(3$L%q(B"))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
211 ;;; T
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
212 ("$(3$,(B" (?e "$(3$'(B") (?u "$(3$((B") (?i "$(3$)(B") (?a "$(3$*(B") (?E "$(3$+(B") (?o "$(3$-(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
213 (?W "$(3$.(B" (?a "$(3$.(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
214 (?e "$(3$,%n(B") (?u "$(3$,%r(B") (?i "$(3$,%o(B") (?E "$(3$,%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
215 ;;; U
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
216 ("$(3"d(B" (?2 "$(3#6(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
217 ;;; V
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
218 ("$(3"0(B" (?e "$(3"+(B") (?u "$(3",(B") (?i "$(3"-(B") (?a "$(3".(B") (?E "$(3"/(B") (?o "$(3"1(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
219 (?W "$(3"2(B" (?a "$(3"2(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
220 (?e "$(3"0%n(B") (?u "$(3"0%r(B") (?i "$(3"0%o(B") (?E "$(3"0%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
221 ;;; W
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
222 ("$(3%r(B" (?e "$(3%n(B") (?u "$(3%r(B") (?i "$(3%o(B") (?a "$(3%p(B") (?E "$(3%q(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
223 ;;; X
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
224 ("$(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"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
225 ;;; Y
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
226 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
227 (?W "$(3#T(B" (?a "$(3#T(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
228 (?e "$(3#R%n(B") (?u "$(3#R%r(B") (?i "$(3#R%o(B") (?E "$(3#R%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
229 ;;; Z
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
230 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
231 (?W "$(3#L(B" (?a "$(3#L(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
232 (?e "$(3#J%n(B") (?u "$(3#J%r(B") (?i "$(3#J%o(B") (?E "$(3#J%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
233 ;;; [ \ ] ^ _
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
234 nil nil nil nil nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
235 ;;; `
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
236 (""
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
237 (?: "$(3$h(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
238 (?? (if ethio-use-three-dot-question "$(3%x(B" "$(3$n(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
239 (?! "$(3%t(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
240 (?e "$(3#5(B") (?u "$(3#6(B") (?U "$(3#6(B") (?i "$(3#7(B") (?a "$(3#8(B") (?A "$(3#8(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
241 (?E "$(3#9(B") (?I "$(3#:(B") (?o "$(3#;(B") (?O "$(3#;(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
242 (?g "$(3%^(B"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
243 (?e "$(3%Y(B") (?u "$(3%Z(B") (?i "$(3%[(B") (?a "$(3%\(B") (?E "$(3%](B") (?o "$(3%_(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
244 (?h "$(3"H(B"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
245 (?e "$(3"C(B") (?u "$(3"D(B") (?i "$(3"E(B") (?a "$(3"F(B") (?E "$(3"G(B") (?o "$(3"I(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
246 (?W "$(3"P(B" (?e "$(3"K(B") (?u "$(3"P(B") (?i "$(3"M(B") (?a "$(3"N(B") (?E "$(3"O(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
247 (?k "$(3%>(B"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
248 (?e "$(3%9(B") (?u "$(3%:(B") (?i "$(3%;(B") (?a "$(3%<(B") (?E "$(3%=(B") (?o "$(3%?(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
249 (?s "$(3!F(B"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
250 (?e "$(3!A(B") (?u "$(3!B(B") (?i "$(3!C(B") (?a "$(3!D(B") (?E "$(3!E(B") (?o "$(3!G(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
251 (?W "$(3!H(B" (?a "$(3!H(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
252 (?e "$(3!F%n(B") (?u "$(3!F%r(B") (?i "$(3!F%o(B") (?E "$(3!F%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
253 (?S "$(3$L(B"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
254 (?e "$(3$G(B") (?u "$(3$H(B") (?i "$(3$I(B") (?a "$(3$J(B") (?E "$(3$K(B") (?o "$(3$M(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
255 (?W "$(3$F(B" (?a "$(3$F(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
256 (?e "$(3$L%n(B") (?u "$(3$L%r(B") (?i "$(3$L%o(B") (?E "$(3$L%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
257 (?q "$(3%.(B" (?e "$(3%)(B") (?u "$(3%*(B") (?i "$(3%+(B") (?a "$(3%,(B") (?E "$(3%-(B") (?o "$(3%/(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
258 ;;; a
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
259 ("$(3"f(B" (?2 "$(3#8(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
260 ;;; b
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
261 ("$(3"((B" (?e "$(3"#(B") (?u "$(3"$(B") (?i "$(3"%(B") (?a "$(3"&(B") (?E "$(3"'(B") (?o "$(3")(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
262 (?W "$(3%b(B" (?e "$(3%2(B") (?u "$(3%b(B") (?i "$(3%B(B") (?a "$(3"*(B") (?E "$(3%R(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
263 ;;; c
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
264 ("$(3"@(B" (?e "$(3";(B") (?u "$(3"<(B") (?i "$(3"=(B") (?a "$(3">(B") (?E "$(3"?(B") (?o "$(3"A(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
265 (?W "$(3"B(B" (?a "$(3"B(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
266 (?e "$(3"@%n(B") (?u "$(3"@%r(B") (?i "$(3"@%o(B") (?E "$(3"@%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
267 ;;; d
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
268 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
269 (?W "$(3#\(B" (?a "$(3#\(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
270 (?e "$(3#Z%o(B") (?u "$(3#Z%r(B") (?i "$(3#Z%p(B") (?E "$(3#Z%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
271 ;;; e
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
272 ("$(3"c(B" (?2 "$(3#5(B") (?a "$(3"j(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
273 ;;; f
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
274 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
275 (?W "$(3%d(B" (?e "$(3%4(B") (?u "$(3%d(B") (?i "$(3%D(B") (?a "$(3$V(B") (?E "$(3%T(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
276 (?Y "$(3$a(B" (?a "$(3$a(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
277 ;;; g
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
278 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
279 (?W "$(3#z(B" (?e "$(3#u(B") (?u "$(3#z(B") (?i "$(3#w(B") (?a "$(3#x(B") (?E "$(3#y(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
280 (?2 "$(3%^(B" (?e "$(3%Y(B") (?u "$(3%Z(B") (?i "$(3%[(B") (?a "$(3%\(B") (?E "$(3%](B") (?o "$(3%_(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
281 ;;; h
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
282 ("$(3!&(B" (?e "$(3!!(B") (?u "$(3!"(B") (?i "$(3!#(B") (?a "$(3!$(B") (?E "$(3!%(B") (?o "$(3!'(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
283 (?W "$(3"P(B" (?e "$(3"K(B") (?u "$(3"P(B") (?i "$(3"M(B") (?a "$(3"N(B") (?E "$(3"O(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
284 (?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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
285 (?W "$(3"P(B" (?e "$(3"K(B") (?u "$(3"P(B") (?i "$(3"M(B") (?a "$(3"N(B") (?E "$(3"O(B"))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
286 ;;; i
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
287 ("$(3"e(B" (?2 "$(3#7(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
288 ;;; j
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
289 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
290 (?W "$(3#l(B" (?a "$(3#l(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
291 (?e "$(3#j%n(B") (?u "$(3#j%r(B") (?i "$(3#j%o(B") (?E "$(3#j%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
292 ;;; k
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
293 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
294 (?W "$(3"x(B" (?e "$(3"s(B") (?u "$(3"x(B") (?i "$(3"u(B") (?a "$(3"v(B") (?E "$(3"w(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
295 (?2 "$(3%>(B" (?e "$(3%9(B") (?u "$(3%:(B") (?i "$(3%;(B") (?a "$(3%<(B") (?E "$(3%=(B") (?o "$(3%?(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
296 ;;; l
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
297 ("$(3!.(B" (?e "$(3!)(B") (?u "$(3!*(B") (?i "$(3!+(B") (?a "$(3!,(B") (?E "$(3!-(B") (?o "$(3!/(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
298 (?W "$(3!0(B" (?a "$(3!0(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
299 (?e "$(3!.%n(B") (?u "$(3!.%r(B") (?i "$(3!.%o(B") (?E "$(3!.%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
300 ;;; m
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
301 ("$(3!>(B" (?e "$(3!9(B") (?u "$(3!:(B") (?i "$(3!;(B") (?a "$(3!<(B") (?E "$(3!=(B") (?o "$(3!?(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
302 (?W "$(3%a(B" (?e "$(3%1(B") (?u "$(3%a(B") (?i "$(3%A(B") (?a "$(3!@(B") (?E "$(3%Q(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
303 (?Y "$(3$_(B" (?a "$(3$_(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
304 ;;; n
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
305 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
306 (?W "$(3"Z(B" (?a "$(3"Z(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
307 (?e "$(3"X%n(B") (?u "$(3"X%r(B") (?i "$(3"X%o(B") (?E "$(3"X%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
308 ;;; o
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
309 ("$(3"i(B" (?2 "$(3#;(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
310 ;;; p
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
311 ("$(3$\(B" (?e "$(3$W(B") (?u "$(3$X(B") (?i "$(3$Y(B") (?a "$(3$Z(B") (?E "$(3$[(B") (?o "$(3$](B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
312 (?W "$(3%e(B" (?e "$(3%5(B") (?u "$(3%e(B") (?i "$(3%E(B") (?a "$(3$^(B") (?E "$(3%U(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
313 ;;; q
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
314 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
315 (?W "$(3!n(B" (?e "$(3!i(B") (?u "$(3!n(B") (?i "$(3!k(B") (?a "$(3!l(B") (?E "$(3!m(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
316 (?2 "$(3%.(B" (?e "$(3%)(B") (?u "$(3%*(B") (?i "$(3%+(B") (?a "$(3%,(B") (?E "$(3%-(B") (?o "$(3%/(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
317 ;;; r
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
318 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
319 (?W "$(3!P(B" (?a "$(3!P(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
320 (?e "$(3!N%n(B") (?u "$(3!N%r(B") (?i "$(3!N%o(B") (?E "$(3!N%q(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
321 (?Y "$(3$`(B" (?a "$(3$`(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
322 ;;; s
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
323 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
324 (?W "$(3!X(B" (?a "$(3!X(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
325 (?e "$(3!V%n(B") (?u "$(3!V%r(B") (?i "$(3!V%o(B") (?E "$(3!V%q(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
326 (?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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
327 (?W "$(3!H(B" (?a "$(3!H(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
328 (?e "$(3!F%n(B") (?u "$(3!F%r(B") (?i "$(3!F%o(B") (?E "$(3!F%q(B"))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
329 ;;; t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
330 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
331 (?W "$(3":(B" (?a "$(3":(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
332 (?e "$(3"8%n(B") (?u "$(3"8%r(B") (?i "$(3"8%o(B") (?E "$(3"8%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
333 ;;; u
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
334 ("$(3"d(B" (?2 "$(3#6(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
335 ;;; v
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
336 ("$(3"0(B" (?e "$(3"+(B") (?u "$(3",(B") (?i "$(3"-(B") (?a "$(3".(B") (?E "$(3"/(B") (?o "$(3"1(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
337 (?W "$(3"2(B" (?a "$(3"2(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
338 (?e "$(3"0%n(B") (?u "$(3"0%r(B") (?i "$(3"0%o(B") (?E "$(3"0%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
339 ;;; w
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
340 ("$(3#2(B" (?e "$(3#-(B") (?u "$(3#.(B") (?i "$(3#/(B") (?a "$(3#0(B") (?E "$(3#1(B") (?o "$(3#3(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
341 (?W "$(3%p(B" (?e "$(3%n(B") (?u "$(3%r(B") (?i "$(3%o(B") (?a "$(3%p(B") (?E "$(3%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
342 ;;; x
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
343 ("$(3!^(B" (?e "$(3!Y(B") (?u "$(3!Z(B") (?i "$(3![(B") (?a "$(3!\(B") (?E "$(3!](B") (?o "$(3!_(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
344 (?W "$(3!`(B" (?a "$(3!`(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
345 (?e "$(3!^%n(B") (?u "$(3!^%r(B") (?i "$(3!^%o(B") (?E "$(3!^%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
346 ;;; y
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
347 ("$(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")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
348 (?W "$(3#T(B" (?a "$(3#T(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
349 (?e "$(3#R%n(B") (?u "$(3#R%r(B") (?i "$(3#R%o(B") (?E "$(3#R%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
350 ;;; z
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
351 ("$(3#B(B" (?e "$(3#=(B") (?u "$(3#>(B") (?i "$(3#?(B") (?a "$(3#@(B") (?E "$(3#A(B") (?o "$(3#C(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
352 (?W "$(3#D(B" (?a "$(3#D(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
353 (?e "$(3#B%n(B") (?u "$(3#B%r(B") (?i "$(3#B%o(B") (?E "$(3#B%q(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
354 ;;; { | } ~ DEL
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
355 nil nil nil nil nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
356 ])
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
357
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
358 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
359 (defun ethio-sera-to-fidel-region (beg end &optional secondary force)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
360 "Convert the characters in region from SERA to FIDEL.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
361 The variable `ethio-primary-language' specifies the primary language
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
362 and `ethio-secondary-language' specifies the secondary.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
363
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
364 If the 3rd parameter SECONDARY is given and non-nil, assume the region
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
365 begins begins with the secondary language; otherwise with the primary
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
366 language.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
367
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
368 If the 4th parameter FORCE is given and non-nil, perform conversion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
369 even if the buffer is read-only.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
370
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
371 See also the descriptions of the variables
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
372 `ethio-use-colen-for-colon' and
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
373 `ethio-use-three-dot-question'."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
374
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
375 (interactive "r\nP")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
376 (save-restriction
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
377 (narrow-to-region beg end)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
378 (ethio-sera-to-fidel-buffer secondary force)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
379
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
380 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
381 (defun ethio-sera-to-fidel-buffer (&optional secondary force)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
382 "Convert the current buffer from SERA to FIDEL.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
383
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
384 The variable `ethio-primary-language' specifies the primary
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
385 language and `ethio-secondary-language' specifies the secondary.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
386
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
387 If the 1st optional parameter SECONDARY is non-nil, assume the buffer
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
388 begins with the secondary language; otherwise with the primary
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
389 language.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
390
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
391 If the 2nd optional parametr FORCE is non-nil, perform conversion even if the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
392 buffer is read-only.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
393
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
394 See also the descriptions of the variables
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
395 `ethio-use-colen-for-colon' and
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
396 `ethio-use-three-dot-question'."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
397
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
398 (interactive "P")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
399
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
400 (if (and buffer-read-only
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
401 (not force)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
402 (not (y-or-n-p "Buffer is read-only. Force to convert? ")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
403 (error ""))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
404
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
405 (let ((ethio-primary-language ethio-primary-language)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
406 (ethio-secondary-language ethio-secondary-language)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
407 (ethio-use-colon-for-colon ethio-use-colon-for-colon)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
408 (ethio-use-three-dot-question ethio-use-three-dot-question)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
409 ;; The above four variables may be changed temporary
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
410 ;; by tilde escapes during conversion. So we bind them to other
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
411 ;; variables but of the same names.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
412 (buffer-read-only nil)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
413 (case-fold-search nil)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
414 current-language
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
415 next-language)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
416
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
417 (setq current-language
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
418 (if secondary
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
419 ethio-secondary-language
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
420 ethio-primary-language))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
421
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
422 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
423
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
424 (while (not (eobp))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
425 (setq next-language
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
426 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
427 ((eq current-language 'english)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
428 (ethio-sera-to-fidel-english))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
429 ((eq current-language 'amharic)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
430 (ethio-sera-to-fidel-ethio 'amharic))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
431 ((eq current-language 'tigrigna)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
432 (ethio-sera-to-fidel-ethio 'tigrigna))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
433 (t ; we don't know what to do
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
434 (ethio-sera-to-fidel-english))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
435
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
436 (setq current-language
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
437 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
438
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
439 ;; when language tag is explicitly specified
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
440 ((not (eq next-language 'toggle))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
441 next-language)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
442
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
443 ;; found a toggle in a primary language section
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
444 ((eq current-language ethio-primary-language)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
445 ethio-secondary-language)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
446
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
447 ;; found a toggle in a secondary, third, fourth, ...
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
448 ;; language section
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
449 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
450 ethio-primary-language))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
451
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
452 ;; If ethio-implicit-period-conversion is non-nil, the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
453 ;; Ethiopic dot "$(3%u(B" at the end of an Ethiopic sentence is
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
454 ;; replaced with the Ethiopic full stop "$(3$i(B".
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
455 (if ethio-implicit-period-conversion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
456 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
457 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
458 (while (re-search-forward "\\([$(3!!(B-$(3$a%)(B-$(3%e%n(B-$(3%r%s(B]\\)$(3%u(B\\([ \t]\\)"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
459 nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
460 (replace-match "\\1$(3$i(B\\2"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
461 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
462 (while (re-search-forward "\\([$(3!!(B-$(3$a%)(B-$(3%e%n(B-$(3%r%s(B]\\)$(3%u(B$" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
463 (replace-match "\\1$(3$i(B"))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
464
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
465 ;; gemination
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
466 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
467 (while (re-search-forward "\\ce$(3%s(B" nil 0)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
468 (compose-region
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
469 (save-excursion (backward-char 2) (point))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
470 (point)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
471 ))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
472
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
473 (defun ethio-sera-to-fidel-english nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
474 "Handle English section in SERA to FIDEL conversion.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
475 Conversion stops when a language switch is found. Then delete that
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
476 switch and return the name of the new language as a symbol."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
477 (let ((new-language nil))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
478
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
479 (while (and (not (eobp)) (null new-language))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
480 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
481
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
482 ;; if no more "\", nothing to do.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
483 ((not (search-forward "\\" nil 0)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
484
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
485 ;; hereafter point is put after a "\".
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
486 ;; first delete that "\", then check the following chars
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
487
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
488 ;; "\\" : leave the second "\"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
489 ((progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
490 (delete-backward-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
491 (= (following-char) ?\\ ))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
492 (forward-char 1))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
493
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
494 ;; "\ " : delete the following " "
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
495 ((= (following-char) 32)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
496 (delete-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
497 (setq new-language 'toggle))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
498
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
499 ;; a language flag
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
500 ((setq new-language (ethio-process-language-flag)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
501
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
502 ;; just a "\" : not special sequence.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
503 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
504 (setq new-language 'toggle))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
505
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
506 new-language))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
507
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
508 (defun ethio-sera-to-fidel-ethio (lang)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
509 "Handle Ethiopic section in SERA to FIDEL conversion.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
510 Conversion stops when a language switch is found. Then delete that
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
511 switch and return the name of the new language as a symbol.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
512
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
513 The parameter LANG (symbol, either `amharic' or `tigrigna') affects
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
514 the conversion of \"a\"."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
515
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
516 (let ((new-language nil)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
517 (verbatim nil)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
518 start table table2 ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
519
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
520 (setcar (aref ethio-sera-to-fidel-table ?a)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
521 (if (eq lang 'tigrigna) "$(3"f(B" "$(3"c(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
522
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
523 (while (and (not (eobp)) (null new-language))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
524 (setq ch (following-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
525 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
526
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
527 ;; skip from "<" to ">" (or from "&" to ";") if in w3-mode
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
528 ((and (boundp 'sera-being-called-by-w3)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
529 sera-being-called-by-w3
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
530 (or (= ch ?<) (= ch ?&)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
531 (search-forward (if (= ch ?<) ">" ";")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
532 nil 0))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
533
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
534 ;; leave non-ASCII characters as they are
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
535 ((>= ch 128)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
536 (forward-char 1))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
537
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
538 ;; ethiopic digits
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
539 ((looking-at "`[1-9][0-9]*")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
540 (delete-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
541 (ethio-convert-digit))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
542
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
543 ;; if not seeing a "\", do sera to fidel conversion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
544 ((/= ch ?\\ )
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
545 (setq start (point))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
546 (forward-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
547 (setq table (aref ethio-sera-to-fidel-table ch))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
548 (while (setq table2 (cdr (assoc (following-char) table)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
549 (setq table table2)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
550 (forward-char 1))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
551 (if (setq ch (car table))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
552 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
553 (delete-region start (point))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
554 (if (stringp ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
555 (insert ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
556 (insert (eval ch))))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
557
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
558 ;; if control reaches here, we must be looking at a "\"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
559
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
560 ;; verbatim mode
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
561 (verbatim
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
562 (if (looking-at "\\\\~! ?")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
563
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
564 ;; "\~!" or "\~! ". switch to non-verbatim mode
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
565 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
566 (replace-match "")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
567 (setq verbatim nil))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
568
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
569 ;; "\" but not "\~!" nor "\~! ". skip the current "\".
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
570 (forward-char 1)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
571
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
572 ;; hereafter, non-verbatim mode and looking at a "\"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
573 ;; first delete that "\", then check the following chars.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
574
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
575 ;; "\ " : delete the following " "
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
576 ((progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
577 (delete-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
578 (setq ch (following-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
579 (= ch 32))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
580 (delete-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
581 (setq new-language 'toggle))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
582
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
583 ;; "\~!" or "\~! " : switch to verbatim mode
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
584 ((looking-at "~! ?")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
585 (replace-match "")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
586 (setq verbatim t))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
587
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
588 ;; a language flag
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
589 ((setq new-language (ethio-process-language-flag)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
590
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
591 ;; "\~" but not "\~!" nor a language flag
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
592 ((= ch ?~)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
593 (delete-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
594 (ethio-tilde-escape))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
595
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
596 ;; ASCII punctuation escape. skip
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
597 ((looking-at "\\(,\\|\\.\\|;\\|:\\|'\\|`\\|\?\\|\\\\\\)+")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
598 (goto-char (match-end 0)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
599
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
600 ;; "\", but not special sequence
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
601 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
602 (setq new-language 'toggle))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
603
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
604 new-language))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
605
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
606 (defun ethio-process-language-flag nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
607 "Process a language flag of the form \"~lang\" or \"~lang1~lang2\".
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
608
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
609 If looking at \"~lang1~lang2\", set `ethio-primary-language' and
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
610 `ethio-une-secondary-language' based on \"lang1\" and \"lang2\".
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
611 Then delete the language flag \"~lang1~lang2\" from the buffer.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
612 Return value is the new primary language.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
613
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
614 If looking at \"~lang\", delete that language flag \"~lang\" from the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
615 buffer and return that language. In this case
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
616 `ethio-primary-language' and `ethio-uni-secondary-language'
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
617 are left unchanged.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
618
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
619 If an unsupported language flag is found, just return nil without
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
620 changing anything."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
621
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
622 (let (lang1 lang2)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
623 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
624
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
625 ;; ~lang1~lang2
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
626 ((and (looking-at
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
627 "~\\([a-z][a-z][a-z]?\\)~\\([a-z][a-z][a-z]?\\)[ \t\n\\]")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
628 (setq lang1
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
629 (ethio-flag-to-language
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
630 (buffer-substring (match-beginning 1) (match-end 1))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
631 (setq lang2
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
632 (ethio-flag-to-language
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
633 (buffer-substring (match-beginning 2) (match-end 2)))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
634 (setq ethio-primary-language lang1
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
635 ethio-secondary-language lang2)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
636 (delete-region (point) (match-end 2))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
637 (if (= (following-char) 32)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
638 (delete-char 1))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
639 ethio-primary-language)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
640
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
641 ;; ~lang
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
642 ((and (looking-at "~\\([a-z][a-z][a-z]?\\)[ \t\n\\]")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
643 (setq lang1
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
644 (ethio-flag-to-language
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
645 (buffer-substring (match-beginning 1) (match-end 1)))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
646 (delete-region (point) (match-end 1))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
647 (if (= (following-char) 32)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
648 (delete-char 1))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
649 lang1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
650
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
651 ;; otherwise
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
652 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
653 nil))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
654
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
655 (defun ethio-tilde-escape nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
656 "Handle a SERA tilde escape in Ethiopic section and delete it.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
657 Delete the escape even it is not recognised."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
658
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
659 (let ((p (point)) command)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
660 (skip-chars-forward "^ \t\n\\\\")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
661 (setq command (buffer-substring p (point)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
662 (delete-region p (point))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
663 (if (= (following-char) 32)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
664 (delete-char 1))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
665
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
666 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
667
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
668 ;; \~-:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
669 ((string= command "-:")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
670 (setq ethio-use-colon-for-colon t))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
671
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
672 ;; \~`:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
673 ((string= command "`:")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
674 (setq ethio-use-colon-for-colon nil))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
675
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
676 ;; \~?
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
677 ((string= command "?")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
678 (setq ethio-use-three-dot-question nil))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
679
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
680 ;; \~`|
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
681 ((string= command "`|")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
682 (setq ethio-use-three-dot-question t))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
683
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
684 ;; \~e
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
685 ((string= command "e")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
686 (insert "$(3%j(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
687
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
688 ;; \~E
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
689 ((string= command "E")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
690 (insert "$(3%k(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
691
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
692 ;; \~a
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
693 ((string= command "a")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
694 (insert "$(3%l(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
695
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
696 ;; \~A
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
697 ((string= command "A")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
698 (insert "$(3%m(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
699
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
700 ;; \~X
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
701 ((string= command "X")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
702 (insert "$(3%i(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
703
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
704 ;; unsupported tilde escape
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
705 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
706 nil))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
707
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
708 (defun ethio-flag-to-language (flag)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
709 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
710 ((or (string= flag "en") (string= flag "eng")) 'english)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
711 ((or (string= flag "ti") (string= flag "tir")) 'tigrigna)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
712 ((or (string= flag "am") (string= flag "amh")) 'amharic)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
713 (t nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
714
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
715 (defun ethio-convert-digit nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
716 "Convert Arabic digits to Ethiopic digits."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
717 (let (ch z)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
718 (while (and (>= (setq ch (following-char)) ?1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
719 (<= ch ?9))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
720 (delete-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
721
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
722 ;; count up following zeros
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
723 (setq z 0)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
724 (while (= (following-char) ?0)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
725 (delete-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
726 (setq z (1+ z)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
727
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
728 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
729
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
730 ;; first digit is 10, 20, ..., or 90
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
731 ((= (mod z 2) 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
732 (insert (aref [?$(3$y(B ?$(3$z(B ?$(3${(B ?$(3$|(B ?$(3$}(B ?$(3$~(B ?$(3%!(B ?$(3%"(B ?$(3%#(B] (- ch ?1)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
733 (setq z (1- z)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
734
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
735 ;; first digit is 2, 3, ..., or 9
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
736 ((/= ch ?1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
737 (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))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
738
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
739 ;; single 1
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
740 ((= z 0)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
741 (insert "$(3$p(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
742
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
743 ;; 100
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
744 (if (= (mod z 4) 2)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
745 (insert "$(3%$(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
746
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
747 ;; 10000
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
748 (insert-char ?$(3%%(B (/ z 4)))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
749
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
750 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
751 (defun ethio-sera-to-fidel-mail (&optional arg)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
752 "Convert SERA to FIDEL to read/write mail and news.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
753
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
754 If the buffer contains the markers \"<sera>\" and \"</sera>\",
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
755 convert the segments between them into FIDEL.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
756
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
757 If invoked interactively and there is no marker, convert the subject field
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
758 and the body into FIDEL using `ethio-sera-to-fidel-region'."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
759
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
760 (interactive "p")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
761 (let ((buffer-read-only nil)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
762 border)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
763 (save-excursion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
764
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
765 ;; look for the header-body separator
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
766 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
767 (if (search-forward
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
768 (if (eq major-mode 'rmail-mode)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
769 "\n\n" (concat "\n" mail-header-separator "\n"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
770 nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
771 (setq border (point))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
772 (error "header separator not found"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
773
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
774 ;; note that the point is placed at the border
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
775 (if (or (re-search-forward "^<sera>$" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
776 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
777 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
778 (re-search-forward "^Subject: <sera>" border t)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
779
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
780 ;; there are markers
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
781 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
782 ;; we start with the body so that the border will not change
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
783 ;; use "^<sera>\n" instead of "^<sera>$" not to leave a blank line
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
784 (goto-char border)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
785 (while (re-search-forward "^<sera>\n" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
786 (replace-match "")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
787 (ethio-sera-to-fidel-region
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
788 (point)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
789 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
790 (if (re-search-forward "^</sera>\n" nil 0)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
791 (replace-match ""))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
792 (point))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
793 ;; now process the subject
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
794 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
795 (if (re-search-forward "^Subject: <sera>" border t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
796 (ethio-sera-to-fidel-region
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
797 (progn (delete-backward-char 6) (point))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
798 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
799 (if (re-search-forward "</sera>$" (line-end-position) 0)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
800 (replace-match ""))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
801 (point)))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
802
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
803 ;; in case there are no marks but invoked interactively
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
804 (if arg
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
805 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
806 (ethio-sera-to-fidel-region border (point-max))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
807 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
808 (if (re-search-forward "^Subject: " border t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
809 (ethio-sera-to-fidel-region (point) (line-end-position))))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
810
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
811 ;; adjust the rmail marker
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
812 (if (eq major-mode 'rmail-mode)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
813 (set-marker
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
814 (aref rmail-message-vector (1+ rmail-current-message))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
815 (point-max))))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
816
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
817 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
818 (defun ethio-sera-to-fidel-marker (&optional force)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
819 "Convert the regions surrounded by \"<sera>\" and \"</sera>\" from SERA to FIDEL.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
820 Assume that each region begins with `ethio-primary-language'.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
821 The markers \"<sera>\" and \"</sera>\" themselves are not deleted."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
822 (interactive "P")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
823 (if (and buffer-read-only
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
824 (not force)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
825 (not (y-or-n-p "Buffer is read-only. Force to convert? ")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
826 (error ""))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
827 (save-excursion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
828 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
829 (while (re-search-forward "<sera>" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
830 (ethio-sera-to-fidel-region
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
831 (point)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
832 (if (re-search-forward "</sera>" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
833 (match-beginning 0)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
834 (point-max))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
835 nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
836 'force))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
837
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
838 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
839 ;; FIDEL to SERA
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
840 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
841
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
842 (defconst ethio-fidel-to-sera-map
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
843 [ "he" "hu" "hi" "ha" "hE" "h" "ho" "" ;; 0 - 7
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
844 "le" "lu" "li" "la" "lE" "l" "lo" "lWa" ;; 8
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
845 "He" "Hu" "Hi" "Ha" "HE" "H" "Ho" "HWa" ;; 16
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
846 "me" "mu" "mi" "ma" "mE" "m" "mo" "mWa" ;; 24
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
847 "`se" "`su" "`si" "`sa" "`sE" "`s" "`so" "`sWa" ;; 32
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
848 "re" "ru" "ri" "ra" "rE" "r" "ro" "rWa" ;; 40
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
849 "se" "su" "si" "sa" "sE" "s" "so" "sWa" ;; 48
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
850 "xe" "xu" "xi" "xa" "xE" "x" "xo" "xWa" ;; 56
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
851 "qe" "qu" "qi" "qa" "qE" "q" "qo" "" ;; 64
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
852 "qWe" "" "qWi" "qWa" "qWE" "qW'" "" "" ;; 72
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
853 "Qe" "Qu" "Qi" "Qa" "QE" "Q" "Qo" "" ;; 80
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
854 "QWe" "" "QWi" "QWa" "QWE" "QW'" "" "" ;; 88
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
855 "be" "bu" "bi" "ba" "bE" "b" "bo" "bWa" ;; 96
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
856 "ve" "vu" "vi" "va" "vE" "v" "vo" "vWa" ;; 104
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
857 "te" "tu" "ti" "ta" "tE" "t" "to" "tWa" ;; 112
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
858 "ce" "cu" "ci" "ca" "cE" "c" "co" "cWa" ;; 120
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
859 "`he" "`hu" "`hi" "`ha" "`hE" "`h" "`ho" "" ;; 128
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
860 "hWe" "" "hWi" "hWa" "hWE" "hW'" "" "" ;; 136
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
861 "ne" "nu" "ni" "na" "nE" "n" "no" "nWa" ;; 144
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
862 "Ne" "Nu" "Ni" "Na" "NE" "N" "No" "NWa" ;; 152
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
863 "e" "u" "i" "A" "E" "I" "o" "ea" ;; 160
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
864 "ke" "ku" "ki" "ka" "kE" "k" "ko" "" ;; 168
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
865 "kWe" "" "kWi" "kWa" "kWE" "kW'" "" "" ;; 176
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
866 "Ke" "Ku" "Ki" "Ka" "KE" "K" "Ko" "" ;; 184
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
867 "KWe" "" "KWi" "KWa" "KWE" "KW'" "" "" ;; 192
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
868 "we" "wu" "wi" "wa" "wE" "w" "wo" "" ;; 200
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
869 "`e" "`u" "`i" "`a" "`E" "`I" "`o" "" ;; 208
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
870 "ze" "zu" "zi" "za" "zE" "z" "zo" "zWa" ;; 216
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
871 "Ze" "Zu" "Zi" "Za" "ZE" "Z" "Zo" "ZWa" ;; 224
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
872 "ye" "yu" "yi" "ya" "yE" "y" "yo" "yWa" ;; 232
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
873 "de" "du" "di" "da" "dE" "d" "do" "dWa" ;; 240
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
874 "De" "Du" "Di" "Da" "DE" "D" "Do" "DWa" ;; 248
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
875 "je" "ju" "ji" "ja" "jE" "j" "jo" "jWa" ;; 256
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
876 "ge" "gu" "gi" "ga" "gE" "g" "go" "" ;; 264
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
877 "gWe" "" "gWi" "gWa" "gWE" "gW'" "" "" ;; 272
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
878 "Ge" "Gu" "Gi" "Ga" "GE" "G" "Go" "GWa" ;; 280
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
879 "Te" "Tu" "Ti" "Ta" "TE" "T" "To" "TWa" ;; 288
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
880 "Ce" "Cu" "Ci" "Ca" "CE" "C" "Co" "CWa" ;; 296
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
881 "Pe" "Pu" "Pi" "Pa" "PE" "P" "Po" "PWa" ;; 304
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
882 "Se" "Su" "Si" "Sa" "SE" "S" "So" "SWa" ;; 312
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
883 "`Se" "`Su" "`Si" "`Sa" "`SE" "`S" "`So" "" ;; 320
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
884 "fe" "fu" "fi" "fa" "fE" "f" "fo" "fWa" ;; 328
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
885 "pe" "pu" "pi" "pa" "pE" "p" "po" "pWa" ;; 336
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
886 "mYa" "rYa" "fYa" "" "" "" "" "" ;; 344
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
887 " " " : " "::" "," ";" "-:" ":-" "`?" ;; 352
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
888 ":|:" "1" "2" "3" "4" "5" "6" "7" ;; 360
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
889 "8" "9" "10" "20" "30" "40" "50" "60" ;; 368
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
890 "70" "80" "90" "100" "10000" "" "" "" ;; 376
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
891 "`qe" "`qu" "`qi" "`qa" "`qE" "`q" "`qo" "" ;; 384
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
892 "mWe" "bWe" "GWe" "fWe" "pWe" "" "" "" ;; 392
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
893 "`ke" "`ku" "`ki" "`ka" "`kE" "`k" "`ko" "" ;; 400
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
894 "mWi" "bWi" "GWi" "fWi" "pWi" "" "" "" ;; 408
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
895 "Xe" "Xu" "Xi" "Xa" "XE" "X" "Xo" "" ;; 416
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
896 "mWE" "bWE" "GWE" "fWE" "pWE" "" "" "" ;; 424
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
897 "`ge" "`gu" "`gi" "`ga" "`gE" "`g" "`go" "" ;; 432
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
898 "mW'" "bW'" "GW'" "fW'" "pW'" "" "" "" ;; 440
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
899 "\\~X " "\\~e " "\\~E " "\\~a " "\\~A " "wWe" "wWi" "wWa" ;; 448
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
900 "wWE" "wW'" "''" "`!" "." "<<" ">>" "?" ]) ;; 456
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
901
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
902 (defun ethio-prefer-amharic-p nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
903 (or (eq ethio-primary-language 'amharic)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
904 (and (not (eq ethio-primary-language 'tigrigna))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
905 (eq ethio-secondary-language 'amharic))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
906
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
907 (defun ethio-language-to-flag (lang)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
908 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
909 ((eq lang 'english) "eng")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
910 ((eq lang 'tigrigna) "tir")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
911 ((eq lang 'amharic) "amh")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
912 (t "")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
913
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
914 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
915 (defun ethio-fidel-to-sera-region (begin end &optional secondary force)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
916 "Replace all the FIDEL characters in the region to the SERA format.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
917 The variable `ethio-primary-language' specifies the primary
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
918 language and `ethio-secondary-language' specifies the secondary.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
919
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
920 If the 3dr parameter SECONDARY is given and non-nil, try to convert
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
921 the region so that it begins in the secondary language; otherwise with
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
922 the primary language.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
923
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
924 If the 4th parameter FORCE is given and non-nil, convert even if the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
925 buffer is read-only.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
926
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
927 See also the descriptions of the variables
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
928 `ethio-use-colen-for-colon', `ethio-use-three-dot-question',
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
929 `ethio-quote-vowel-always' and `ethio-numeric-reduction'."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
930
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
931 (interactive "r\nP")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
932 (save-restriction
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
933 (narrow-to-region begin end)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
934 (ethio-fidel-to-sera-buffer secondary force)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
935
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
936 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
937 (defun ethio-fidel-to-sera-buffer (&optional secondary force)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
938 "Replace all the FIDEL characters in the current buffer to the SERA format.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
939 The variable `ethio-primary-language' specifies the primary
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
940 language and `ethio-secondary-language' specifies the secondary.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
941
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
942 If the 1st optional parameter SECONDARY is non-nil, try to convert the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
943 region so that it begins in the secondary language; otherwise with the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
944 primary language.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
945
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
946 If the 2nd optional parameter FORCE is non-nil, convert even if the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
947 buffer is read-only.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
948
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
949 See also the descriptions of the variables
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
950 `ethio-use-colen-for-colon', `ethio-use-three-dot-question',
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
951 `ethio-quote-vowel-always' and `ethio-numeric-reduction'."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
952
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
953 (interactive "P")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
954 (if (and buffer-read-only
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
955 (not force)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
956 (not (y-or-n-p "Buffer is read-only. Force to convert? ")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
957 (error ""))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
958
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
959 (let ((buffer-read-only nil)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
960 (case-fold-search nil)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
961 (lonec nil) ;; t means previous char was a lone consonant
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
962 (fidel nil) ;; t means previous char was a FIDEL
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
963 (digit nil) ;; t means previous char was an Ethiopic digit
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
964 (flag (if (ethio-prefer-amharic-p) "\\~amh " "\\~tir "))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
965 mode ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
966
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
967 ;; user's preference in transcription
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
968 (if ethio-use-colon-for-colon
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
969 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
970 (aset ethio-fidel-to-sera-map 353 "`:")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
971 (aset ethio-fidel-to-sera-map 357 ":"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
972 (aset ethio-fidel-to-sera-map 353 " : ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
973 (aset ethio-fidel-to-sera-map 357 "-:"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
974
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
975 (if ethio-use-three-dot-question
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
976 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
977 (aset ethio-fidel-to-sera-map 359 "?")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
978 (aset ethio-fidel-to-sera-map 463 "`?"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
979 (aset ethio-fidel-to-sera-map 359 "`?")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
980 (aset ethio-fidel-to-sera-map 463 "?"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
981
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
982 (mapcar
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
983 '(lambda (x)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
984 (aset (aref ethio-fidel-to-sera-map x)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
985 2
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
986 (if ethio-W-sixth-always ?' ?u)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
987 '(77 93 141 181 197 277 440 441 442 443 444 457))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
988
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
989 (if (ethio-prefer-amharic-p)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
990 (aset ethio-fidel-to-sera-map 160 "a")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
991 (aset ethio-fidel-to-sera-map 160 "e"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
992 ;; end of user's preference
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
993
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
994 ;; first, decompose geminated characters
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
995 (decompose-region (point-min) (point-max))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
996
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
997 ;; main conversion routine
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
998 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
999 (while (not (eobp))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1000 (setq ch (following-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1001
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1002 (cond ; ethiopic, english, neutral
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1003
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1004 ;; ethiopic character. must go to ethiopic mode, if not in it.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1005 ((eq (char-charset ch) 'ethiopic)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1006 (setq ch (ethio-char-to-ethiocode ch))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1007 (delete-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1008 (if (not (eq mode 'ethiopic))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1009 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1010 (insert flag)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1011 (setq mode 'ethiopic)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1012
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1013 (cond ; fidel, punc, digit
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1014
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1015 ;; fidels
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1016 ((or (<= ch 346) ; he - fYa
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1017 (and (>= ch 384) (<= ch 444)) ; `qe - pw
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1018 (and (>= ch 453) (<= ch 457))) ; wWe - wW
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1019 (if (and (memq ch '(160 161 162 163 164 166 167)) ; (e - ea)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1020 (or lonec
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1021 (and ethio-quote-vowel-always
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1022 fidel)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1023 (insert "'"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1024 (insert (aref ethio-fidel-to-sera-map ch))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1025 (setq lonec (ethio-lone-consonant-p ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1026 fidel t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1027 digit nil))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1028
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1029 ;; punctuations or icons
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1030 ((or (and (>= ch 353) (<= ch 360)) ; : - :|:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1031 (>= ch 458) ; '' - ?
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1032 (and (>= ch 448) (<= ch 452))) ; \~X \~e \~E \~a \~A
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1033 (insert (aref ethio-fidel-to-sera-map ch))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1034 (setq lonec nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1035 fidel nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1036 digit nil))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1037
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1038 ;; now CH must be an ethiopic digit
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1039
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1040 ;; reduction = 0 or not preceded by Ethiopic number(s)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1041 ((or (= ethio-numeric-reduction 0)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1042 (not digit))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1043 (insert "`" (aref ethio-fidel-to-sera-map ch))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1044 (setq lonec nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1045 fidel nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1046 digit t))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1047
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1048 ;; reduction = 2 and following 10s, 100s, 10000s
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1049 ((and (= ethio-numeric-reduction 2)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1050 (memq ch '(370 379 380)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1051 (insert (substring (aref ethio-fidel-to-sera-map ch) 1))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1052 (setq lonec nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1053 fidel nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1054 digit t))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1055
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1056 ;; ordinary following digits
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1057 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1058 (insert (aref ethio-fidel-to-sera-map ch))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1059 (setq lonec nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1060 fidel nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1061 digit t))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1062
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1063 ;; english character. must go to english mode, if not in it.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1064 ((or (and (>= ch ?a) (<= ch ?z))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1065 (and (>= ch ?A) (<= ch ?Z)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1066 (if (not (eq mode 'english))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1067 (insert "\\~eng "))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1068 (forward-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1069 (setq mode 'english
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1070 lonec nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1071 fidel nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1072 digit nil))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1073
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1074 ;; ch can appear both in ethiopic section and in english section.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1075 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1076
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1077 ;; we must decide the mode, if not decided yet
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1078 (if (null mode)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1079 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1080 (setq mode
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1081 (if secondary
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1082 ethio-secondary-language
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1083 ethio-primary-language))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1084 (if (eq mode 'english)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1085 (insert "\\~eng ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1086 (insert flag)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1087 (setq mode 'ethiopic)))) ; tigrigna & amharic --> ethiopic
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1088
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1089 (cond ; \ , eng-mode , punc , w3 , other
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1090
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1091 ;; backslash is always quoted
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1092 ((= ch ?\\ )
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1093 (insert "\\")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1094 (forward-char 1))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1095
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1096 ;; nothing to do if in english mode
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1097 ((eq mode 'english)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1098 (forward-char 1))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1099
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1100 ;; now we must be in ethiopic mode and seeing a non-"\"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1101
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1102 ;; ascii punctuations in ethiopic mode
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1103 ((looking-at "[,.;:'`?]+")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1104 (insert "\\")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1105 (goto-char (1+ (match-end 0)))) ; because we inserted one byte (\)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1106
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1107 ;; skip from "<" to ">" (or from "&" to ";") if called from w3
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1108 ((and (boundp 'sera-being-called-by-w3)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1109 sera-being-called-by-w3
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1110 (or (= ch ?<) (= ch ?&)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1111 (search-forward (if (= ch ?<) ">" ";")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1112 nil 0))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1113
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1114 ;; neutral character. no need to quote. just skip it.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1115 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1116 (forward-char 1)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1117
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1118 (setq lonec nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1119 fidel nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1120 digit nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1121 ;; end of main conversion routine
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1122 )))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1123
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1124 (defun ethio-lone-consonant-p (ethiocode)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1125 "If ETHIOCODE is an Ethiopic lone consonant, return t."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1126 (or (and (< ethiocode 344) (= (% ethiocode 8) 5))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1127
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1128 ;; `q `k X `g mW bW GW fW pW wW
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1129 (memq ethiocode '(389 405 421 437 440 441 442 443 444 457))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1130
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1131 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1132 (defun ethio-fidel-to-sera-mail nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1133 "Convert FIDEL to SERA to read/write mail and news.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1134
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1135 If the body contains at least one Ethiopic character,
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1136 1) insert the string \"<sera>\" at the beginning of the body,
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1137 2) insert \"</sera>\" at the end of the body, and
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1138 3) convert the body into SERA.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1139
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1140 The very same procedure applies to the subject field, too."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1141
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1142 (interactive)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1143 (let ((buffer-read-only nil)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1144 border)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1145 (save-excursion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1146
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1147 ;; look for the header-body separator
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1148 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1149 (if (search-forward
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1150 (if (eq major-mode 'rmail-mode)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1151 "\n\n" (concat "\n" mail-header-separator "\n"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1152 nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1153 (setq border (point))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1154 (error "header separator not found"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1155
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1156 ;; process body first not to change the border
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1157 ;; note that the point is already at the border
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1158 (if (re-search-forward "\\ce" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1159 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1160 (ethio-fidel-to-sera-region border (point-max))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1161 (goto-char border)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1162 (insert "<sera>")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1163 (goto-char (point-max))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1164 (insert "</sera>")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1166 ;; process subject
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1167 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1168 (if (re-search-forward "^Subject: " border t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1169 (let ((beg (point))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1170 (end (line-end-position)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1171 (if (re-search-forward "\\ce" end t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1172 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1173 (ethio-fidel-to-sera-region beg end)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1174 (goto-char beg)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1175 (insert "<sera>")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1176 (end-of-line)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1177 (insert "</sera>")))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1178
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1179 ;; adjust the rmail marker
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1180 (if (eq major-mode 'rmail-mode)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1181 (set-marker
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1182 (aref rmail-message-vector (1+ rmail-current-message))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1183 (point-max))))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1184
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1185 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1186 (defun ethio-fidel-to-sera-marker (&optional force)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1187 "Convert the regions surrounded by \"<sera>\" and \"</sera>\" from FIDEL to SERA.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1188 The markers \"<sera>\" and \"</sera>\" themselves are not deleted."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1189
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1190 (interactive "P")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1191 (if (and buffer-read-only
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1192 (not force)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1193 (not (y-or-n-p "Buffer is read-only. Force to convert? ")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1194 (error ""))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1195 (save-excursion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1196 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1197 (while (re-search-forward "<sera>" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1198 (ethio-fidel-to-sera-region
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1199 (point)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1200 (if (re-search-forward "</sera>" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1201 (match-beginning 0)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1202 (point-max))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1203 nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1204 'force))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1205
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1206 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1207 ;; vowel modification
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1208 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1209
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1210 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1211 (defun ethio-modify-vowel nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1212 "Modify the vowel of the FIDEL that is under the cursor."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1213 (interactive)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1214 (let ((ch (following-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1215 (composite nil) ; geminated or not
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1216 newch base vowel modulo)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1217
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1218 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1219 ;; in case of gemination
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1220 ((eq (char-charset ch) 'composition)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1221 (setq ch (string-to-char (decompose-composite-char ch))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1222 composite t))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1223 ;; neither gemination nor fidel
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1224 ((not (eq (char-charset ch) 'ethiopic))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1225 (error "Not a valid character.")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1226
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1227 ;; set frequently referred character features
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1228 (setq ch (ethio-char-to-ethiocode ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1229 base (* (/ ch 8) 8)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1230 modulo (% ch 8))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1231
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1232 (if (or (and (>= ch 344) (<= ch 380)) ;; mYa - `10000
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1233 (and (>= ch 448) (<= ch 452)) ;; \~X - \~A
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1234 (>= ch 458)) ;; private punctuations
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1235 (error "Not a valid character."))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1236
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1237 (setq
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1238 newch
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1239 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1240
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1241 ;; first standalone vowels
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1242 ((= base 160)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1243 (if (ethio-prefer-amharic-p)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1244 (message "Modify vowel to: [auiAEIoW\"] ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1245 (message "Modify vowel to: [euiAEIoW\"] "))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1246 (setq vowel (read-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1247 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1248 ((= vowel ?e) 160)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1249 ((= vowel ?u) 161)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1250 ((= vowel ?i) 162)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1251 ((= vowel ?A) 163)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1252 ((= vowel ?E) 164)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1253 ((= vowel ?I) 165)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1254 ((= vowel ?o) 166)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1255 ((= vowel ?W) 167)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1256 ((= vowel ?a) (if (ethio-prefer-amharic-p) 160 163))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1257 ((= vowel ?\") (setq composite t) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1258 (t nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1259
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1260 ;; second standalone vowels
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1261 ((= base 208)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1262 (message "Modify vowel to: [euiaEIo\"] ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1263 (setq vowel (read-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1264 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1265 ((= vowel ?e) 208)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1266 ((= vowel ?u) 209)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1267 ((= vowel ?i) 210)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1268 ((= vowel ?a) 211)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1269 ((= vowel ?E) 212)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1270 ((= vowel ?I) 213)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1271 ((= vowel ?o) 214)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1272 ((= vowel ?\") (setq composite t) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1273 (t nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1274
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1275 ;; 12-form consonants, *W* form
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1276 ((memq base '(72 88 136 176 192 272)) ; qW QW hW kW KW gW
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1277 (message "Modify vowel to: [euiaE'\"] ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1278 (setq vowel (read-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1279 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1280 ((= vowel ?e) base)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1281 ((= vowel ?u) (+ base 5))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1282 ((= vowel ?i) (+ base 2))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1283 ((= vowel ?a) (+ base 3))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1284 ((= vowel ?E) (+ base 4))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1285 ((= vowel ?') (+ base 5))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1286 ((= vowel ?\") (setq composite t) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1287 (t nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1288
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1289 ;; extended 12-form consonants, mWa bWa GWa fWa pWa
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1290 ((= ch 31) ; mWa
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1291 (message "Modify vowel to: [euiaE'\"] ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1292 (setq vowel (read-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1293 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1294 ((= vowel ?e) 392)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1295 ((= vowel ?u) 440)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1296 ((= vowel ?i) 408)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1297 ((= vowel ?a) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1298 ((= vowel ?E) 424)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1299 ((= vowel ?') 440)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1300 ((= vowel ?\") (setq composite t) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1301 (t nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1302 ((= ch 103) ; bWa
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1303 (message "Modify vowel to: [euiaE'\"] ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1304 (setq vowel (read-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1305 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1306 ((= vowel ?e) 393)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1307 ((= vowel ?u) 441)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1308 ((= vowel ?i) 409)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1309 ((= vowel ?a) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1310 ((= vowel ?E) 425)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1311 ((= vowel ?') 441)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1312 ((= vowel ?\") (setq composite t) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1313 (t nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1314 ((= ch 287) ; GWa
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1315 (message "Modify vowel to: [euiaE'\"] ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1316 (setq vowel (read-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1317 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1318 ((= vowel ?e) 394)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1319 ((= vowel ?u) 442)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1320 ((= vowel ?i) 410)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1321 ((= vowel ?a) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1322 ((= vowel ?E) 426)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1323 ((= vowel ?') 442)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1324 ((= vowel ?\") (setq composite t) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1325 (t nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1326 ((= ch 335) ; fWa
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1327 (message "Modify vowel to: [euiaE'\"] ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1328 (setq vowel (read-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1329 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1330 ((= vowel ?e) 395)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1331 ((= vowel ?u) 443)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1332 ((= vowel ?i) 411)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1333 ((= vowel ?a) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1334 ((= vowel ?E) 427)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1335 ((= vowel ?') 443)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1336 ((= vowel ?\") (setq composite t) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1337 (t nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1338 ((= ch 343) ; pWa
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1339 (message "Modify vowel to: [euiaE'\"] ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1340 (setq vowel (read-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1341 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1342 ((= vowel ?e) 396)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1343 ((= vowel ?u) 444)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1344 ((= vowel ?i) 412)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1345 ((= vowel ?a) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1346 ((= vowel ?E) 428)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1347 ((= vowel ?') 444)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1348 ((= vowel ?\") (setq composite t) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1349 (t nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1350
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1351 ;; extended 12-form consonatns, mW* bW* GW* fW* pW*
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1352 ((memq base '(392 408 424 440)) ; *We *Wi *WE *W
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1353 (message "Modify vowel to: [eiEau'\"] ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1354 (setq vowel (read-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1355 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1356 ((= vowel ?e) (+ 392 modulo))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1357 ((= vowel ?i) (+ 408 modulo))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1358 ((= vowel ?E) (+ 424 modulo))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1359 ((= vowel ?a) (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1360 ((= modulo 0) 31) ; mWa
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1361 ((= modulo 1) 103) ; bWa
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1362 ((= modulo 2) 287) ; GWa
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1363 ((= modulo 3) 335) ; fWa
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1364 ((= modulo 4) 343) ; pWa
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1365 (t nil))) ; never reach here
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1366 ((= vowel ?') (+ 440 modulo))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1367 ((= vowel ?u) (+ 440 modulo))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1368 ((= vowel ?\") (setq composite t) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1369 (t nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1370
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1371 ((and (>= ch 453) (<= ch 457)) ; wWe wWi wWa wWE wW
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1372 (message "Modify vowel to: [eiaE'u\"] ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1373 (setq vowel (read-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1374 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1375 ((= vowel ?e) 453)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1376 ((= vowel ?i) 454)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1377 ((= vowel ?a) 455)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1378 ((= vowel ?E) 456)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1379 ((= vowel ?') 457)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1380 ((= vowel ?u) 457)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1381 ((= vowel ?\") (setq composite t) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1382 (t nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1383
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1384 ;; 7-form consonants, or
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1385 ;; first 7 of 8-form consonants
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1386 ((<= modulo 6)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1387 (message "Modify vowel to: [euiaE'o\"] ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1388 (setq vowel (read-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1389 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1390 ((= vowel ?e) base)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1391 ((= vowel ?u) (+ base 1))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1392 ((= vowel ?i) (+ base 2))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1393 ((= vowel ?a) (+ base 3))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1394 ((= vowel ?E) (+ base 4))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1395 ((= vowel ?') (+ base 5))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1396 ((= vowel ?o) (+ base 6))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1397 ((= vowel ?\") (setq composite t) ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1398 (t nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1399
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1400 ;; otherwise
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1401 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1402 nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1403
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1404 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1405
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1406 ;; could not get new character
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1407 ((null newch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1408 (error "Invalid vowel"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1409
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1410 ;; vowel changed on a composite Fidel
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1411 (composite
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1412 (delete-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1413 (insert
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1414 (compose-string
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1415 (concat (char-to-string (ethio-ethiocode-to-char newch)) "$(3%s(B"))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1416
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1417 ;; simple vowel modification
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1418 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1419 (delete-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1420 (insert (ethio-ethiocode-to-char newch))))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1421
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1422 (defun ethio-ethiocode-to-char (ethiocode)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1423 (make-char
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1424 'ethiopic
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1425 (+ (/ ethiocode 94) 33)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1426 (+ (mod ethiocode 94) 33)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1427
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1428 (defun ethio-char-to-ethiocode (ch)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1429 (and (eq (char-charset ch) 'ethiopic)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1430 (let ((char-components (split-char ch)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1431 (+ (* (- (nth 1 char-components) 33) 94)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1432 (- (nth 2 char-components) 33)))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1433
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1434 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1435 ;; space replacement
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1436 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1437
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1438 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1439 (defun ethio-replace-space (ch begin end)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1440 "Replace ASCII spaces with Ethiopic word separators in the region.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1441
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1442 In the specified region, replace word separators surrounded by two
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1443 Ethiopic characters, depending on the first parameter CH, which should
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1444 be 1, 2, or 3.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1445
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1446 If CH = 1, word separator will be replaced with an ASCII space.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1447 If CH = 2, with two ASCII spaces.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1448 If CH = 3, with the Ethiopic colon-like word separator.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1449
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1450 The second and third parameters BEGIN and END specify the region."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1451
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1452 (interactive "*cReplace spaces to: 1 (sg col), 2 (dbl col), 3 (Ethiopic)\nr")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1453 (if (not (memq ch '(?1 ?2 ?3)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1454 (error ""))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1455 (save-excursion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1456 (save-restriction
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1457 (narrow-to-region begin end)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1458
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1459 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1460 ((= ch ?1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1461 ;; an Ethiopic word separator --> an ASCII space
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1462 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1463 (while (search-forward "$(3$h(B" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1464 (replace-match " " nil t))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1465
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1466 ;; two ASCII spaces between Ethiopic characters --> an ASCII space
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1467 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1468 (while (re-search-forward "\\(\\ce\\) \\(\\ce\\)" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1469 (replace-match "\\1 \\2")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1470 (goto-char (match-beginning 2))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1471
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1472 ((= ch ?2)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1473 ;; An Ethiopic word separator --> two ASCII spaces
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1474 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1475 (while (search-forward "$(3$h(B" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1476 (replace-match " "))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1477
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1478 ;; An ASCII space between Ethiopic characters --> two ASCII spaces
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1479 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1480 (while (re-search-forward "\\(\\ce\\) \\(\\ce\\)" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1481 (replace-match "\\1 \\2")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1482 (goto-char (match-beginning 2))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1483
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1484 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1485 ;; One or two ASCII spaces between Ethiopic characters
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1486 ;; --> An Ethiopic word separator
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1487 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1488 (while (re-search-forward "\\(\\ce\\) ?\\(\\ce\\)" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1489 (replace-match "\\1$(3$h(B\\2")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1490 (goto-char (match-beginning 2)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1491
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1492 ;; Three or more ASCII spaces between Ethiopic characters
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1493 ;; --> An Ethiopic word separator + (N - 2) ASCII spaces
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1494 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1495 (while (re-search-forward "\\(\\ce\\) \\( *\\ce\\)" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1496 (replace-match "\\1$(3$h(B\\2")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1497 (goto-char (match-beginning 2))))))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1498
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1499 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1500 ;; special icons
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1501 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1502
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1503 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1504 (defun ethio-input-special-character (arg)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1505 "Allow the user to input special characters."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1506 (interactive "*cInput number: 1.$(3%j(B 2.$(3%k(B 3.$(3%l(B 4.$(3%m(B 5.$(3%i(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1507 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1508 ((= arg ?1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1509 (insert "$(3%j(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1510 ((= arg ?2)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1511 (insert "$(3%k(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1512 ((= arg ?3)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1513 (insert "$(3%l(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1514 ((= arg ?4)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1515 (insert "$(3%m(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1516 ((= arg ?5)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1517 (insert "$(3%i(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1518 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1519 (error ""))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1520
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1521 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1522 ;; TeX support
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1523 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1524
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1525 (defconst ethio-fidel-to-tex-map
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1526 [ "heG" "huG" "hiG" "haG" "hEG" "hG" "hoG" "" ;; 0 - 7
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1527 "leG" "luG" "liG" "laG" "lEG" "lG" "loG" "lWaG" ;; 8
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1528 "HeG" "HuG" "HiG" "HaG" "HEG" "HG" "HoG" "HWaG" ;; 16
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1529 "meG" "muG" "miG" "maG" "mEG" "mG" "moG" "mWaG" ;; 24
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1530 "sseG" "ssuG" "ssiG" "ssaG" "ssEG" "ssG" "ssoG" "ssWaG" ;; 32
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1531 "reG" "ruG" "riG" "raG" "rEG" "rG" "roG" "rWaG" ;; 40
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1532 "seG" "suG" "siG" "saG" "sEG" "sG" "soG" "sWaG" ;; 48
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1533 "xeG" "xuG" "xiG" "xaG" "xEG" "xG" "xoG" "xWaG" ;; 56
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1534 "qeG" "quG" "qiG" "qaG" "qE" "qG" "qoG" "" ;; 64
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1535 "qWeG" "" "qWi" "qWaG" "qWEG" "qWG" "" "" ;; 72
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1536 "QeG" "QuG" "QiG" "QaG" "QEG" "QG" "QoG" "" ;; 80
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1537 "QWeG" "" "QWiG" "QWaG" "QWEG" "QWG" "" "" ;; 88
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1538 "beG" "buG" "biG" "baG" "bEG" "bG" "boG" "bWaG" ;; 96
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1539 "veG" "vuG" "viG" "vaG" "vEG" "vG" "voG" "vWaG" ;; 104
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1540 "teG" "tuG" "tiG" "taG" "tEG" "tG" "toG" "tWaG" ;; 112
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1541 "ceG" "cuG" "ciG" "caG" "cEG" "cG" "coG" "cWaG" ;; 120
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1542 "hheG" "hhuG" "hhiG" "hhaG" "hhEG" "hhG" "hhoG" "" ;; 128
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1543 "hWeG" "" "hWiG" "hWaG" "hWEG" "hWG" "" "" ;; 136
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1544 "neG" "nuG" "niG" "naG" "nEG" "nG" "noG" "nWaG" ;; 144
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1545 "NeG" "NuG" "NiG" "NaG" "NEG" "NG" "NoG" "NWaG" ;; 152
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1546 "eG" "uG" "iG" "AG" "EG" "IG" "oGG" "eaG" ;; 160
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1547 "keG" "kuG" "kiG" "kaG" "kEG" "kG" "koG" "" ;; 168
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1548 "kWeG" "" "kWiG" "kWa" "kWEG" "kWG" "" "" ;; 176
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1549 "KeG" "KuG" "KiG" "KaG" "KEG" "KG" "KoG" "" ;; 184
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1550 "KWeG" "" "KWiG" "KWa" "KWEG" "KWG" "" "" ;; 192
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1551 "weG" "wuG" "wiG" "waG" "wEG" "wG" "woG" "" ;; 200
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1552 "eeG" "uuG" "iiG" "aaG" "EEG" "IIG" "ooG" "" ;; 208
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1553 "zeG" "zuG" "ziG" "zaG" "zEG" "zG" "zoG" "zWaG" ;; 216
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1554 "ZeG" "ZuG" "ZiG" "ZaG" "ZEG" "ZG" "ZoG" "ZWaG" ;; 224
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1555 "yeG" "yuG" "yiG" "yaG" "yEG" "yG" "yoG" "yWaG" ;; 232
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1556 "deG" "duG" "diG" "daG" "dEG" "dG" "doG" "dWaG" ;; 240
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1557 "DeG" "DuG" "DiG" "DaG" "DEG" "DG" "DoG" "DWaG" ;; 248
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1558 "jeG" "juG" "jiG" "jaG" "jEG" "jG" "joG" "jWaG" ;; 256
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1559 "geG" "guG" "giG" "gaG" "gEG" "gG" "goG" "" ;; 264
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1560 "gWeG" "" "gWiG" "gWaG" "gWEG" "gWG" "" "" ;; 272
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1561 "GeG" "GuG" "GiG" "GaG" "GEG" "GG" "GoG" "GWaG" ;; 280
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1562 "TeG" "TuG" "TiG" "TaG" "TEG" "TG" "ToG" "TWaG" ;; 288
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1563 "CeG" "CuG" "CiG" "CaG" "CEG" "CG" "CoG" "CWaG" ;; 296
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1564 "PeG" "PuG" "PiG" "PaG" "PEG" "PG" "PoG" "PWaG" ;; 304
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1565 "SeG" "SuG" "SiG" "SaG" "SEG" "SG" "SoG" "SWaG" ;; 312
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1566 "SSeG" "SSuG" "SSiG" "SSaG" "SSEG" "SSG" "SSoG" "" ;; 320
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1567 "feG" "fuG" "fiG" "faG" "fEG" "fG" "foG" "fWaG" ;; 328
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1568 "peG" "puG" "piG" "paG" "pEG" "pG" "poG" "pWaG" ;; 336
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1569 "mYaG" "rYaG" "fYaG" "" "" "" "" "" ;; 344
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1570 "" "spaceG" "periodG" "commaG" ;; 352
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1571 "semicolonG" "colonG" "precolonG" "oldqmarkG" ;; 356
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1572 "pbreakG" "andG" "huletG" "sostG" "aratG" "amstG" "sadstG" "sabatG" ;; 360
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1573 "smntG" "zeteNG" "asrG" "heyaG" "selasaG" "arbaG" "hemsaG" "slsaG" ;; 368
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1574 "sebaG" "semanyaG" "zeTanaG" "metoG" "asrxiG" "" "" "" ;; 376
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1575 "qqeG" "qquG" "qqiG" "qqaG" "qqEG" "qqG" "qqoG" "" ;; 384
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1576 "mWeG" "bWeG" "GWeG" "fWeG" "pWeG" "" "" "" ;; 392
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1577 "kkeG" "kkuG" "kkiG" "kkaG" "kkEG" "kkG" "kkoG" "" ;; 400
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1578 "mWiG" "bWiG" "GWiG" "fWiG" "pWiG" "" "" "" ;; 408
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1579 "XeG" "XuG" "GXiG" "XaG" "XEG" "XG" "XoG" "" ;; 416
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1580 "mWEG" "bWEG" "GWEG" "fWEG" "pWEG" "" "" "" ;; 424
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1581 "ggeG" "gguG" "ggiG" "ggaG" "ggEG" "ggG" "ggoG" "" ;; 432
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1582 "mWG" "bWG" "GWG" "fWG" "pWG" "" "" "" ;; 440
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1583 "ornamentG" "flandG" "iflandG" "africaG" ;; 448
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1584 "iafricaG" "wWeG" "wWiG" "wWaG" ;; 452
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1585 "wWEG" "wWG" "" "slaqG" "dotG" "lquoteG" "rquoteG" "qmarkG" ]) ;; 456
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1586
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1587 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1588 ;; To make tex-to-fidel mapping.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1589 ;; The following code makes
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1590 ;; (get 'ethio-tex-command-he 'ethio-fidel-char) ==> ?$(3!!(B
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1591 ;; etc.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1592 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1593
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1594 (let ((i 0) str)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1595 (while (< i (length ethio-fidel-to-tex-map))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1596 (setq str (aref ethio-fidel-to-tex-map i))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1597 (if (not (string= str ""))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1598 (put
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1599 (intern (concat "ethio-tex-command-" (aref ethio-fidel-to-tex-map i)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1600 'ethio-fidel-char
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1601 (ethio-ethiocode-to-char i)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1602 (setq i (1+ i))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1603
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1604 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1605 (defun ethio-fidel-to-tex-buffer nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1606 "Convert each fidel characters in the current buffer into a fidel-tex command.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1607 Each command is always surrounded by braces."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1608 (interactive)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1609 (let ((buffer-read-only nil))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1610
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1611 ;; Isolated gemination marks need special treatement
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1612 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1613 (while (search-forward "$(3%s(B" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1614 (replace-match "\\geminateG{}" t t))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1615
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1616 ;; First, decompose geminations
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1617 ;; Here we assume that each composed character consists of
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1618 ;; one Ethiopic character and the Ethiopic gemination mark.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1619 (decompose-region (point-min) (point-max))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1620
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1621 ;; Special treatment for geminated characters
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1622 ;; The geminated character (la'') will be "\geminateG{\la}".
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1623 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1624 (while (search-forward "$(3%s(B" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1625 (delete-backward-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1626 (backward-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1627 (insert "\\geminateG")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1628 (forward-char 1))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1629
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1630 ;; Ethiopic characters to TeX macros
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1631 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1632 (while (re-search-forward "\\ce" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1633 (insert
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1634 "{\\"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1635 (aref ethio-fidel-to-tex-map
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1636 (prog1 (ethio-char-to-ethiocode (preceding-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1637 (backward-delete-char 1)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1638 "}"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1639 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1640 (set-buffer-modified-p nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1641
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1642 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1643 (defun ethio-tex-to-fidel-buffer nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1644 "Convert fidel-tex commands in the current buffer into fidel chars."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1645 (interactive)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1646 (let ((buffer-read-only nil)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1647 (p) (ch))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1648
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1649 ;; Special treatment for gemination
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1650 ;; "\geminateG{\la}" or "\geminateG{{\la}}" will be "\la$(3%s(B"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1651 ;; "\geminateG{}" remains unchanged.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1652 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1653 (while (re-search-forward "\\\\geminateG{\\(\\\\[a-zA-Z]+\\)}" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1654 (replace-match "\\1$(3%s(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1655
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1656 ;; TeX macros to Ethiopic characters
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1657 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1658 (while (search-forward "\\" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1659 (setq p (point))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1660 (skip-chars-forward "a-zA-Z")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1661 (setq ch
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1662 (get (intern (concat "ethio-tex-command-"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1663 (buffer-substring p (point))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1664 'ethio-fidel-char))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1665 (if ch
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1666 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1667 (delete-region (1- p) (point)) ; don't forget the preceding "\"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1668 (if (and (= (preceding-char) ?{)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1669 (= (following-char) ?}))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1670 (progn
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1671 (backward-delete-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1672 (delete-char 1)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1673 (insert ch))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1674
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1675 ;; compose geminated characters
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1676 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1677 (while (re-search-forward "\\ce$(3%s(B" nil 0)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1678 (compose-region
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1679 (save-excursion (backward-char 2) (point))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1680 (point)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1681
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1682 ;; Now it's time to convert isolated gemination marks.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1683 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1684 (while (search-forward "\\geminateG{}" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1685 (replace-match "$(3%s(B"))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1686
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1687 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1688 (set-buffer-modified-p nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1689
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1690 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1691 ;; Java support
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1692 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1693
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1694 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1695 (defun ethio-fidel-to-java-buffer nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1696 "Convert Ethiopic characters into the Java escape sequences.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1697
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1698 Each escape sequence is of the form \uXXXX, where XXXX is the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1699 character's codepoint (in hex) in Unicode.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1700
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1701 If `ethio-java-save-lowercase' is non-nil, use [0-9a-f].
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1702 Otherwise, [0-9A-F]."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1703 (let ((ucode))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1704
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1705 ;; first, decompose geminations
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1706 (decompose-region (point-min) (point-max))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1707
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1708 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1709 (while (re-search-forward "\\ce" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1710 (setq ucode (+ ?\x1200 (ethio-char-to-ethiocode (preceding-char))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1711 (if (> ucode ?\x13bc)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1712 (setq ucode (+ ucode 59952)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1713 (delete-backward-char 1)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1714 (if ethio-java-save-lowercase
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1715 (insert (format "\\u%4x" ucode))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1716 (insert (upcase (format "\\u%4x" ucode)))))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1717
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1718 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1719 (defun ethio-java-to-fidel-buffer nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1720 "Convert the Java escape sequences into corresponding Ethiopic characters."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1721 (let ((ucode))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1722 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1723 (while (re-search-forward "\\\\u\\([0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]\\)" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1724 (setq ucode
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1725 (read
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1726 (concat
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1727 "?\\x"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1728 (buffer-substring (match-beginning 1) (match-end 1)))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1729 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1730 ((and (>= ucode ?\x1200) (<= ucode ?\x13bc))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1731 (replace-match "")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1732 (insert (ethio-ethiocode-to-char (- ucode ?\x1200))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1733 ((and (>= ucode ?\xfdf1) (<= ucode ?\xfdff))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1734 (replace-match "")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1735 (insert (ethio-ethiocode-to-char (- ucode 64560))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1736 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1737 nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1738
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1739 ;; gemination
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1740 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1741 (while (re-search-forward "\\ce$(3%s(B" nil 0)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1742 (compose-region
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1743 (save-excursion (backward-char 2) (point))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1744 (point)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1745 ))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1746
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1747 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1748 ;; file I/O hooks
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1749 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1750
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1751 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1752 (defun ethio-find-file nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1753 "Transcribe file content into Ethiopic dependig on filename suffix."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1754 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1755
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1756 ((string-match "\\.sera$" (buffer-file-name))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1757 (save-excursion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1758 (ethio-sera-to-fidel-buffer nil 'force)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1759 (set-buffer-modified-p nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1760
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1761 ((string-match "\\.html$" (buffer-file-name))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1762 (let ((sera-being-called-by-w3 t))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1763 (save-excursion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1764 (ethio-sera-to-fidel-marker 'force)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1765 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1766 (while (re-search-forward "&[lr]aquote;" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1767 (if (= (char-after (1+ (match-beginning 0))) ?l)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1768 (replace-match "$(3%v(B")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1769 (replace-match "$(3%w(B")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1770 (set-buffer-modified-p nil))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1771
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1772 ((string-match "\\.tex$" (buffer-file-name))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1773 (save-excursion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1774 (ethio-tex-to-fidel-buffer)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1775 (set-buffer-modified-p nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1776
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1777 ((string-match "\\.java$" (buffer-file-name))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1778 (save-excursion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1779 (ethio-java-to-fidel-buffer)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1780 (set-buffer-modified-p nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1781
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1782 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1783 nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1784
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1785 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1786 (defun ethio-write-file nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1787 "Transcribe Ethiopic characters in ASCII depending on the file extension."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1788 (cond
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1789
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1790 ((string-match "\\.sera$" (buffer-file-name))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1791 (save-excursion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1792 (ethio-fidel-to-sera-buffer nil 'force)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1793 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1794 (ethio-record-user-preference)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1795 (set-buffer-modified-p nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1796
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1797 ((string-match "\\.html$" (buffer-file-name))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1798 (save-excursion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1799 (let ((sera-being-called-by-w3 t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1800 (lq (aref ethio-fidel-to-sera-map 461))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1801 (rq (aref ethio-fidel-to-sera-map 462)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1802 (aset ethio-fidel-to-sera-map 461 "&laquote;")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1803 (aset ethio-fidel-to-sera-map 462 "&raquote;")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1804 (ethio-fidel-to-sera-marker 'force)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1805 (goto-char (point-min))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1806 (if (search-forward "<sera>" nil t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1807 (ethio-record-user-preference))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1808 (aset ethio-fidel-to-sera-map 461 lq)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1809 (aset ethio-fidel-to-sera-map 462 rq)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1810 (set-buffer-modified-p nil))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1811
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1812 ((string-match "\\.tex$" (buffer-file-name))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1813 (save-excursion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1814 (ethio-fidel-to-tex-buffer)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1815 (set-buffer-modified-p nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1816
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1817 ((string-match "\\.java$" (buffer-file-name))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1818 (save-excursion
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1819 (ethio-fidel-to-java-buffer)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1820 (set-buffer-modified-p nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1821
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1822 (t
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1823 nil)))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1824
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1825 (defun ethio-record-user-preference nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1826 (if (looking-at "\\\\~\\(tir?\\|amh?\\) ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1827 (goto-char (match-end 0))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1828 (insert (if (ethio-prefer-amharic-p) "\\~amh " "\\~tir ")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1829 (insert (if ethio-use-colon-for-colon "\\~-: " "\\~`: ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1830 (if ethio-use-three-dot-question "\\~`| " "\\~`? ")))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1831
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1832 (add-hook 'find-file-hooks 'ethio-find-file)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1833 (add-hook 'write-file-hooks 'ethio-write-file)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1834 (add-hook 'after-save-hook 'ethio-find-file)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1835
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1836 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1837 (provide 'language/ethio-util)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1838
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1839 ;;; Local Variables:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1840 ;;; generated-autoload-file: "../loaddefs.el"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1841 ;;; End:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1842 ;;; ethio-util.el ends here