annotate lisp/mule/ethiopic.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents
children 5a88923fcbfe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1 ;; Ethiopic language utilities for Mule
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2 ;; Copyright (C) 1994, 1995 Free Software Foundation, Inc.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
3
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
4 ;; This file is part of XEmacs.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
5 ;; This file contains Ethiopic characters.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
7 ;; XEmacs is free software; you can redistribute it and/or modify it
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
8 ;; under the terms of the GNU General Public License as published by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
9 ;; the Free Software Foundation; either version 2, or (at your option)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
10 ;; any later version.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
11
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
12 ;; XEmacs is distributed in the hope that it will be useful, but
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
13 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
15 ;; General Public License for more details.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
16
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
17 ;; You should have received a copy of the GNU General Public License
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
18 ;; along with XEmacs; see the file COPYING. If not, write to the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
19 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
20 ;; Boston, MA 02111-1307, USA.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
21
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
22 ;;; 94.10.13 created for Mule Ver.2.1 by TAKAHASHI Naoto <ntakahas@etl.go.jp>
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
23 ;;; 94.12.27 modified for Mule Ver.2.2 by TAKAHASHI Naoto <ntakahas@etl.go.jp>
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
24 ;;; 95.7.24 modified for Mule Ver.2.3 by TAKAHASHI Naoto <ntakahas@etl.go.jp>
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
25
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
26 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
27 ;; ETHIOPIC UTILITY FUNCTIONS
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
28 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
29
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
30 ;; To automatically convert Ethiopic text to SERA format when sending mail,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
31 ;; (add-hook 'mail-send-hook 'fidel-to-sera-mail)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
32 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
33 ;; To automatically convert SERA format to Ethiopic when receiving mail,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
34 ;; (add-hook 'rmail-show-message-hook 'sera-to-fidel-mail)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
35 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
36 ;; To automatically convert Ethiopic text to SERA format when posting news,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
37 ;; (add-hook 'news-inews-hook 'fidel-to-sera-mail)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
38 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
39 ;; If the filename ends in ".sera", editing will be done in fidel
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
40 ;; while file I/O will be done in sera.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
41 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
42 ;; The following two functions have been removed.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
43 ;; fidel-to-sera-for-disksave
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
44 ;; sera-to-fidel-for-disksave
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
45
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
46 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
47 ;; SERA to FIDEL
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
48 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
49
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
50 (defconst sera-to-fidel-table
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
51 [
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
52 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
53 nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
54 ;;; SP ! " # $ % & ' ( ) * + , - . /
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
55 nil nil nil nil nil nil nil ("") nil nil nil nil ("$(2$Q(B") nil ("$(2$P(B") nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
56 ;;; 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
57 nil nil nil nil nil nil nil nil nil nil ("$(2$S(B") ("$(2$R(B") nil nil nil nil nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
58 ;;; A
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
59 ("$(2"V(B" (?2 "$(2#b(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
60 ;;; B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
61 ("$(2!F(B" (?e "$(2!A(B") (?u "$(2!B(B") (?i "$(2!C(B") (?a "$(2!D(B") (?E "$(2!E(B") (?o "$(2!G(B") (?| "$(2!F(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
62 (?W "$(2!H(B" (?a "$(2!H(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
63 (?e "$(2!F#L(B") (?u "$(2!F#M(B") (?i "$(2!F#N(B") (?E "$(2!F#P(B") (?' "$(2!F#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
64 ;;; C
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
65 ("$(2"8(B" (?e "$(2"3(B") (?u "$(2"4(B") (?i "$(2"5(B") (?a "$(2"6(B") (?E "$(2"7(B") (?o "$(2"9(B") (?| "$(2"8(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
66 (?W "$(2":(B" (?a "$(2":(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
67 (?e "$(2"8#L(B") (?u "$(2"8#M(B") (?i "$(2"8#N(B") (?E "$(2"8#P(B") (?' "$(2"8#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
68 ;;; D
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
69 ("$(2$0(B" (?e "$(2$+(B") (?u "$(2$,(B") (?i "$(2$-(B") (?a "$(2$.(B") (?E "$(2$/(B") (?o "$(2$1(B") (?| "$(2$0(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
70 ;;; E
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
71 ("$(2"W(B" (?2 "$(2#c(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
72 ;;; F
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
73 ("$(2"@(B" (?e "$(2";(B") (?u "$(2"<(B") (?i "$(2"=(B") (?a "$(2">(B") (?E "$(2"?(B") (?o "$(2"A(B") (?| "$(2"@(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
74 (?W "$(2"B(B" (?a "$(2"B(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
75 (?e "$(2"@#L(B") (?u "$(2"@#M(B") (?i "$(2"@#N(B") (?E "$(2"@#P(B") (?' "$(2"@#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
76 ;;; G
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
77 ("$(2$>(B" (?e "$(2$9(B") (?u "$(2$:(B") (?i "$(2$;(B") (?a "$(2$<(B") (?E "$(2$=(B") (?o "$(2$?(B") (?| "$(2$>(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
78 ;;; H
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
79 ("$(2$"(B" (?e "$(2#{(B") (?u "$(2#|(B") (?i "$(2#}(B") (?a "$(2#~(B") (?E "$(2$!(B") (?o "$(2$#(B") (?| "$(2$"(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
80 ;;; I
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
81 ("$(2"X(B" (?2 "$(2#d(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
82 ;;; J
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
83 ("$(2$7(B" (?e "$(2$2(B") (?u "$(2$3(B") (?i "$(2$4(B") (?a "$(2$5(B") (?E "$(2$6(B") (?o "$(2$8(B") (?| "$(2$7(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
84 ;;; K
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
85 ("$(2"x(B" (?e "$(2"s(B") (?u "$(2"t(B") (?i "$(2"u(B") (?a "$(2"v(B") (?E "$(2"w(B") (?o "$(2"y(B") (?| "$(2"x(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
86 (?W "$(2"{(B" (?e "$(2"z(B") (?u "$(2"{(B") (?i "$(2"|(B") (?a "$(2"}(B") (?E "$(2"~(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
87 ;;; L
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
88 ("$(2!&(B" (?e "$(2!!(B") (?u "$(2!"(B") (?i "$(2!#(B") (?a "$(2!$(B") (?E "$(2!%(B") (?o "$(2!'(B") (?| "$(2!&(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
89 (?W "$(2!((B" (?a "$(2!((B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
90 (?e "$(2!&#L(B") (?u "$(2!&#M(B") (?i "$(2!&#N(B") (?E "$(2!&#P(B") (?' "$(2!&#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
91 ;;; M
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
92 ("$(2!.(B" (?e "$(2!)(B") (?u "$(2!*(B") (?i "$(2!+(B") (?a "$(2!,(B") (?E "$(2!-(B") (?o "$(2!/(B") (?| "$(2!.(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
93 (?W "$(2!0(B" (?a "$(2!0(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
94 (?e "$(2!.#L(B") (?u "$(2!.#M(B") (?i "$(2!.#N(B") (?E "$(2!.#P(B") (?' "$(2!.#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
95 ;;; N
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
96 ("$(2!n(B" (?e "$(2!i(B") (?u "$(2!j(B") (?i "$(2!k(B") (?a "$(2!l(B") (?E "$(2!m(B") (?o "$(2!o(B") (?| "$(2!n(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
97 (?W "$(2!p(B" (?a "$(2!p(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
98 (?e "$(2!n#L(B") (?u "$(2!n#M(B") (?i "$(2!n#N(B") (?E "$(2!n#P(B") (?' "$(2!n#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
99 ;;; O
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
100 ("$(2"Y(B" (?2 "$(2#e(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
101 ;;; P
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
102 ("$(2$E(B" (?e "$(2$@(B") (?u "$(2$A(B") (?i "$(2$B(B") (?a "$(2$C(B") (?E "$(2$D(B") (?o "$(2$F(B") (?| "$(2$E(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
103 ;;; Q
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
104 ("$(2#2(B" (?e "$(2#-(B") (?u "$(2#.(B") (?i "$(2#/(B") (?a "$(2#0(B") (?E "$(2#1(B") (?o "$(2#3(B") (?| "$(2#2(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
105 (?W "$(2#5(B" (?e "$(2#4(B") (?u "$(2#5(B") (?i "$(2#6(B") (?a "$(2#7(B") (?E "$(2#8(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
106 ;;; R
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
107 ("$(2!6(B" (?e "$(2!1(B") (?u "$(2!2(B") (?i "$(2!3(B") (?a "$(2!4(B") (?E "$(2!5(B") (?o "$(2!7(B") (?| "$(2!6(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
108 (?W "$(2!8(B" (?a "$(2!8(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
109 (?e "$(2!6#L(B") (?u "$(2!6#M(B") (?i "$(2!6#N(B") (?E "$(2!6#P(B") (?' "$(2!6#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
110 ;;; S
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
111 ("$(2"P(B" (?e "$(2"K(B") (?u "$(2"L(B") (?i "$(2"M(B") (?a "$(2"N(B") (?E "$(2"O(B") (?o "$(2"Q(B") (?| "$(2"P(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
112 (?W "$(2"R(B" (?a "$(2"R(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
113 (?e "$(2"P#L(B") (?u "$(2"P#M(B") (?i "$(2"P#N(B") (?E "$(2"P#P(B") (?' "$(2"P#M(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
114 (?2 "$(2#](B" (?| "$(2#](B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
115 (?e "$(2#X(B") (?u "$(2#Y(B") (?i "$(2#Z(B") (?a "$(2#[(B") (?E "$(2#\(B") (?o "$(2#^(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
116 (?W "$(2"R(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
117 (?a "$(2"R(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
118 (?e "$(2#]#L(B") (?u "$(2#]#M(B") (?i "$(2#]#N(B") (?E "$(2#]#P(B") (?' "$(2#]#M(B"))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
119
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
120 ;;; T
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
121 ("$(2"0(B" (?e "$(2"+(B") (?u "$(2",(B") (?i "$(2"-(B") (?a "$(2".(B") (?E "$(2"/(B") (?o "$(2"1(B") (?| "$(2"0(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
122 (?W "$(2"2(B" (?a "$(2"2(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
123 (?e "$(2"0#L(B") (?u "$(2"0#M(B") (?i "$(2"0#N(B") (?E "$(2"0#P(B") (?' "$(2"0#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
124 ;;; U
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
125 ("$(2"T(B" (?2 "$(2#`(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
126 ;;; V
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
127 ("$(2!N(B" (?e "$(2!I(B") (?u "$(2!J(B") (?i "$(2!K(B") (?a "$(2!L(B") (?E "$(2!M(B") (?o "$(2!O(B") (?| "$(2!N(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
128 (?W "$(2!P(B" (?a "$(2!P(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
129 (?e "$(2!N#L(B") (?u "$(2!N#M(B") (?i "$(2!N#N(B") (?E "$(2!N#P(B") (?' "$(2!N#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
130 ;;; W
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
131 ("$(2#M(B" (?e "$(2#L(B") (?u "$(2#M(B") (?i "$(2#N(B") (?a "$(2#O(B") (?E "$(2#P(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
132 ;;; X
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
133 ("$(2#y(B" (?e "$(2#t(B") (?u "$(2#u(B") (?i "$(2#v(B") (?a "$(2#w(B") (?E "$(2#x(B") (?o "$(2#z(B") (?| "$(2#y(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
134 ;;; Y
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
135 ("$(2$)(B" (?e "$(2$$(B") (?u "$(2$%(B") (?i "$(2$&(B") (?a "$(2$'(B") (?E "$(2$((B") (?o "$(2$*(B") (?| "$(2$)(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
136 ;;; Z
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
137 ("$(2!~(B" (?e "$(2!y(B") (?u "$(2!z(B") (?i "$(2!{(B") (?a "$(2!|(B") (?E "$(2!}(B") (?o "$(2"!(B") (?| "$(2!~(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
138 (?W "$(2""(B" (?a "$(2""(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
139 (?e "$(2!~#L(B") (?u "$(2!~#M(B") (?i "$(2!~#N(B") (?E "$(2!~#P(B") (?' "$(2!~#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
140 ;;; [ \ ] ^ _
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
141 nil nil nil nil nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
142 ;;; `
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
143 ("`"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
144 (?e "$(2#_(B") (?u "$(2#`(B") (?U "$(2#`(B") (?i "$(2#a(B") (?a "$(2#b(B") (?A "$(2#b(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
145 (?E "$(2#c(B") (?I "$(2#d(B") (?o "$(2#e(B") (?O "$(2#e(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
146 (?s "$(2#V(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
147 (?e "$(2#Q(B") (?u "$(2#R(B") (?i "$(2#S(B") (?a "$(2#T(B") (?E "$(2#U(B") (?o "$(2#W(B") (?| "$(2#V(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
148 (?W "$(2"J(B" (?a "$(2"J(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
149 (?e "$(2#V#L(B") (?u "$(2#V#M(B") (?i "$(2#V#N(B") (?E "$(2#V#P(B") (?' "$(2#V#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
150 (?S "$(2#](B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
151 (?e "$(2#X(B") (?u "$(2#Y(B") (?i "$(2#Z(B") (?a "$(2#[(B") (?E "$(2#\(B") (?o "$(2#^(B") (?| "$(2#](B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
152 (?W "$(2"R(B" (?a "$(2"R(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
153 (?e "$(2#]#L(B") (?u "$(2#]#M(B") (?i "$(2#]#N(B") (?E "$(2#]#P(B") (?' "$(2#]#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
154 (?h "$(2#k(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
155 (?e "$(2#f(B") (?u "$(2#g(B") (?i "$(2#h(B") (?a "$(2#i(B") (?E "$(2#j(B") (?o "$(2#l(B") (?| "$(2#k(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
156 (?W "$(2"c(B" (?e "$(2"b(B") (?u "$(2"c(B") (?i "$(2"d(B") (?a "$(2"e(B") (?E "$(2"f(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
157 (?k "$(2#r(B"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
158 (?e "$(2#m(B") (?u "$(2#n(B") (?i "$(2#o(B") (?a "$(2#p(B") (?E "$(2#q(B") (?o "$(2#s(B") (?| "$(2#r(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
159 ;;; a
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
160 ("$(2"S(B" (?2 "$(2#b(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
161
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
162 ;;; b
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
163 ("$(2!F(B" (?e "$(2!A(B") (?u "$(2!B(B") (?i "$(2!C(B") (?a "$(2!D(B") (?E "$(2!E(B") (?o "$(2!G(B") (?| "$(2!F(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
164 (?W "$(2!H(B" (?a "$(2!H(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
165 (?e "$(2!F#L(B") (?u "$(2!F#M(B") (?i "$(2!F#N(B") (?E "$(2!F#P(B") (?' "$(2!F#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
166 ;;; c
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
167 ("$(2!^(B" (?e "$(2!Y(B") (?u "$(2!Z(B") (?i "$(2![(B") (?a "$(2!\(B") (?E "$(2!](B") (?o "$(2!_(B") (?| "$(2!^(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
168 (?W "$(2!`(B" (?a "$(2!`(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
169 (?e "$(2!^#L(B") (?u "$(2!^#M(B") (?i "$(2!^#N(B") (?E "$(2!^#P(B") (?' "$(2!^#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
170 ;;; d
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
171 ("$(2"((B" (?e "$(2"#(B") (?u "$(2"$(B") (?i "$(2"%(B") (?a "$(2"&(B") (?E "$(2"'(B") (?o "$(2")(B") (?| "$(2"((B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
172 (?W "$(2"*(B" (?a "$(2"*(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
173 (?e "$(2"(#L(B") (?u "$(2"(#M(B") (?i "$(2"(#N(B") (?E "$(2"(#P(B") (?' "$(2"(#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
174 ;;; e
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
175 ("$(2"S(B" (?2 "$(2#_(B") (?3 "$(2"Z(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
176 ;;; f
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
177 ("$(2"@(B" (?e "$(2";(B") (?u "$(2"<(B") (?i "$(2"=(B") (?a "$(2">(B") (?E "$(2"?(B") (?o "$(2"A(B") (?| "$(2"@(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
178 (?W "$(2"B(B" (?a "$(2"B(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
179 (?e "$(2"@#L(B") (?u "$(2"@#M(B") (?i "$(2"@#N(B") (?E "$(2"@#P(B") (?' "$(2"@#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
180 ;;; g
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
181 ("$(2#>(B" (?e "$(2#9(B") (?u "$(2#:(B") (?i "$(2#;(B") (?a "$(2#<(B") (?E "$(2#=(B") (?o "$(2#?(B") (?| "$(2#>(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
182 (?W "$(2#A(B" (?e "$(2#@(B") (?u "$(2#A(B") (?i "$(2#B(B") (?a "$(2#C(B") (?E "$(2#D(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
183 ;;; h
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
184 ("$(2"`(B" (?e "$(2"[(B") (?u "$(2"\(B") (?i "$(2"](B") (?a "$(2"^(B") (?E "$(2"_(B") (?o "$(2"a(B") (?| "$(2"`(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
185 (?W "$(2"c(B" (?e "$(2"b(B") (?u "$(2"c(B") (?i "$(2"d(B") (?a "$(2"e(B") (?E "$(2"f(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
186 (?2 "$(2#k(B" (?e "$(2#f(B") (?u "$(2#g(B") (?i "$(2#h(B") (?a "$(2#i(B") (?E "$(2#j(B") (?o "$(2#l(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
187 (?| "$(2#k(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
188 (?W "$(2"c(B" (?e "$(2"b(B") (?u "$(2"c(B") (?i "$(2"d(B") (?a "$(2"e(B") (?E "$(2"f(B"))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
189 ;;; i
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
190 ("$(2"U(B" (?2 "$(2#a(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
191 ;;; j
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
192 ("$(2$7(B" (?e "$(2$2(B") (?u "$(2$3(B") (?i "$(2$4(B") (?a "$(2$5(B") (?E "$(2$6(B") (?o "$(2$8(B") (?| "$(2$7(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
193 ;;; k
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
194 ("$(2"l(B" (?e "$(2"g(B") (?u "$(2"h(B") (?i "$(2"i(B") (?a "$(2"j(B") (?E "$(2"k(B") (?o "$(2"m(B") (?| "$(2"l(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
195 (?W "$(2"o(B" (?e "$(2"n(B") (?u "$(2"o(B") (?i "$(2"p(B") (?a "$(2"q(B") (?E "$(2"r(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
196 (?2 "$(2#r(B" (?e "$(2#m(B") (?u "$(2#n(B") (?i "$(2#o(B") (?a "$(2#p(B") (?E "$(2#q(B") (?o "$(2#s(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
197 (?| "$(2#r(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
198 ;;; l
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
199 ("$(2!&(B" (?e "$(2!!(B") (?u "$(2!"(B") (?i "$(2!#(B") (?a "$(2!$(B") (?E "$(2!%(B") (?o "$(2!'(B") (?| "$(2!&(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
200 (?W "$(2!((B" (?a "$(2!((B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
201 (?e "$(2!&#L(B") (?u "$(2!&#M(B") (?i "$(2!&#N(B") (?E "$(2!&#P(B") (?' "$(2!&#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
202 ;;; m
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
203 ("$(2!.(B" (?e "$(2!)(B") (?u "$(2!*(B") (?i "$(2!+(B") (?a "$(2!,(B") (?E "$(2!-(B") (?o "$(2!/(B") (?| "$(2!.(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
204 (?W "$(2!0(B" (?a "$(2!0(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
205 (?e "$(2!.#L(B") (?u "$(2!.#M(B") (?i "$(2!.#N(B") (?E "$(2!.#P(B") (?' "$(2!.#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
206 ;;; n
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
207 ("$(2!f(B" (?e "$(2!a(B") (?u "$(2!b(B") (?i "$(2!c(B") (?a "$(2!d(B") (?E "$(2!e(B") (?o "$(2!g(B") (?| "$(2!f(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
208 (?W "$(2!h(B" (?a "$(2!h(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
209 (?e "$(2!f#L(B") (?u "$(2!f#M(B") (?i "$(2!f#N(B") (?E "$(2!f#P(B") (?' "$(2!f#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
210 ;;; o
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
211 ("$(2"Y(B" (?2 "$(2#e(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
212 ;;; p
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
213 ("$(2$L(B" (?e "$(2$G(B") (?u "$(2$H(B") (?i "$(2$I(B") (?a "$(2$J(B") (?E "$(2$K(B") (?o "$(2$M(B") (?| "$(2$L(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
214 ;;; q
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
215 ("$(2#&(B" (?e "$(2#!(B") (?u "$(2#"(B") (?i "$(2##(B") (?a "$(2#$(B") (?E "$(2#%(B") (?o "$(2#'(B") (?| "$(2#&(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
216 (?W "$(2#)(B" (?e "$(2#((B") (?u "$(2#)(B") (?i "$(2#*(B") (?a "$(2#+(B") (?E "$(2#,(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
217 ;;; r
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
218 ("$(2!6(B" (?e "$(2!1(B") (?u "$(2!2(B") (?i "$(2!3(B") (?a "$(2!4(B") (?E "$(2!5(B") (?o "$(2!7(B") (?| "$(2!6(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
219 (?W "$(2!8(B" (?a "$(2!8(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
220 (?e "$(2!6#L(B") (?u "$(2!6#M(B") (?i "$(2!6#N(B") (?E "$(2!6#P(B") (?' "$(2!6#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
221 ;;; s
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
222 ("$(2"H(B" (?e "$(2"C(B") (?u "$(2"D(B") (?i "$(2"E(B") (?a "$(2"F(B") (?E "$(2"G(B") (?o "$(2"I(B") (?| "$(2"H(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
223 (?W "$(2"J(B" (?a "$(2"J(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
224 (?e "$(2"H#L(B") (?u "$(2"H#M(B") (?i "$(2"H#N(B") (?E "$(2"H#P(B") (?' "$(2"H#M(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
225 (?2 "$(2#V(B" (?e "$(2#Q(B") (?u "$(2#R(B") (?i "$(2#S(B") (?a "$(2#T(B") (?E "$(2#U(B") (?o "$(2#W(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
226 (?| "$(2#V(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
227 (?W "$(2"J(B" (?a "$(2"J(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
228 (?e "$(2#V#L(B") (?u "$(2#V#M(B") (?i "$(2#V#N(B") (?E "$(2#V#P(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
229 (?' "$(2#V#M(B"))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
230 ;;; t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
231 ("$(2!V(B" (?e "$(2!Q(B") (?u "$(2!R(B") (?i "$(2!S(B") (?a "$(2!T(B") (?E "$(2!U(B") (?o "$(2!W(B") (?| "$(2!V(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
232 (?W "$(2!X(B" (?a "$(2!X(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
233 (?e "$(2!V#L(B") (?u "$(2!V#M(B") (?i "$(2!V#N(B") (?E "$(2!V#P(B") (?' "$(2!V#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
234 ;;; u
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
235 ("$(2"T(B" (?2 "$(2#`(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
236 ;;; v
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
237 ("$(2!N(B" (?e "$(2!I(B") (?u "$(2!J(B") (?i "$(2!K(B") (?a "$(2!L(B") (?E "$(2!M(B") (?o "$(2!O(B") (?| "$(2!N(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
238 (?W "$(2!P(B" (?a "$(2!P(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
239 (?e "$(2!N#L(B") (?u "$(2!N#M(B") (?i "$(2!N#N(B") (?E "$(2!N#P(B") (?' "$(2!N#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
240 ;;; w
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
241 ("$(2#J(B" (?e "$(2#E(B") (?u "$(2#F(B") (?i "$(2#G(B") (?a "$(2#H(B") (?E "$(2#I(B") (?o "$(2#K(B") (?| "$(2#J(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
242 (?W "$(2#M(B" (?e "$(2#L(B") (?u "$(2#M(B") (?i "$(2#N(B") (?a "$(2#O(B") (?E "$(2#P(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
243 ;;; x
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
244 ("$(2!>(B" (?e "$(2!9(B") (?u "$(2!:(B") (?i "$(2!;(B") (?a "$(2!<(B") (?E "$(2!=(B") (?o "$(2!?(B") (?| "$(2!>(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
245 (?W "$(2!@(B" (?a "$(2!@(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
246 (?e "$(2!>#L(B") (?u "$(2!>#M(B") (?i "$(2!>#N(B") (?E "$(2!>#P(B") (?' "$(2!>#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
247 ;;; y
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
248 ("$(2$)(B" (?e "$(2$$(B") (?u "$(2$%(B") (?i "$(2$&(B") (?a "$(2$'(B") (?E "$(2$((B") (?o "$(2$*(B") (?| "$(2$)(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
249 ;;; z
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
250 ("$(2!v(B" (?e "$(2!q(B") (?u "$(2!r(B") (?i "$(2!s(B") (?a "$(2!t(B") (?E "$(2!u(B") (?o "$(2!w(B") (?| "$(2!v(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
251 (?W "$(2!x(B" (?a "$(2!x(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
252 (?e "$(2!v#L(B") (?u "$(2!v#M(B") (?i "$(2!v#N(B") (?E "$(2!v#P(B") (?' "$(2!v#M(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
253 ])
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
254
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
255 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
256 (defun sera-to-fidel-region (beg end &optional ascii-mode force)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
257 "Translates the characters in region from SERA to FIDEL.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
258
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
259 If the 1st optional parameter ASCII-MODE is non-NIL, assumes that the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
260 region begins in ASCII script.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
261
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
262 If the 2nd optional parametr FORCE is non-NIL, translates even if the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
263 buffer is read-only."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
264
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
265 (interactive "r\nP")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
266 (save-excursion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
267 (save-restriction
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
268 (narrow-to-region beg end)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
269 (sera-to-fidel-buffer ascii-mode force))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
270
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
271 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
272 (defun sera-to-fidel-buffer (&optional ascii-mode force)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
273 "Translates the current buffer from SERA to FIDEL.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
274
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
275 If the 1st optional parameter ASCII-MODE is non-NIL, assumes that the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
276 current buffer begins in ASCII script.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
277
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
278 If the 2nd optional panametr FORCE is non-NIL, translates even if the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
279 buffer is read-only."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
280
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
281 (interactive "P")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
282 (if (and buffer-read-only
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
283 (not force)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
284 (not (y-or-n-p "Buffer is read-only. Force to convert? ")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
285 (error ""))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
286 (let (start pre fol hard table table2 (buffer-read-only nil))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
287 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
288 (while (not (eobp))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
289 (setq start (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
290 (forward-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
291 (setq pre (preceding-char)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
292 fol (following-char))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
293
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
294 (if ascii-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
295 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
296
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
297 ;; ascii mode, pre != \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
298 ((/= pre ?\\ ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
299
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
300 ;; ascii mode, pre = \, fol = !
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
301 ((= fol ?!)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
302 (backward-delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
303 (delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
304 (setq ascii-mode nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
305 hard (not hard)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
306
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
307 ;; hard ascii mode, pre = \, fol != !
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
308 (hard)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
309
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
310 ;; soft ascii mode, pre = \, fol = {\ _ * < > 0..9 ~}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
311 ((or (backward-delete-char 1) ; always nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
312 (eobp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
313 (sera-to-fidel-backslash)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
314
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
315 ;; soft ascii mode, pre = \, fol = SPC
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
316 ((= fol 32)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
317 (delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
318 (setq ascii-mode nil))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
319
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
320 ;; soft ascii mode, pre = \, fol = .
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
321 ((= fol ?.)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
322 (delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
323 (insert ?$(2$P(B))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
324
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
325 ;; soft ascii mode, pre = \, fol = ,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
326 ((= fol ?,)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
327 (delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
328 (insert ?$(2$Q(B))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
329
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
330 ;; soft ascii mode, pre = \, fol = ;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
331 ((= fol ?\;)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
332 (delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
333 (insert ?$(2$R(B))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
334
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
335 ;; soft ascii mode, pre = \, fol = :
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
336 ((= fol ?:)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
337 (delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
338 (insert ?$(2$S(B))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
339
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
340 ;; soft ascii mode, pre = \, fol = others
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
341 (t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
342 (setq ascii-mode nil)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
343
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
344 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
345
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
346 ;; very special: skip "<" to ">" (or "&" to ";") if in w3-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
347 ((and (boundp 'sera-being-called-by-w3)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
348 sera-being-called-by-w3
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
349 (or (= pre ?<) (= pre ?&)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
350 (search-forward (if (= pre ?<) ">" ";")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
351 nil 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
352
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
353 ;; ethio mode, pre != sera
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
354 ((or (< pre ?') (> pre ?z)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
355
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
356 ;; ethio mode, pre != \
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
357 ((/= pre ?\\ )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
358 (setq table (aref sera-to-fidel-table pre))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
359 (while (setq table2 (cdr (assoc (following-char) table)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
360 (setq table table2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
361 (forward-char 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
362 (if (car table)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
363 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
364 (delete-region start (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
365 (insert (car table)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
366
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
367 ;; ethio mode, pre = \, fol = !
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
368 ((= fol ?!)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
369 (backward-delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
370 (delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
371 (setq ascii-mode t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
372 hard (not hard)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
373
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
374 ;; hard ethio mode, pre = \, fol != !
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
375 (hard)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
376
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
377 ;; soft ethio mode, pre = \, fol = {\ _ * < > 0..9 ~}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
378 ((or (backward-delete-char 1) ; always nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
379 (eobp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
380 (sera-to-fidel-backslash)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
381
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
382 ;; soft ethio mode, pre = \, fol = SPC
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
383 ((= fol 32)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
384 (delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
385 (setq ascii-mode t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
386
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
387 ;; soft ethio mode, pre = \, fol = {. , ; : | ' `}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
388 ((memq fol '(?. ?, ?\; ?: ?| ?' ?`))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
389 (forward-char 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
390
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
391 ;; soft ethio mode, pre = \, fol = others
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
392 (t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
393 (setq ascii-mode t))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
394 (goto-char (point-min)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
395
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
396 (defun sera-to-fidel-backslash nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
397 "Handle SERA backslash escapes common to ethio- and ascii-mode.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
398 Returns t if something has been processed."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
399 (let ((ch (following-char))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
400 (converted t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
401 (if (and (>= ch ?1) (<= ch ?9))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
402 (ethio-convert-digit)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
403 (delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
404 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
405 ((= ch ?\\ )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
406 (insert ?\\ ))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
407 ((= ch ?_)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
408 (insert ?$(2$O(B))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
409 ((= ch ?*)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
410 (insert ?$(2$T(B))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
411 ((= ch ?<)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
412 (insert ?$(2$U(B))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
413 ((= ch ?>)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
414 (insert ?$(2$V(B))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
415 ((= ch ?~)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
416 (setq ch (following-char))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
417 (delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
418 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
419 ((= ch ?e)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
420 (insert "$(2$k(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
421 ((= ch ?E)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
422 (insert "$(2$l(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
423 ((= ch ?a)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
424 (insert "$(2$m(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
425 ((= ch ?A)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
426 (insert "$(2$n(B"))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
427 (t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
428 (insert ch)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
429 (backward-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
430 (setq converted nil))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
431 converted))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
432
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
433 (defun ethio-convert-digit nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
434 "Convert Arabic digits to Ethiopic digits."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
435 (let (ch z)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
436 (while (and (>= (setq ch (following-char)) ?1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
437 (<= ch ?9))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
438 (delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
439
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
440 ;; count up following zeros
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
441 (setq z 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
442 (while (= (following-char) ?0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
443 (delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
444 (setq z (1+ z)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
445
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
446 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
447
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
448 ;; first digit is 10, 20, ..., or 90
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
449 ((= (mod z 2) 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
450 ;; (- ch 40) means ?1 -> 9, ?2 -> 10, etc.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
451 (insert (aref [?$(2$`(B ?$(2$a(B ?$(2$b(B ?$(2$c(B ?$(2$d(B ?$(2$e(B ?$(2$f(B ?$(2$g(B ?$(2$h(B] (- ch ?1)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
452 (setq z (1- z)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
453
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
454 ;; first digit is 2, 3, ..., or 9
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
455 ((/= ch ?1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
456 (insert (aref [?$(2$X(B ?$(2$Y(B ?$(2$Z(B ?$(2$[(B ?$(2$\(B ?$(2$](B ?$(2$^(B ?$(2$_(B] (- ch ?2))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
457
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
458 ;; single 1
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
459 ((= z 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
460 (insert "$(2$W(B")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
461
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
462 ;; 100
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
463 (if (= (mod z 4) 2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
464 (insert"$(2$i(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
465
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
466 ;; 10000
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
467 (insert-char ?$(2$j(B (/ z 4)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
468
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
469 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
470 (defun sera-to-fidel-mail (&optional arg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
471 "Does SERA to FIDEL conversion for reading/writing mail and news.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
472
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
473 If the buffer contains the markers \"<sera>\" and \"</sera>\",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
474 converts the segment between the two markers in Ethio start mode and
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
475 the subject field in ASCII start mode.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
476
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
477 If invoked interactively and there is no marker, converts both the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
478 whole body and the subject field in Ethio start mode.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
479
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
480 For backward compatibility, \"<ethiopic>\" and \"<>\" can be used instead of
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
481 \"<sera>\" and \"</sera>\"."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
482
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
483 (interactive "p")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
484 (let* ((buffer-read-only nil) border)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
485
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
486 (save-excursion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
487 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
488 (setq border
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
489 (search-forward
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
490 (if (eq major-mode 'rmail-mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
491 "\n\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
492 (concat "\n" mail-header-separator "\n"))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
493
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
494 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
495
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
496 ;; with markers
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
497 ((re-search-forward "^<sera>\n" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
498 (goto-char (match-beginning 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
499 (while (re-search-forward "^<sera>\n" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
500 (replace-match "" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
501 (sera-to-fidel-region
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
502 (point)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
503 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
504 (if (re-search-forward "^</sera>\n" nil 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
505 (replace-match "" nil t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
506 (point))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
507
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
508 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
509 (if (re-search-forward "^Subject: " border t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
510 (sera-to-fidel-region
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
511 (point)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
512 (progn (end-of-line) (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
513 'ascii-start)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
514
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
515 ;; backward compatibility
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
516 ((re-search-forward "^<ethiopic>\n" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
517 (goto-char (match-beginning 0))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
518 (while (re-search-forward "^<ethiopic>\n" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
519 (replace-match "" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
520 (sera-to-fidel-region
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
521 (setq border (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
522 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
523 (if (re-search-forward "^<>\n" nil 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
524 (replace-match "" nil t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
525 (point))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
526
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
527 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
528 (if (re-search-forward "^Subject: " border t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
529 (sera-to-fidel-region
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
530 (point)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
531 (progn (end-of-line) (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
532 'ascii-start)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
533
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
534 ;; interactive & no markers
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
535 (arg
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
536 (sera-to-fidel-region border (point-max))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
537 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
538 (if (re-search-forward "^Subject: " border t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
539 (sera-to-fidel-region
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
540 (point)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
541 (progn (end-of-line) (point))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
542
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
543 ;; adjust the rmail marker
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
544 (if (eq major-mode 'rmail-mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
545 (set-marker
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
546 (aref rmail-message-vector (1+ rmail-current-message))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
547 (point-max))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
548
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
549 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
550 (defun sera-to-fidel-marker nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
551 "If the buffer contains the markers \"<sera>\" and \"</sera>\",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
552 converts the segment between the two markers from SERA to Fidel
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
553 in Ethio start mode. The markers will not be removed."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
554
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
555 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
556 (if (and buffer-read-only
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
557 (not (y-or-n-p "Buffer is read-only. Force to convert? ")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
558 (error ""))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
559 (save-excursion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
560 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
561 (while (re-search-forward "<sera>" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
562 (sera-to-fidel-region
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
563 (point)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
564 (if (re-search-forward "</sera>" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
565 (match-beginning 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
566 (point-max))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
567 nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
568 'force))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
569
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
570 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
571 ;; FIDEL to SERA
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
572 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
573
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
574 (defconst fidel-to-sera-map
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
575 ["le" "lu" "li" "la" "lE" "l" "lo" "lWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
576 "me" "mu" "mi" "ma" "mE" "m" "mo" "mWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
577 "re" "ru" "ri" "ra" "rE" "r" "ro" "rWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
578 "xe" "xu" "xi" "xa" "xE" "x" "xo" "xWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
579 "be" "bu" "bi" "ba" "bE" "b" "bo" "bWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
580 "ve" "vu" "vi" "va" "vE" "v" "vo" "vWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
581 "te" "tu" "ti" "ta" "tE" "t" "to" "tWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
582 "ce" "cu" "ci" "ca" "cE" "c" "co" "cWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
583 "ne" "nu" "ni" "na" "nE" "n" "no" "nWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
584 "Ne" "Nu" "Ni" "Na" "NE" "N" "No" "NWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
585 "ze" "zu" "zi" "za" "zE" "z" "zo" "zWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
586 "Ze" "Zu" "Zi" "Za" "ZE" "Z" "Zo" "ZWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
587 "de" "du" "di" "da" "dE" "d" "do" "dWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
588 "Te" "Tu" "Ti" "Ta" "TE" "T" "To" "TWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
589 "Ce" "Cu" "Ci" "Ca" "CE" "C" "Co" "CWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
590 "fe" "fu" "fi" "fa" "fE" "f" "fo" "fWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
591 "se" "su" "si" "sa" "sE" "s" "so" "sWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
592 "Se" "Su" "Si" "Sa" "SE" "S" "So" "SWa"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
593 "a" "u" "i" "A" "E" "I" "o" "e3"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
594 "he" "hu" "hi" "ha" "hE" "h" "ho" "hWe" "hWu" "hWi" "hWa" "hWE"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
595 "ke" "ku" "ki" "ka" "kE" "k" "ko" "kWe" "kWu" "kWi" "kWa" "kWE"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
596 "Ke" "Ku" "Ki" "Ka" "KE" "K" "Ko" "KWe" "KWu" "KWi" "KWa" "KWE"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
597 "qe" "qu" "qi" "qa" "qE" "q" "qo" "qWe" "qWu" "qWi" "qWa" "qWE"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
598 "Qe" "Qu" "Qi" "Qa" "QE" "Q" "Qo" "QWe" "QWu" "QWi" "QWa" "QWE"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
599 "ge" "gu" "gi" "ga" "gE" "g" "go" "gWe" "gWu" "gWi" "gWa" "gWE"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
600 "we" "wu" "wi" "wa" "wE" "w" "wo" "wWe" "wWu" "wWi" "wWa" "wWE"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
601 "`se" "`su" "`si" "`sa" "`sE" "`s" "`so"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
602 "`Se" "`Su" "`Si" "`Sa" "`SE" "`S" "`So"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
603 "`e" "`u" "`i" "`a" "`E" "`I" "`o"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
604 "`he" "`hu" "`hi" "`ha" "`hE" "`h" "`ho"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
605 "`ke" "`ku" "`ki" "`ka" "`kE" "`k" "`ko"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
606 "Xe" "Xu" "Xi" "Xa" "XE" "X" "Xo"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
607 "He" "Hu" "Hi" "Ha" "HE" "H" "Ho"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
608 "ye" "yu" "yi" "ya" "yE" "y" "yo"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
609 "De" "Du" "Di" "Da" "DE" "D" "Do"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
610 "je" "ju" "ji" "ja" "jE" "j" "jo"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
611 "Ge" "Gu" "Gi" "Ga" "GE" "G" "Go"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
612 "Pe" "Pu" "Pi" "Pa" "PE" "P" "Po"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
613 "pe" "pu" "pi" "pa" "pE" "p" "po"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
614 " " "\\_" "." "," ";" ":" "\\*" "\\<" "\\>"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
615 "1" "2" "3" "4" "5" "6" "7" "8" "9"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
616 "10" "20" "30" "40" "50" "60" "70" "80" "90"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
617 "100" "10000"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
618 "\\~e" "\\~E" "\\~a" "\\~A"])
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
619
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
620 (defvar ethio-use-tigrigna-style nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
621 "*If non-NIL, use \"e\" instead of \"a\" for the first lone vowel
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
622 translation in sera-to-fidel and fidel-to-sera conversions.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
623
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
624 (defvar ethio-quote-vowel-always nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
625 "*If non-NIL, lone vowels are always transcribed by \"an apostrophe
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
626 + the vowel\" except at word initial. Otherwise, they are quoted by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
627 an apostrophe only if the preceding Ethiopic character is a lone
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
628 consonant.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
629
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
630 (defvar ethio-W-sixth-always nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
631 "*If non-NIL, the Wu-form of a 12-form consonant is transcribed by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
632 \"W'\" instead of \"Wu\".")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
633
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
634 (defvar ethio-numeric-reduction 0
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
635 "*Degree of reduction in transcribing Ethiopic digits by Arabic
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
636 digits. For example, $(2$`$_$i$g$](B ({10}{9}{100}{80}{7}) will be
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
637 transcribed by:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
638 \10\9\100\80\7 if ETHIO-NUMERIC-REDUCTION is 0,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
639 \109100807 is 1,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
640 \10900807 is 2.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
641
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
642 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
643 (defun fidel-to-sera-region (begin end &optional ascii-mode force)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
644 "Replaces all the FIDEL characters in the region to sera format.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
645
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
646 If the 1st optional parameter ASCII-MODE is non-NIL, converts the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
647 region so that it begins in ASCII script.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
648
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
649 If the 2nd optional parameter FORCE is non-NIL, converts even if the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
650 buffer is read-only."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
651
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
652 (interactive "r\nP")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
653 (save-excursion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
654 (save-restriction
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
655 (narrow-to-region begin end)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
656 (fidel-to-sera-buffer ascii-mode force))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
657
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
658 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
659 (defun fidel-to-sera-buffer (&optional ascii-mode force)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
660 "Replace all the FIDEL characters in the current buffer to sera format.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
661
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
662 If the 1st optional parameter ASCII-MODE is non-NIL,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
663 convert the current buffer so that it begins in ASCII script.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
664
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
665 If the 2nd optional parameter FORCE is non-NIL, converts even if the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
666 buffer is read-only.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
667
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
668 See also the description of the variables ethio-use-tigrigna-style,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
669 ethio-quote-vowel-on-demand and ethio-numeric-reduction."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
670
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
671 (interactive "P")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
672 (if (and buffer-read-only
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
673 (not force)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
674 (not (y-or-n-p "Buffer is read-only. Force to convert? ")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
675 (error ""))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
676
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
677 ;; user's preference in transcription
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
678 (aset fidel-to-sera-map 144 (if ethio-use-tigrigna-style "e" "a"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
679 (let ((i 160)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
680 (x (if ethio-W-sixth-always
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
681 '("hW'" "kW'" "KW'" "qW'" "QW'" "gW'" "wW'")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
682 '("hWu" "kWu" "KWu" "qWu" "QWu" "gWu" "wWu"))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
683 (while x
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
684 (aset fidel-to-sera-map i (car x))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
685 (setq i (+ i 12)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
686 x (cdr x))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
687
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
688 ;; main conversion routine
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
689 (let ((lonec nil) ; if lonec = t, previous char was a lone consonant.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
690 (fidel nil) ; if fidel = t, previous char was a fidel.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
691 (digit nil) ; if digit = t, previous char was an Ethiopic digit.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
692 (buffer-read-only nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
693 ch)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
694 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
695 (while (not (eobp))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
696 (setq ch (following-char))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
697
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
698 ;; ethiopic charactes
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
699 (if (= (char-charset ch) 'ethiopic)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
700 (progn
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
701 (setq ch (char-to-ethiocode ch))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
702 (delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
703
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
704 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
705
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
706 ;; fidels
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
707 ((<= ch 326)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
708 (if ascii-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
709 (insert "\\ "))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
710 (if (and (memq ch '(144 145 146 147 148 150 151)) ; (auiAEoe3)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
711 (or lonec
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
712 (and ethio-quote-vowel-always
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
713 fidel)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
714 (insert "'"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
715 (insert (aref fidel-to-sera-map ch))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
716 (setq ascii-mode nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
717 lonec (ethio-lone-consonant-p ch)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
718 fidel t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
719 digit nil))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
720
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
721 ;; punctuations and symbols
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
722 ((or (< ch 336) (> ch 355))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
723 (if (and ascii-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
724 (memq ch '(329 330 331 332))) ; (.,;:)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
725 (insert "\\"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
726 (insert (aref fidel-to-sera-map ch))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
727 (setq lonec nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
728 fidel nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
729 digit nil))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
730
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
731 ;; now CH must be an ethiopic digit
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
732
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
733 ;; reduction = 0 or leading digit
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
734 ((or (= ethio-numeric-reduction 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
735 (not digit))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
736 (insert "\\" (aref fidel-to-sera-map ch))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
737 (setq lonec nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
738 fidel nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
739 digit t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
740
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
741 ;; reduction = 2 and following 10s, 100s, 10000s
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
742 ((and (= ethio-numeric-reduction 2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
743 (memq ch '(345 354 355)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
744 (insert (substring (aref fidel-to-sera-map ch) 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
745 (setq lonec nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
746 fidel nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
747 digit t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
748
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
749 ;; ordinary following digits
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
750 (t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
751 (insert (aref fidel-to-sera-map ch))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
752 (setq lonec nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
753 fidel nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
754 digit t))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
755
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
756 ;; non-ethiopic characters
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
757 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
758
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
759 ;; backslash is always quoted
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
760 ((= ch ?\\ )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
761 (insert "\\"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
762
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
763 ;; nothing to do if in ascii-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
764 (ascii-mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
765
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
766 ;; ethio-mode -> ascii-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
767 ((or (and (>= ch ?a) (<= ch ?z))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
768 (and (>= ch ?A) (<= ch ?Z))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
769 (memq ch '(?| ?' ?`)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
770 (insert "\\ ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
771 (setq ascii-mode t))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
772
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
773 ;; ascii punctuations in ethio-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
774 ((memq ch '(?. ?, ?\; ?:))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
775 (insert "\\")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
776
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
777 (forward-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
778 (setq lonec nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
779 fidel nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
780 digit nil)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
781
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
782 ;; a few modifications for readability
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
783 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
784 (while (re-search-forward "\\([]!\"#$%&()*+/<=>?@[^_-]+\\)\\\\ " nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
785 (replace-match "\\\\ \\1"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
786
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
787 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
788 (while (re-search-forward "\n\\([ \t]*\\)\\\\ " nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
789 (replace-match "\\\\\n\\1")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
790
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
791 (goto-char (point-min)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
792
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
793 (defun ethio-lone-consonant-p (code)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
794 "If the ethiocode CODE is an Ethiopic lone consonant, return t."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
795 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
796 ((< code 144)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
797 (= (mod code 8) 5))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
798 ((< code 153)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
799 nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
800 ((< code 236)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
801 (= (mod code 12) 1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
802 ((< code 327)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
803 (= (mod code 7) 3))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
804
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
805 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
806 (defun fidel-to-sera-mail nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
807 "Does FIDEL to SERA conversion for reading/writing mail and news.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
808
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
809 If the buffer contains at least one Ethiopic character,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
810 1) inserts the string \"<sera>\" right after the header-body separator,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
811 2) inserts \"</sera>\" at the end of the buffer,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
812 3) converts the body into SERA in Ethiopic start mode, and
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
813 4) converts the subject field in ASCII start mode."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
814
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
815 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
816 (save-excursion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
817 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
818 (if (re-search-forward "\\cE" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
819 (let ((buffer-read-only nil) border)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
820
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
821 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
822 (setq border
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
823 (search-forward
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
824 (if (eq major-mode 'rmail-mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
825 "\n\n"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
826 (concat "\n" mail-header-separator "\n"))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
827 (insert "<sera>\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
828
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
829 (fidel-to-sera-region (point) (point-max))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
830
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
831 (goto-char (point-max))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
832 (if (/= (preceding-char) ?\n)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
833 (insert "\n"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
834 (insert "</sera>\n")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
835
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
836 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
837 (if (re-search-forward "^Subject: " border t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
838 (fidel-to-sera-region
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
839 (point)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
840 (progn (end-of-line) (point))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
841 'ascii-start))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
842
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
843 ;; adjust the rmail marker
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
844 (if (eq major-mode 'rmail-mode)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
845 (set-marker
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
846 (aref rmail-message-vector (1+ rmail-current-message))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
847 (point-max))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
848
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
849 (message "No Ethiopic characters in this buffer."))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
850
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
851 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
852 (defun fidel-to-sera-marker nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
853 "If the buffer contains the markers \"<sera>\" and \"</sera>\",
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
854 converts the segment between the two markers from Fidel to SERA
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
855 in Ethio start mode. The markers will not be removed."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
856
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
857 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
858 (if (and buffer-read-only
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
859 (not (y-or-n-p "Buffer is read-only. Force to convert? ")))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
860 (error ""))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
861 (save-excursion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
862 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
863 (while (re-search-forward "^<sera>\n" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
864 (fidel-to-sera-region
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
865 (point)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
866 (if (re-search-forward "^</sera>\n" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
867 (match-beginning 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
868 (point-max))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
869 nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
870 'force))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
871
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
872 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
873 ;; file I/O hooks
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
874 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
875
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
876 (if (not (assoc "\\.sera$" auto-mode-alist))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
877 (setq auto-mode-alist
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
878 (cons '("\\.sera$" . sera-to-fidel-find-file) auto-mode-alist)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
879 (add-hook 'write-file-hooks 'fidel-to-sera-write-file)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
880 (add-hook 'after-save-hook 'sera-to-fidel-after-save)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
881
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
882 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
883 (defun sera-to-fidel-find-file nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
884 "Intended to be called when a file whose name ends in \".sera\" is read in."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
885 (sera-to-fidel-buffer nil 'force)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
886 (set-buffer-modified-p nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
887 nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
888
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
889 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
890 (defun fidel-to-sera-write-file nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
891 "Intended to be used as write-file-hooks for the files
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
892 whose name ends in \".sera\"."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
893 (if (string-match "\\.sera$" (buffer-file-name))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
894 (save-excursion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
895 (fidel-to-sera-buffer nil 'force)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
896 (set-buffer-modified-p nil)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
897 nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
898
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
899 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
900 (defun sera-to-fidel-after-save nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
901 "Intended to be used as after-save-hook for the files
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
902 whose name ends in \".sera\"."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
903 (if (string-match "\\.sera$" (buffer-file-name))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
904 (save-excursion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
905 (sera-to-fidel-buffer nil 'force)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
906 (set-buffer-modified-p nil)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
907 nil)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
908
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
909 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
910 ;; vowel modification
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
911 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
912
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
913 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
914 (defun ethio-modify-vowel nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
915 "Modify the vowel of the FIDEL that is under the cursor."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
916 (interactive)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
917 (let ((ch (following-char)) newch base vowel)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
918 (if (= (char-charset ch) 'ethiopic)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
919 (setq ch (char-to-ethiocode ch))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
920 (error "Not a valid character."))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
921 (if (or (and (>= ch 144) (<= ch 151)) ; lone vowels
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
922 (and (>= ch 250) (<= ch 256)) ; secondary lone vowels
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
923 (>= ch 327)) ; not FIDEL
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
924 (error "Not a valid character."))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
925 (message "Modify vowel to: ")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
926 (if (null (setq vowel (memq (read-char) '(?e ?u ?i ?a ?E ?' ?o))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
927 (error "Not a valid vowel.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
928 ;; ?e -> 0, ?u -> 1, ?i -> 2, ?a -> 3, ?E -> 4, ?' -> 5, ?o -> 6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
929 (setq vowel (- 7 (length vowel))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
930
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
931 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
932
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
933 ;; 8-form consonant
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
934 ((<= ch 143)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
935 (setq base (* (/ ch 8) 8))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
936 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
937 ((< (mod ch 8) 7) ; e-form <= ch <= o-form
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
938 (setq newch (+ base vowel)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
939 ((= vowel 3) ; 3 = a
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
940 (setq newch (+ base 7))) ; (+ base 7) = Wa-form
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
941 ((= vowel 5) ; 5 = '
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
942 (setq newch
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
943 (cons (+ base 5) ; (+ base 5) = lone consonant
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
944 232))) ; 232 = Wu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
945 (t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
946 (setq newch
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
947 (cons (+ base 5) ; (+ base 5) = lone consonant
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
948 (+ 231 vowel)))))) ; 231 = We
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
949
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
950 ;; 12-form consonant
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
951 ((<= ch 235)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
952 (setq ch (- ch 152) ; 152 = 12-form consonant offset
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
953 base (* (/ ch 12) 12))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
954 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
955 ((< (mod ch 12) 7) ; e-form <= ch <= o-form
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
956 (setq newch (+ base vowel 152)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
957 ((< vowel 5) ; We-form <= ch <= WE-form
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
958 (setq newch (+ base vowel 159))) ; 159 = 152 (offset) + 7 (We-form)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
959 ((= vowel 5) ; 5 = ' (= u in this case)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
960 (setq newch (+ base 160))) ; 160 = 152 (offset) + 8 (Wu-form)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
961 (t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
962 (error "Not a valid vowel."))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
963
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
964 ;; 7-form consonant
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
965 (t ; 236 = 7-form consonant offset
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
966 (setq newch (+ (* (/ (- ch 236) 7) 7) vowel 236))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
967
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
968 (delete-char 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
969
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
970 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
971 ((consp newch)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
972 (insert (ethiocode-to-char (car newch))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
973 (ethiocode-to-char (cdr newch)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
974 (backward-char 2))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
975 (t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
976 (insert (ethiocode-to-char newch))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
977 (backward-char 1)))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
978
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
979 (defun ethiocode-to-char (code)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
980 (make-char 'ethiopic (+ (/ code 94) 33) (+ (mod code 94) 33)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
981
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
982 (defun char-to-ethiocode (ch)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
983 (and (eq (char-charset ch) 'ethiopic)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
984 (+ (* (- (char-octet ch 0) 33) 94)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
985 (- (char-octet ch 1) 33))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
986
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
987 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
988 ;; space replacement
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
989 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
990
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
991 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
992 (defun ethio-replace-space (ch begin end)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
993 "In the specified region, replace spaces between two Ethiopic characters."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
994 (interactive "*cReplace spaces to: 1 (sg col), 2 (dbl col), 3 (Ethiopic)\nr")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
995 (if (not (memq ch '(?1 ?2 ?3)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
996 (error ""))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
997 (save-excursion
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
998 (save-restriction
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
999 (narrow-to-region begin end)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1000 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1001
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1002 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1003
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1004 ((= ch ?1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1005
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1006 ;; A double column space or an Ethiopic word separator is always
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1007 ;; converted to an ASCII space.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1008 (while (re-search-forward "[$(2$N$O(B]" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1009 (replace-match " " nil nil)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1010
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1011 ((= ch ?2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1012
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1013 ;; An Ethiopic word separator is always converted to
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1014 ;; a double column space.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1015 (while (search-forward "$(2$O(B" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1016 (replace-match "$(2$N(B"))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1017
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1018 (goto-char (point-min))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1019
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1020 ;; ASCII spaces are converted only if they are placed
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1021 ;; between two Ethiopic characters.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1022 (while (re-search-forward "\\(\\cE\\)\\( \\)\\( *\\cE\\)" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1023
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1024 ;; Converting the first ASCII space
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1025 (replace-match "\\1$(2$N(B\\3")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1026
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1027 ;; A double column space is \cE, so going back to the just
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1028 ;; converted double column space makes it possible to find
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1029 ;; the following ASCII spaces.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1030 (goto-char (match-beginning 2))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1031
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1032 ((= ch ?3)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1033
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1034 ;; If more than one consecutive space (either ASCII or double
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1035 ;; width) is found between two Ethiopic characters, the first
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1036 ;; space will be converted to an Ethiopic word separator.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1037 (let (pred succ)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1038 (while (re-search-forward "[ $(2$N(B]\\([ $(2$N(B]*\\)" nil t)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1039 (and (setq pred (char-before (match-beginning 0)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1040 (= (char-charset pred) 'ethiopic)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1041 (setq succ (char-after (match-end 0)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1042 (= (char-charset succ) 'ethiopic)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1043 (replace-match "$(2$O(B\\1" nil nil)))))))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1044
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1045 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1046 ;; special characters
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1047 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1048
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1049 ;;;###autoload
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1050 (defun ethio-input-special-character (arg)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1051 "Allow the user to input special characters."
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1052 (interactive "*cInput number: 1.$(2$k(B 2.$(2$l(B 3.$(2$m(B 4.$(2$n(B")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1053 (cond
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1054 ((= arg ?1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1055 (insert ?$(2$k(B))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1056 ((= arg ?2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1057 (insert ?$(2$l(B))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1058 ((= arg ?3)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1059 (insert ?$(2$m(B))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1060 ((= arg ?4)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1061 (insert ?$(2$n(B))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1062 (t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1063 (error ""))))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1064
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1065 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1066 ;; key bindings
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1067 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1068
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1069 (define-key global-map [f4] 'sera-to-fidel-buffer)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1070 (define-key global-map [(shift f4)] 'sera-to-fidel-region)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1071 (define-key global-map [(control f4)] 'sera-to-fidel-marker)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1072 (define-key global-map [f5] 'fidel-to-sera-buffer)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1073 (define-key global-map [(shift f5)] 'fidel-to-sera-region)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1074 (define-key global-map [(control f5)] 'fidel-to-sera-marker)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1075 (define-key global-map [f6] 'ethio-modify-vowel)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1076 (define-key global-map [f7] 'ethio-replace-space)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1077 (define-key global-map [(shift f2)] 'ethio-replace-space) ; as requested
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1078 (define-key global-map [f8] 'ethio-input-special-character)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1079
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1080 (add-hook
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1081 'rmail-mode-hook
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1082 '(lambda nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1083 (define-key rmail-mode-map [(control f4)] 'sera-to-fidel-mail)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1084 (define-key rmail-mode-map [(control f5)] 'fidel-to-sera-mail)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1085
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1086 (add-hook
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1087 'mail-mode-hook
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1088 '(lambda nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1089 (define-key mail-mode-map [(control f4)] 'sera-to-fidel-mail)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1090 (define-key mail-mode-map [(control f5)] 'fidel-to-sera-mail)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1091
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1092 ;;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1093 (provide 'ethio)