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