annotate lisp/language/ethio-util.el @ 45119:bb7bdd25e045

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