[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/language/ethio-util.el,v
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/language/ethio-util.el,v |
Date: |
Fri, 01 Feb 2008 16:02:28 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Miles Bader <miles> 08/02/01 16:01:31
Index: lisp/language/ethio-util.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/language/ethio-util.el,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- lisp/language/ethio-util.el 8 Jan 2008 20:45:57 -0000 1.47
+++ lisp/language/ethio-util.el 1 Feb 2008 16:01:02 -0000 1.48
@@ -1,4 +1,4 @@
-;;; ethio-util.el --- utilities for Ethiopic -*- coding: iso-2022-7bit; -*-
+;;; ethio-util.el --- utilities for Ethiopic -*- coding: utf-8; -*-
;; Copyright (C) 1997, 1998, 2002, 2003, 2004, 2005, 2006, 2007, 2008
;; Free Software Foundation, Inc.
@@ -6,6 +6,9 @@
;; 2006, 2007, 2008
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H14PRO021
+;; Copyright (C) 2005, 2006
+;; National Institute of Advanced Industrial Science and Technology (AIST)
+;; Registration Number: H15PRO110
;; Keywords: mule, multilingual, Ethiopic
@@ -32,6 +35,8 @@
;;; Code:
+(require 'robin)
+
(defvar rmail-current-message)
(defvar rmail-message-vector)
@@ -42,36 +47,17 @@
(defun setup-ethiopic-environment-internal ()
(let ((key-bindings '((" " . ethio-insert-space)
([?\S- ] . ethio-insert-ethio-space)
- ([?\C-'] . ethio-gemination)
-
- ;; these old bindings conflict
- ;; with Emacs' binding policy
-
- ;; ([f2] . ethio-toggle-space)
- ;; ([S-f2] . ethio-replace-space) ; as requested
- ;; ([f3] . ethio-toggle-punctuation)
- ;; ([f4] . ethio-sera-to-fidel-buffer)
- ;; ([S-f4] . ethio-sera-to-fidel-region)
- ;; ([C-f4] . ethio-sera-to-fidel-mail-or-marker)
- ;; ([f5] . ethio-fidel-to-sera-buffer)
- ;; ([S-f5] . ethio-fidel-to-sera-region)
- ;; ([C-f5] . ethio-fidel-to-sera-mail-or-marker)
- ;; ([f6] . ethio-modify-vowel)
- ;; ([f7] . ethio-replace-space)
- ;; ([f8] . ethio-input-special-character)
-
- ;; this is the rewritten bindings
-
+ ;; ([?\C-'] . ethio-gemination)
([f3] . ethio-fidel-to-sera-buffer)
([S-f3] . ethio-fidel-to-sera-region)
- ([C-f3] . ethio-fidel-to-sera-mail-or-marker)
+ ([C-f3] . ethio-fidel-to-sera-marker)
([f4] . ethio-sera-to-fidel-buffer)
([S-f4] . ethio-sera-to-fidel-region)
- ([C-f4] . ethio-sera-to-fidel-mail-or-marker)
+ ([C-f4] . ethio-sera-to-fidel-marker)
([S-f5] . ethio-toggle-punctuation)
([S-f6] . ethio-modify-vowel)
([S-f7] . ethio-replace-space)
- ([S-f8] . ethio-input-special-character)
+ ;; ([S-f8] . ethio-input-special-character) ; deprecated
([C-f9] . ethio-toggle-space)
([S-f9] . ethio-replace-space) ; as requested
))
@@ -84,7 +70,6 @@
(global-set-key kb (cdr (car key-bindings)))
(setq key-bindings (cdr key-bindings))))
- (add-hook 'quail-activate-hook 'ethio-select-a-translation)
(add-hook 'find-file-hook 'ethio-find-file)
(add-hook 'write-file-functions 'ethio-write-file)
(add-hook 'after-save-hook 'ethio-find-file))
@@ -97,7 +82,6 @@
(setq exit-ethiopic-environment-data
(cdr exit-ethiopic-environment-data)))
- (remove-hook 'quail-activate-hook 'ethio-select-a-translation)
(remove-hook 'find-file-hook 'ethio-find-file)
(remove-hook 'write-file-functions 'ethio-write-file)
(remove-hook 'after-save-hook 'ethio-find-file))
@@ -115,15 +99,6 @@
;;
;; If the filename ends in ".tex", editing is done in fidel
;; but file I/O is done in EthioTeX format.
-;;
-;; To automatically convert Ethiopic text to SERA format when sending mail,
-;; (add-hook 'mail-send-hook 'ethio-fidel-to-sera-mail)
-;;
-;; To automatically convert SERA format to Ethiopic when receiving mail,
-;; (add-hook 'rmail-show-message-hook 'ethio-sera-to-fidel-mail)
-;;
-;; To automatically convert Ethiopic text to SERA format when posting news,
-;; (add-hook 'news-inews-hook 'ethio-fidel-to-sera-mail)
;;
;; users' preference
@@ -150,7 +125,7 @@
(defvar ethio-quote-vowel-always nil
"*Non-nil means always put an apostrophe before an isolated vowel (except at
word initial) in FIDEL --> SERA conversion.
-If nil, put an apostrophe only between a sixth-form consonant and an
+If nil, put an apostrophe only between a 6th-form consonant and an
isolated vowel.")
(defvar ethio-W-sixth-always nil
@@ -164,313 +139,98 @@
`109100807 if `ethio-numeric-reduction' is 1,
`10900807 if `ethio-numeric-reduction' is 2.")
-(defvar ethio-implicit-period-conversion t
- "*Non-nil means replacing the Ethiopic dot at the end of an Ethiopic sentence
-with an Ethiopic full stop.")
-
(defvar ethio-java-save-lowercase nil
"*Non-nil means save Ethiopic characters in lowercase hex numbers to Java
files.
If nil, use uppercases.")
+(defun ethio-prefer-amharic-p ()
+ (or (eq ethio-primary-language 'amharic)
+ (and (not (eq ethio-primary-language 'tigrigna))
+ (eq ethio-secondary-language 'amharic))))
+
+(defun ethio-prefer-amharic (arg)
+ (if arg
+ (progn
+ (robin-modify-package "ethiopic-sera" "'a" ?á )
+ (robin-modify-package "ethiopic-sera" "a" "á ")
+ (robin-modify-package "ethiopic-sera" "'A" ?á£)
+ (robin-modify-package "ethiopic-sera" "A" "á£"))
+ (robin-modify-package "ethiopic-sera" "'A" ?á )
+ (robin-modify-package "ethiopic-sera" "A" "á ")
+ (robin-modify-package "ethiopic-sera" "'a" ?á£)
+ (robin-modify-package "ethiopic-sera" "a" "á£")))
+
+(defun ethio-use-colon-for-colon (arg)
+ (if arg
+ (progn
+ (robin-modify-package "ethiopic-sera" ":" ?á¥)
+ (robin-modify-package "ethiopic-sera" "`:" ?á¡))
+ (robin-modify-package "ethiopic-sera" " : " ?á¡)
+ (robin-modify-package "ethiopic-sera" ":" "á¡")
+ (robin-modify-package "ethiopic-sera" "-:" ?á¥)))
+
+(defun ethio-use-three-dot-question (arg)
+ (if arg
+ (progn
+ (robin-modify-package "ethiopic-sera" "?" ?á§)
+ (robin-modify-package "ethiopic-sera" "`?" ??))
+ (robin-modify-package "ethiopic-sera" "?" ??)
+ (robin-modify-package "ethiopic-sera" "`?" ?á§)))
+
+(defun ethio-adjust-robin ()
+ (ethio-prefer-amharic (ethio-prefer-amharic-p))
+ (ethio-use-colon-for-colon ethio-use-colon-for-colon)
+ (ethio-use-three-dot-question ethio-use-three-dot-question))
+
+(add-hook 'robin-activate-hook 'ethio-adjust-robin)
+
;;
;; SERA to FIDEL
;;
-(defconst ethio-sera-to-fidel-table
- [
- nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
- nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
-;;; SP
- (" "
- (?: (if ethio-use-colon-for-colon " $(3$l(B" "$(3$h(B")
- (32 (if ethio-use-colon-for-colon " $(3$l(B " "$(3$h(B"))
- (?- " $(3$m(B")
- (?: " $(3$i(B")
- (?| (if ethio-use-colon-for-colon " $(3$l(B|" " $(3$h(B|")
- (?: " $(3$o(B"))))
-
-;;; ! " # $ % & '
- nil nil nil nil nil nil ("" (?' "$(3%s(B"))
-;;; ( ) * + , - .
- nil nil nil nil ("$(3$j(B") ("-" (?: "$(3$l(B")) ("$(3%u(B")
-;;; / 0 1 2 3 4 5 6 7 8 9
- nil nil nil nil nil nil nil nil nil nil nil
-;;; :
- ((if ethio-use-colon-for-colon "$(3$l(B" "$(3$h(B")
- (32 (if ethio-use-colon-for-colon "$(3$l(B " "$(3$h(B"))
- (?- "$(3$m(B")
- (?: "$(3$i(B")
- (?| (if ethio-use-colon-for-colon "$(3$l(B|" "$(3$h(B|")
- (?: "$(3$o(B")))
-;;; ; < = >
- ("$(3$k(B") ("<" (?< "$(3%v(B")) nil (">" (?> "$(3%w(B"))
-;;; ?
- ((if ethio-use-three-dot-question "$(3$n(B" "$(3%x(B"))
-;;; @
- nil
-;;; A
- ("$(3"f(B" (?2 "$(3#8(B"))
-;;; B
- ("$(3"((B" (?e "$(3"#(B") (?u "$(3"$(B") (?i "$(3"%(B") (?a
"$(3"&(B") (?E "$(3"'(B") (?o "$(3")(B")
- (?W "$(3%b(B" (?e "$(3%2(B") (?u "$(3%b(B") (?i "$(3%B(B")
(?a "$(3"*(B") (?E "$(3%R(B")))
-;;; C
- ("$(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")
- (?W "$(3$6(B" (?a "$(3$6(B")
- (?e "$(3$4%n(B") (?u "$(3$4%r(B") (?i "$(3$4%o(B") (?E
"$(3$4%q(B")))
-;;; D
- ("$(3#b(B" (?e "$(3#](B") (?u "$(3#^(B") (?i "$(3#_(B") (?a
"$(3#`(B") (?E "$(3#a(B") (?o "$(3#c(B")
- (?W "$(3#d(B" (?a "$(3#d(B")
- (?e "$(3#b%n(B") (?u "$(3#b%r(B") (?i "$(3#b%o(B") (?E
"$(3#b%q(B")))
-;;; E
- ("$(3"g(B" (?2 "$(3#9(B"))
-;;; F
- ("$(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")
- (?W "$(3%d(B" (?e "$(3%4(B") (?u "$(3%d(B") (?i "$(3%D(B")
(?a "$(3$V(B") (?E "$(3%T(B"))
- (?Y "$(3$a(B" (?a "$(3$a(B")))
-;;; G
- ("$(3$$(B" (?e "$(3#}(B") (?u "$(3#~(B") (?i "$(3$!(B") (?a
"$(3$"(B") (?E "$(3$#(B") (?o "$(3$%(B")
- (?W "$(3%c(B" (?e "$(3%3(B") (?u "$(3%c(B") (?i "$(3%C(B")
(?a "$(3$&(B") (?E "$(3%S(B")))
-;;; H
- ("$(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")
- (?W "$(3!8(B" (?a "$(3!8(B")
- (?e "$(3!6%n(B") (?u "$(3!6%r(B") (?i "$(3!6%o(B") (?E
"$(3!6%q(B")))
-;;; I
- ("$(3"h(B" (?2 "$(3#:(B"))
-;;; J
- ("$(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")
- (?W "$(3#l(B" (?a "$(3#l(B")
- (?e "$(3#j%n(B") (?u "$(3#j%r(B") (?i "$(3#j%o(B") (?E
"$(3#j%q(B")))
-;;; K
- ("$(3#"(B" (?e "$(3"{(B") (?u "$(3"|(B") (?i "$(3"}(B") (?a
"$(3"~(B") (?E "$(3#!(B") (?o "$(3##(B")
- (?W "$(3#*(B" (?e "$(3#%(B") (?u "$(3#*(B") (?i "$(3#'(B")
(?a "$(3#((B") (?E "$(3#)(B")))
-;;; L
- ("$(3!.(B" (?e "$(3!)(B") (?u "$(3!*(B") (?i "$(3!+(B") (?a
"$(3!,(B") (?E "$(3!-(B") (?o "$(3!/(B")
- (?W "$(3!0(B" (?a "$(3!0(B")
- (?e "$(3!.%n(B") (?u "$(3!.%r(B") (?i "$(3!.%o(B") (?E
"$(3!.%q(B")))
-;;; M
- ("$(3!>(B" (?e "$(3!9(B") (?u "$(3!:(B") (?i "$(3!;(B") (?a
"$(3!<(B") (?E "$(3!=(B") (?o "$(3!?(B")
- (?W "$(3%a(B" (?e "$(3%1(B") (?u "$(3%a(B") (?i "$(3%A(B")
(?a "$(address@hidden(B") (?E "$(3%Q(B"))
- (?Y "$(3$_(B" (?a "$(3$_(B")))
-;;; N
- ("$(3"`(B" (?e "$(3"[(B") (?u "$(3"\(B") (?i "$(3"](B") (?a
"$(3"^(B") (?E "$(3"_(B") (?o "$(3"a(B")
- (?W "$(3"b(B" (?a "$(3"b(B")
- (?e "$(3"`%n(B") (?u "$(3"`%r(B") (?i "$(3"`%o(B") (?E
"$(3"`%q(B")))
-;;; O
- ("$(3"i(B" (?2 "$(3#;(B"))
-;;; P
- ("$(3$<(B" (?e "$(3$7(B") (?u "$(3$8(B") (?i "$(3$9(B") (?a
"$(3$:(B") (?E "$(3$;(B") (?o "$(3$=(B")
- (?W "$(3$>(B" (?a "$(3$>(B")
- (?e "$(3$<%n(B") (?u "$(3$<%r(B") (?i "$(3$<%o(B") (?E
"$(3$<%q(B")))
-;;; Q
- ("$(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")
- (?W "$(3!~(B" (?e "$(3!y(B") (?u "$(3!~(B") (?i "$(3!{(B")
(?a "$(3!|(B") (?E "$(3!}(B")))
-;;; R
- ("$(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")
- (?W "$(3!P(B" (?a "$(3!P(B")
- (?e "$(3!N%n(B") (?u "$(3!N%r(B") (?i "$(3!N%o(B") (?E
"$(3!N%q(B"))
- (?Y "$(3$`(B" (?a "$(3$`(B")))
-;;; S
- ("$(3$D(B" (?e "$(3$?(B") (?u "$(address@hidden(B") (?i "$(3$A(B")
(?a "$(3$B(B") (?E "$(3$C(B") (?o "$(3$E(B")
- (?W "$(3$F(B" (?a "$(3$F(B")
- (?e "$(3$D%n(B") (?u "$(3$D%r(B") (?i "$(3$D%o(B") (?E
"$(3$D%q(B"))
- (?2 "$(3$L(B"
- (?e "$(3$G(B") (?u "$(3$H(B") (?i "$(3$I(B") (?a
"$(3$J(B") (?E "$(3$K(B") (?o "$(3$M(B")
- (?W "$(3$F(B" (?a "$(3$F(B")
- (?e "$(3$L%n(B") (?u "$(3$L%r(B") (?i "$(3$L%o(B") (?E
"$(3$L%q(B"))))
-;;; T
- ("$(3$,(B" (?e "$(3$'(B") (?u "$(3$((B") (?i "$(3$)(B") (?a
"$(3$*(B") (?E "$(3$+(B") (?o "$(3$-(B")
- (?W "$(3$.(B" (?a "$(3$.(B")
- (?e "$(3$,%n(B") (?u "$(3$,%r(B") (?i "$(3$,%o(B") (?E
"$(3$,%q(B")))
-;;; U
- ("$(3"d(B" (?2 "$(3#6(B"))
-;;; V
- ("$(3"0(B" (?e "$(3"+(B") (?u "$(3",(B") (?i "$(3"-(B") (?a
"$(3".(B") (?E "$(3"/(B") (?o "$(3"1(B")
- (?W "$(3"2(B" (?a "$(3"2(B")
- (?e "$(3"0%n(B") (?u "$(3"0%r(B") (?i "$(3"0%o(B") (?E
"$(3"0%q(B")))
-;;; W
- ("$(3%r(B" (?e "$(3%n(B") (?u "$(3%r(B") (?i "$(3%o(B") (?a
"$(3%p(B") (?E "$(3%q(B"))
-;;; X
- ("$(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"))
-;;; Y
- ("$(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")
- (?W "$(3#T(B" (?a "$(3#T(B")
- (?e "$(3#R%n(B") (?u "$(3#R%r(B") (?i "$(3#R%o(B") (?E
"$(3#R%q(B")))
-;;; Z
- ("$(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")
- (?W "$(3#L(B" (?a "$(3#L(B")
- (?e "$(3#J%n(B") (?u "$(3#J%r(B") (?i "$(3#J%o(B") (?E
"$(3#J%q(B")))
-;;; [ \ ] ^ _
- nil nil nil nil nil
-;;; `
- (""
- (?: "$(3$h(B")
- (?? (if ethio-use-three-dot-question "$(3%x(B" "$(3$n(B"))
- (?! "$(3%t(B")
- (?e "$(3#5(B") (?u "$(3#6(B") (?U "$(3#6(B") (?i "$(3#7(B") (?a
"$(3#8(B") (?A "$(3#8(B")
- (?E "$(3#9(B") (?I "$(3#:(B") (?o "$(3#;(B") (?O "$(3#;(B")
- (?g "$(3%^(B"
- (?e "$(3%Y(B") (?u "$(3%Z(B") (?i "$(3%[(B") (?a "$(3%\(B")
(?E "$(3%](B") (?o "$(3%_(B"))
- (?h "$(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")
- (?W "$(3"P(B" (?e "$(3"K(B") (?u "$(3"P(B") (?i
"$(3"M(B") (?a "$(3"N(B") (?E "$(3"O(B")))
- (?k "$(3%>(B"
- (?e "$(3%9(B") (?u "$(3%:(B") (?i "$(3%;(B") (?a "$(3%<(B")
(?E "$(3%=(B") (?o "$(3%?(B"))
- (?s "$(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")
- (?W "$(3!H(B" (?a "$(3!H(B")
- (?e "$(3!F%n(B") (?u "$(3!F%r(B") (?i "$(3!F%o(B") (?E
"$(3!F%q(B")))
- (?S "$(3$L(B"
- (?e "$(3$G(B") (?u "$(3$H(B") (?i "$(3$I(B") (?a "$(3$J(B") (?E
"$(3$K(B") (?o "$(3$M(B")
- (?W "$(3$F(B" (?a "$(3$F(B")
- (?e "$(3$L%n(B") (?u "$(3$L%r(B") (?i "$(3$L%o(B") (?E
"$(3$L%q(B")))
- (?q "$(3%.(B" (?e "$(3%)(B") (?u "$(3%*(B") (?i "$(3%+(B") (?a
"$(3%,(B") (?E "$(3%-(B") (?o "$(3%/(B")))
-;;; a
- ("$(3"f(B" (?2 "$(3#8(B"))
-;;; b
- ("$(3"((B" (?e "$(3"#(B") (?u "$(3"$(B") (?i "$(3"%(B") (?a
"$(3"&(B") (?E "$(3"'(B") (?o "$(3")(B")
- (?W "$(3%b(B" (?e "$(3%2(B") (?u "$(3%b(B") (?i "$(3%B(B")
(?a "$(3"*(B") (?E "$(3%R(B")))
-;;; c
- ("$(3"@(B" (?e "$(3";(B") (?u "$(3"<(B") (?i "$(3"=(B") (?a
"$(3">(B") (?E "$(3"?(B") (?o "$(3"A(B")
- (?W "$(3"B(B" (?a "$(3"B(B")
- (?e "$(3"@%n(B") (?u "$(3"@%r(B") (?i "$(3"@%o(B") (?E
"$(3"@%q(B")))
-;;; d
- ("$(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")
- (?W "$(3#\(B" (?a "$(3#\(B")
- (?e "$(3#Z%o(B") (?u "$(3#Z%r(B") (?i "$(3#Z%p(B") (?E
"$(3#Z%q(B")))
-;;; e
- ("$(3"c(B" (?2 "$(3#5(B") (?a "$(3"j(B"))
-;;; f
- ("$(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")
- (?W "$(3%d(B" (?e "$(3%4(B") (?u "$(3%d(B") (?i "$(3%D(B")
(?a "$(3$V(B") (?E "$(3%T(B"))
- (?Y "$(3$a(B" (?a "$(3$a(B")))
-;;; g
- ("$(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")
- (?W "$(3#z(B" (?e "$(3#u(B") (?u "$(3#z(B") (?i "$(3#w(B")
(?a "$(3#x(B") (?E "$(3#y(B"))
- (?2 "$(3%^(B" (?e "$(3%Y(B") (?u "$(3%Z(B") (?i "$(3%[(B")
(?a "$(3%\(B") (?E "$(3%](B") (?o "$(3%_(B")))
-;;; h
- ("$(3!&(B" (?e "$(3!!(B") (?u "$(3!"(B") (?i "$(3!#(B") (?a
"$(3!$(B") (?E "$(3!%(B") (?o "$(3!'(B")
- (?W "$(3"P(B" (?e "$(3"K(B") (?u "$(3"P(B") (?i "$(3"M(B")
(?a "$(3"N(B") (?E "$(3"O(B"))
- (?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")
- (?W "$(3"P(B" (?e "$(3"K(B") (?u "$(3"P(B") (?i
"$(3"M(B") (?a "$(3"N(B") (?E "$(3"O(B"))))
-;;; i
- ("$(3"e(B" (?2 "$(3#7(B"))
-;;; j
- ("$(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")
- (?W "$(3#l(B" (?a "$(3#l(B")
- (?e "$(3#j%n(B") (?u "$(3#j%r(B") (?i "$(3#j%o(B") (?E
"$(3#j%q(B")))
-;;; k
- ("$(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")
- (?W "$(3"x(B" (?e "$(3"s(B") (?u "$(3"x(B") (?i "$(3"u(B")
(?a "$(3"v(B") (?E "$(3"w(B"))
- (?2 "$(3%>(B" (?e "$(3%9(B") (?u "$(3%:(B") (?i "$(3%;(B") (?a
"$(3%<(B") (?E "$(3%=(B") (?o "$(3%?(B")))
-;;; l
- ("$(3!.(B" (?e "$(3!)(B") (?u "$(3!*(B") (?i "$(3!+(B") (?a
"$(3!,(B") (?E "$(3!-(B") (?o "$(3!/(B")
- (?W "$(3!0(B" (?a "$(3!0(B")
- (?e "$(3!.%n(B") (?u "$(3!.%r(B") (?i "$(3!.%o(B") (?E
"$(3!.%q(B")))
-;;; m
- ("$(3!>(B" (?e "$(3!9(B") (?u "$(3!:(B") (?i "$(3!;(B") (?a
"$(3!<(B") (?E "$(3!=(B") (?o "$(3!?(B")
- (?W "$(3%a(B" (?e "$(3%1(B") (?u "$(3%a(B") (?i "$(3%A(B")
(?a "$(address@hidden(B") (?E "$(3%Q(B"))
- (?Y "$(3$_(B" (?a "$(3$_(B")))
-;;; n
- ("$(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")
- (?W "$(3"Z(B" (?a "$(3"Z(B")
- (?e "$(3"X%n(B") (?u "$(3"X%r(B") (?i "$(3"X%o(B") (?E
"$(3"X%q(B")))
-;;; o
- ("$(3"i(B" (?2 "$(3#;(B"))
-;;; p
- ("$(3$\(B" (?e "$(3$W(B") (?u "$(3$X(B") (?i "$(3$Y(B") (?a
"$(3$Z(B") (?E "$(3$[(B") (?o "$(3$](B")
- (?W "$(3%e(B" (?e "$(3%5(B") (?u "$(3%e(B") (?i "$(3%E(B")
(?a "$(3$^(B") (?E "$(3%U(B")))
-;;; q
- ("$(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")
- (?W "$(3!n(B" (?e "$(3!i(B") (?u "$(3!n(B") (?i "$(3!k(B")
(?a "$(3!l(B") (?E "$(3!m(B"))
- (?2 "$(3%.(B" (?e "$(3%)(B") (?u "$(3%*(B") (?i "$(3%+(B")
(?a "$(3%,(B") (?E "$(3%-(B") (?o "$(3%/(B")))
-;;; r
- ("$(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")
- (?W "$(3!P(B" (?a "$(3!P(B")
- (?e "$(3!N%n(B") (?u "$(3!N%r(B") (?i "$(3!N%o(B") (?E
"$(3!N%q(B"))
- (?Y "$(3$`(B" (?a "$(3$`(B")))
-;;; s
- ("$(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")
- (?W "$(3!X(B" (?a "$(3!X(B")
- (?e "$(3!V%n(B") (?u "$(3!V%r(B") (?i "$(3!V%o(B") (?E
"$(3!V%q(B"))
- (?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")
- (?W "$(3!H(B" (?a "$(3!H(B")
- (?e "$(3!F%n(B") (?u "$(3!F%r(B") (?i
"$(3!F%o(B") (?E "$(3!F%q(B"))))
-;;; t
- ("$(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")
- (?W "$(3":(B" (?a "$(3":(B")
- (?e "$(3"8%n(B") (?u "$(3"8%r(B") (?i "$(3"8%o(B") (?E
"$(3"8%q(B")))
-;;; u
- ("$(3"d(B" (?2 "$(3#6(B"))
-;;; v
- ("$(3"0(B" (?e "$(3"+(B") (?u "$(3",(B") (?i "$(3"-(B") (?a
"$(3".(B") (?E "$(3"/(B") (?o "$(3"1(B")
- (?W "$(3"2(B" (?a "$(3"2(B")
- (?e "$(3"0%n(B") (?u "$(3"0%r(B") (?i "$(3"0%o(B") (?E
"$(3"0%q(B")))
-;;; w
- ("$(3#2(B" (?e "$(3#-(B") (?u "$(3#.(B") (?i "$(3#/(B") (?a
"$(3#0(B") (?E "$(3#1(B") (?o "$(3#3(B")
- (?W "$(3%p(B" (?e "$(3%n(B") (?u "$(3%r(B") (?i "$(3%o(B")
(?a "$(3%p(B") (?E "$(3%q(B")))
-;;; x
- ("$(3!^(B" (?e "$(3!Y(B") (?u "$(3!Z(B") (?i "$(3![(B") (?a
"$(3!\(B") (?E "$(3!](B") (?o "$(3!_(B")
- (?W "$(3!`(B" (?a "$(3!`(B")
- (?e "$(3!^%n(B") (?u "$(3!^%r(B") (?i "$(3!^%o(B") (?E
"$(3!^%q(B")))
-;;; y
- ("$(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")
- (?W "$(3#T(B" (?a "$(3#T(B")
- (?e "$(3#R%n(B") (?u "$(3#R%r(B") (?i "$(3#R%o(B") (?E
"$(3#R%q(B")))
-;;; z
- ("$(3#B(B" (?e "$(3#=(B") (?u "$(3#>(B") (?i "$(3#?(B") (?a
"$(address@hidden(B") (?E "$(3#A(B") (?o "$(3#C(B")
- (?W "$(3#D(B" (?a "$(3#D(B")
- (?e "$(3#B%n(B") (?u "$(3#B%r(B") (?i "$(3#B%o(B") (?E
"$(3#B%q(B")))
-;;; { | } ~ DEL
- nil nil nil nil nil
- ])
-
-;; To avoid byte-compiler warnings. It should never be set globally.
-(defvar ethio-sera-being-called-by-w3)
-;; This variable will be bound by some third-party package.
-(defvar sera-being-called-by-w3)
-
;;;###autoload
-(defun ethio-sera-to-fidel-region (beg end &optional secondary force)
- "Convert the characters in region from SERA to FIDEL.
-The variable `ethio-primary-language' specifies the primary language
-and `ethio-secondary-language' specifies the secondary.
+(defun ethio-sera-to-fidel-buffer (&optional secondary force)
+ "Convert the current buffer from SERA to FIDEL.
+
+The variable `ethio-primary-language' specifies the primary
+language and `ethio-secondary-language' specifies the secondary.
-If the 3rd parameter SECONDARY is given and non-nil, assume the region
-begins with the secondary language; otherwise with the primary
-language.
+If the 1st optional argument SECONDARY is non-nil, assume the
+buffer begins with the secondary language; otherwise with the
+primary language.
-If the 4th parameter FORCE is given and non-nil, perform conversion
+If the 2nd optional argument FORCE is non-nil, perform conversion
even if the buffer is read-only.
See also the descriptions of the variables
-`ethio-use-colon-for-colon' and
-`ethio-use-three-dot-question'."
+`ethio-use-colon-for-colon' and `ethio-use-three-dot-question'."
- (interactive "r\nP")
- (save-restriction
- (narrow-to-region beg end)
- (ethio-sera-to-fidel-buffer secondary force)))
+ (interactive "P")
+ (ethio-sera-to-fidel-region (point-min) (point-max) secondary force))
+
+;; To avoid byte-compiler warnings. It should never be set globally.
+(defvar ethio-sera-being-called-by-w3)
+;; This variable will be bound by some third-party package.
+(defvar sera-being-called-by-w3)
;;;###autoload
-(defun ethio-sera-to-fidel-buffer (&optional secondary force)
- "Convert the current buffer from SERA to FIDEL.
+(defun ethio-sera-to-fidel-region (begin end &optional secondary force)
+ "Convert the characters in region from SERA to FIDEL.
The variable `ethio-primary-language' specifies the primary
language and `ethio-secondary-language' specifies the secondary.
-If the 1st optional parameter SECONDARY is non-nil, assume the buffer
-begins with the secondary language; otherwise with the primary
-language.
+If the 3rd argument SECONDARY is given and non-nil, assume the
+region begins with the secondary language; otherwise with the
+primary language.
-If the 2nd optional parametr FORCE is non-nil, perform conversion even if the
-buffer is read-only.
+If the 4th argument FORCE is given and non-nil, perform
+conversion even if the buffer is read-only.
See also the descriptions of the variables
-`ethio-use-colon-for-colon' and
-`ethio-use-three-dot-question'."
-
- (interactive "P")
+`ethio-use-colon-for-colon' and `ethio-use-three-dot-question'."
+ (interactive "r\nP")
(if (and buffer-read-only
(not force)
(not (y-or-n-p "Buffer is read-only. Force to convert? ")))
@@ -478,219 +238,165 @@
(let ((ethio-primary-language ethio-primary-language)
(ethio-secondary-language ethio-secondary-language)
- (ethio-use-colon-for-colon ethio-use-colon-for-colon)
- (ethio-use-three-dot-question ethio-use-three-dot-question)
- ;; The above four variables may be changed temporary
- ;; by tilde escapes during conversion. So we bind them to other
- ;; variables but of the same names.
+ ;; The above two variables may be changed temporarily by tilde
+ ;; escapes during conversion. We bind them to the variables
+ ;; of the same names so that the original values are restored
+ ;; when this function exits.
(buffer-read-only nil)
- (case-fold-search nil)
- current-language
- next-language)
+ (lang (if secondary ethio-secondary-language ethio-primary-language))
+ ret)
- (setq current-language
- (if secondary
- ethio-secondary-language
- ethio-primary-language))
+ (ethio-use-colon-for-colon ethio-use-colon-for-colon)
+ (ethio-use-three-dot-question ethio-use-three-dot-question)
+ (save-restriction
+ (narrow-to-region begin end)
(goto-char (point-min))
-
(while (not (eobp))
- (setq next-language
+ (setq ret
(cond
- ((eq current-language 'english)
- (ethio-sera-to-fidel-english))
- ((eq current-language 'amharic)
- (ethio-sera-to-fidel-ethio 'amharic))
- ((eq current-language 'tigrigna)
- (ethio-sera-to-fidel-ethio 'tigrigna))
- (t ; we don't know what to do
- (ethio-sera-to-fidel-english))))
-
- (setq current-language
- (cond
-
- ;; when language tag is explicitly specified
- ((not (eq next-language 'toggle))
- next-language)
-
- ;; found a toggle in a primary language section
- ((eq current-language ethio-primary-language)
- ethio-secondary-language)
-
- ;; found a toggle in a secondary, third, fourth, ...
- ;; language section
+ ((eq lang 'amharic)
+ (ethio-prefer-amharic t)
+ (ethio-sera-to-fidel-region-ethio 'amharic))
+ ((eq lang 'tigrigna)
+ (ethio-prefer-amharic nil)
+ (ethio-sera-to-fidel-region-ethio 'tigrigna))
(t
- ethio-primary-language))))
-
- ;; If ethio-implicit-period-conversion is non-nil, the
- ;; Ethiopic dot "$(3%u(B" at the end of an Ethiopic sentence is
- ;; replaced with the Ethiopic full stop "$(3$i(B".
- (if ethio-implicit-period-conversion
- (progn
- (goto-char (point-min))
- (while (re-search-forward
"\\([$(3!!(B-$(3$a%)(B-$(3%e%n(B-$(3%r%s(B]\\)$(3%u(B\\([ \t]\\)"
- nil t)
- (replace-match "\\1$(3$i(B\\2"))
- (goto-char (point-min))
- (while (re-search-forward
"\\([$(3!!(B-$(3$a%)(B-$(3%e%n(B-$(3%r%s(B]\\)$(3%u(B$" nil t)
- (replace-match "\\1$(3$i(B"))))
-
- ;; gemination
- (goto-char (point-min))
- (while (re-search-forward "\\ce$(3%s(B" nil 0)
- (compose-region
- (save-excursion (backward-char 2) (point))
- (point)))
- ))
+ (ethio-sera-to-fidel-region-noethio))))
+ (setq lang
+ (if (eq ret 'toggle)
+ (if (eq lang ethio-primary-language)
+ ethio-secondary-language
+ ethio-primary-language)
+ ret)))))
-(defun ethio-sera-to-fidel-english nil
- "Handle English section in SERA to FIDEL conversion.
-Conversion stops when a language switch is found. Then delete that
-switch and return the name of the new language as a symbol."
- (let ((new-language nil))
+ ;; Restore user's preference.
+ (ethio-adjust-robin))
- (while (and (not (eobp)) (null new-language))
+(defun ethio-sera-to-fidel-region-noethio ()
+ "Return next language as symbol: amharic, tigrigna, toggle or nil."
+ (let (lflag)
(cond
- ;; if no more "\", nothing to do.
- ((not (search-forward "\\" nil 0)))
+ ;; No more "\", i.e. nothing to do.
+ ((not (search-forward "\\" nil 0))
+ nil)
- ;; hereafter point is put after a "\".
- ;; first delete that "\", then check the following chars
+ ;; Hereafter point is put after a "\".
+ ;; First delete that "\", then check the following chars.
- ;; "\\" : leave the second "\"
- ((progn
- (delete-backward-char 1)
- (= (following-char) ?\\ ))
- (forward-char 1))
+ ;; A language flag.
+ ((progn (delete-char -1) (setq lflag (ethio-process-language-flag)))
+ lflag)
+
+ ;; "\\" : leave the second "\" and continue in the same language.
+ ((= (following-char) ?\\)
+ (forward-char 1)
+ nil)
- ;; "\ " : delete the following " "
+ ;; "\ " : delete the following " " and toggle the language.
((= (following-char) 32)
(delete-char 1)
- (setq new-language 'toggle))
-
- ;; a language flag
- ((setq new-language (ethio-process-language-flag)))
+ 'toggle)
- ;; just a "\" : not special sequence.
+ ;; A "\" but not a special sequence: simply toggle the language.
(t
- (setq new-language 'toggle))))
-
- new-language))
-
-(defun ethio-sera-to-fidel-ethio (lang)
- "Handle Ethiopic section in SERA to FIDEL conversion.
-Conversion stops when a language switch is found. Then delete that
-switch and return the name of the new language as a symbol.
-
-The parameter LANG (symbol, either `amharic' or `tigrigna') affects
-the conversion of \"a\"."
+ 'toggle))))
- (let ((new-language nil)
- (verbatim nil)
- start table table2 ch)
-
- (setcar (aref ethio-sera-to-fidel-table ?a)
- (if (eq lang 'tigrigna) "$(3"f(B" "$(3"c(B"))
+(defun ethio-sera-to-fidel-region-ethio (lang)
+ "Return next language as symbol: amharic, tigrigna, toggle or nil."
+ (save-restriction
+ (narrow-to-region
+ (point)
+ (if (re-search-forward "\\(`[1-9][0-9]*\\)\\|[\\<&]" nil t)
+ (match-beginning 0)
+ (point-max)))
+ (robin-convert-region (point-min) (point-max) "ethiopic-sera")
+ (goto-char (point-max)))
- (while (and (not (eobp)) (null new-language))
- (setq ch (following-char))
+ (let (lflag)
(cond
+ ((= (following-char) ?`)
+ (delete-char 1)
+ (ethio-process-digits)
+ lang)
- ;; skip from "<" to ">" (or from "&" to ";") if in w3-mode
- ((and (or (= ch ?<) (= ch ?&))
- (or (and (boundp 'ethio-sera-being-called-by-w3)
+ ((looking-at "[<&]")
+ (if (or (and (boundp 'ethio-sera-being-called-by-w3)
ethio-sera-being-called-by-w3)
(and (boundp 'sera-being-called-by-w3)
- sera-being-called-by-w3)))
- (search-forward (if (= ch ?<) ">" ";")
- nil 0))
-
- ;; leave non-ASCII characters as they are
- ((>= ch 128)
+ sera-being-called-by-w3))
+ (search-forward (if (= (following-char) ?<) ">" ";") nil 0)
(forward-char 1))
+ lang)
- ;; ethiopic digits
- ((looking-at "`[1-9][0-9]*")
+ ((eobp)
+ nil)
+
+ ;; Now we must be looking at a "\".
+ ;; First delete that "\", then check the following chars.
+
+ ((progn (delete-char 1) (= (following-char) 32))
(delete-char 1)
- (ethio-convert-digit))
+ 'toggle)
- ;; if not seeing a "\", do sera to fidel conversion
- ((/= ch ?\\ )
- (setq start (point))
- (forward-char 1)
- (setq table (aref ethio-sera-to-fidel-table ch))
- (while (setq table2 (cdr (assoc (following-char) table)))
- (setq table table2)
- (forward-char 1))
- (if (setq ch (car table))
- (progn
- (delete-region start (point))
- (if (stringp ch)
- (insert ch)
- (insert (eval ch))))))
-
- ;; if control reaches here, we must be looking at a "\"
-
- ;; verbatim mode
- (verbatim
- (if (looking-at "\\\\~! ?")
+ ((looking-at "[,.;:'`?\\]+")
+ (goto-char (match-end 0))
+ lang)
- ;; "\~!" or "\~! ". switch to non-verbatim mode
- (progn
- (replace-match "")
- (setq verbatim nil))
+ ((/= (following-char) ?~)
+ 'toggle)
- ;; "\" but not "\~!" nor "\~! ". skip the current "\".
- (forward-char 1)))
+ ;; Now we must be looking at a "~".
- ;; hereafter, non-verbatim mode and looking at a "\"
- ;; first delete that "\", then check the following chars.
+ ((setq lflag (ethio-process-language-flag))
+ lflag)
- ;; "\ " : delete the following " "
- ((progn
- (delete-char 1)
- (setq ch (following-char))
- (= ch 32))
- (delete-char 1)
- (setq new-language 'toggle))
+ ;; Delete the following "~" and check the following chars.
- ;; "\~!" or "\~! " : switch to verbatim mode
- ((looking-at "~! ?")
+ ((progn (delete-char 1) (looking-at "! ?"))
(replace-match "")
- (setq verbatim t))
+ (if (re-search-forward "\\\\~! ?" nil 0)
+ (replace-match ""))
+ lang)
- ;; a language flag
- ((setq new-language (ethio-process-language-flag)))
+ ((looking-at "-: ?")
+ (replace-match "")
+ (ethio-use-colon-for-colon t)
+ lang)
- ;; "\~" but not "\~!" nor a language flag
- ((= ch ?~)
- (delete-char 1)
- (ethio-tilde-escape))
+ ((looking-at "`: ?")
+ (replace-match "")
+ (ethio-use-colon-for-colon nil)
+ lang)
- ;; ASCII punctuation escape. skip
- ((looking-at "\\(,\\|\\.\\|;\\|:\\|'\\|`\\|\?\\|\\\\\\)+")
- (goto-char (match-end 0)))
+ ((looking-at "`| ?")
+ (replace-match "")
+ (ethio-use-three-dot-question t)
+ lang)
- ;; "\", but not special sequence
- (t
- (setq new-language 'toggle))))
+ ((looking-at "\\? ?")
+ (replace-match "")
+ (ethio-use-three-dot-question nil)
+ lang)
- new-language))
+ ;; Unknown tilde escape. Recover the deleted chars.
+ (t
+ (insert "\\~")
+ lang))))
(defun ethio-process-language-flag nil
"Process a language flag of the form \"~lang\" or \"~lang1~lang2\".
If looking at \"~lang1~lang2\", set `ethio-primary-language' and
-`ethio-une-secondary-language' based on \"lang1\" and \"lang2\".
+`ethio-secondary-language' based on \"lang1\" and \"lang2\".
Then delete the language flag \"~lang1~lang2\" from the buffer.
Return value is the new primary language.
-If looking at \"~lang\", delete that language flag \"~lang\" from the
-buffer and return that language. In this case
-`ethio-primary-language' and `ethio-uni-secondary-language'
-are left unchanged.
+If looking at \"~lang\", delete that language flag \"~lang\" from
+the buffer and return that language. In this case
+`ethio-primary-language' and `ethio-secondary-language' are left
+unchanged.
If an unsupported language flag is found, just return nil without
changing anything."
@@ -701,12 +407,8 @@
;; ~lang1~lang2
((and (looking-at
"~\\([a-z][a-z][a-z]?\\)~\\([a-z][a-z][a-z]?\\)[ \t\n\\]")
- (setq lang1
- (ethio-flag-to-language
- (buffer-substring (match-beginning 1) (match-end 1))))
- (setq lang2
- (ethio-flag-to-language
- (buffer-substring (match-beginning 2) (match-end 2)))))
+ (setq lang1 (ethio-flag-to-language (match-string 1)))
+ (setq lang2 (ethio-flag-to-language (match-string 2))))
(setq ethio-primary-language lang1
ethio-secondary-language lang2)
(delete-region (point) (match-end 2))
@@ -716,9 +418,7 @@
;; ~lang
((and (looking-at "~\\([a-z][a-z][a-z]?\\)[ \t\n\\]")
- (setq lang1
- (ethio-flag-to-language
- (buffer-substring (match-beginning 1) (match-end 1)))))
+ (setq lang1 (ethio-flag-to-language (match-string 1))))
(delete-region (point) (match-end 1))
(if (= (following-char) 32)
(delete-char 1))
@@ -728,59 +428,6 @@
(t
nil))))
-(defun ethio-tilde-escape nil
- "Handle a SERA tilde escape in Ethiopic section and delete it.
-Delete the escape even it is not recognized."
-
- (let ((p (point)) command)
- (skip-chars-forward "^ \t\n\\\\")
- (setq command (buffer-substring p (point)))
- (delete-region p (point))
- (if (= (following-char) 32)
- (delete-char 1))
-
- (cond
-
- ;; \~-:
- ((string= command "-:")
- (setq ethio-use-colon-for-colon t))
-
- ;; \~`:
- ((string= command "`:")
- (setq ethio-use-colon-for-colon nil))
-
- ;; \~?
- ((string= command "?")
- (setq ethio-use-three-dot-question nil))
-
- ;; \~`|
- ((string= command "`|")
- (setq ethio-use-three-dot-question t))
-
- ;; \~e
- ((string= command "e")
- (insert "$(3%j(B"))
-
- ;; \~E
- ((string= command "E")
- (insert "$(3%k(B"))
-
- ;; \~a
- ((string= command "a")
- (insert "$(3%l(B"))
-
- ;; \~A
- ((string= command "A")
- (insert "$(3%m(B"))
-
- ;; \~X
- ((string= command "X")
- (insert "$(3%i(B"))
-
- ;; unsupported tilde escape
- (t
- nil))))
-
(defun ethio-flag-to-language (flag)
(cond
((or (string= flag "en") (string= flag "eng")) 'english)
@@ -788,7 +435,7 @@
((or (string= flag "am") (string= flag "amh")) 'amharic)
(t nil)))
-(defun ethio-convert-digit nil
+(defun ethio-process-digits nil
"Convert Arabic digits to Ethiopic digits."
(let (ch z)
(while (and (>= (setq ch (following-char)) ?1)
@@ -805,97 +452,23 @@
;; first digit is 10, 20, ..., or 90
((= (mod z 2) 1)
- (insert (aref [?$(3$y(B ?$(3$z(B ?$(3${(B ?$(3$|(B ?$(3$}(B
?$(3$~(B ?$(3%!(B ?$(3%"(B ?$(3%#(B] (- ch ?1)))
+ (insert (aref [?á² ?á³ ?á´ ?áµ ?ᶠ?á· ?Ḡ?á¹ ?áº] (- ch ?1)))
(setq z (1- z)))
;; first digit is 2, 3, ..., or 9
((/= ch ?1)
- (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))))
+ (insert (aref [?᪠?á« ?ᬠ?á ?á® ?ᯠ?á° ?á±] (- ch ?2))))
;; single 1
((= z 0)
- (insert "$(3$p(B")))
+ (insert "á©")))
;; 100
(if (= (mod z 4) 2)
- (insert "$(3%$(B"))
+ (insert "á»"))
;; 10000
- (insert-char ?$(3%%(B (/ z 4)))))
-
-;;;###autoload
-(defun ethio-sera-to-fidel-mail-or-marker (&optional arg)
- "Execute `ethio-sera-to-fidel-mail' or `ethio-sera-to-fidel-marker'
depending on the current major mode.
-If in rmail-mode or in mail-mode, execute the former; otherwise latter."
-
- (interactive "P")
- (if (or (eq major-mode 'rmail-mode)
- (eq major-mode 'mail-mode))
- (ethio-sera-to-fidel-mail (prefix-numeric-value arg))
- (ethio-sera-to-fidel-marker arg)))
-
-;;;###autoload
-(defun ethio-sera-to-fidel-mail (&optional arg)
- "Convert SERA to FIDEL to read/write mail and news.
-
-If the buffer contains the markers \"<sera>\" and \"</sera>\",
-convert the segments between them into FIDEL.
-
-If invoked interactively and there is no marker, convert the subject field
-and the body into FIDEL using `ethio-sera-to-fidel-region'."
-
- (interactive "p")
- (let ((buffer-read-only nil)
- border)
- (save-excursion
-
- ;; follow RFC822 rules instead of looking for a fixed separator
- (rfc822-goto-eoh)
- (forward-line 1)
- (setq border (point))
-
- ;; note that the point is placed at the border
- (if (or (re-search-forward "^<sera>$" nil t)
- (progn
- (goto-char (point-min))
- (re-search-forward "^Subject: <sera>" border t)))
-
- ;; there are markers
- (progn
- ;; we start with the body so that the border will not change
- ;; use "^<sera>\n" instead of "^<sera>$" not to leave a blank line
- (goto-char border)
- (while (re-search-forward "^<sera>\n" nil t)
- (replace-match "")
- (ethio-sera-to-fidel-region
- (point)
- (progn
- (if (re-search-forward "^</sera>\n" nil 0)
- (replace-match ""))
- (point))))
- ;; now process the subject
- (goto-char (point-min))
- (if (re-search-forward "^Subject: <sera>" border t)
- (ethio-sera-to-fidel-region
- (progn (delete-backward-char 6) (point))
- (progn
- (if (re-search-forward "</sera>$" (line-end-position) 0)
- (replace-match ""))
- (point)))))
-
- ;; in case there are no marks but invoked interactively
- (if arg
- (progn
- (ethio-sera-to-fidel-region border (point-max))
- (goto-char (point-min))
- (if (re-search-forward "^Subject: " border t)
- (ethio-sera-to-fidel-region (point) (line-end-position))))))
-
- ;; adjust the rmail marker
- (if (eq major-mode 'rmail-mode)
- (set-marker
- (aref rmail-message-vector (1+ rmail-current-message))
- (point-max))))))
+ (insert-char ?á¼ (/ z 4)))))
;;;###autoload
(defun ethio-sera-to-fidel-marker (&optional force)
@@ -909,10 +482,10 @@
(error ""))
(save-excursion
(goto-char (point-min))
- (while (re-search-forward "<sera>" nil t)
+ (while (search-forward "<sera>" nil t)
(ethio-sera-to-fidel-region
(point)
- (if (re-search-forward "</sera>" nil t)
+ (if (search-forward "</sera>" nil t)
(match-beginning 0)
(point-max))
nil
@@ -922,71 +495,6 @@
;; FIDEL to SERA
;;
-(defconst ethio-fidel-to-sera-map
- [ "he" "hu" "hi" "ha" "hE" "h" "ho" "" ;; 0 - 7
- "le" "lu" "li" "la" "lE" "l" "lo" "lWa" ;; 8
- "He" "Hu" "Hi" "Ha" "HE" "H" "Ho" "HWa" ;; 16
- "me" "mu" "mi" "ma" "mE" "m" "mo" "mWa" ;; 24
- "`se" "`su" "`si" "`sa" "`sE" "`s" "`so" "`sWa" ;; 32
- "re" "ru" "ri" "ra" "rE" "r" "ro" "rWa" ;; 40
- "se" "su" "si" "sa" "sE" "s" "so" "sWa" ;; 48
- "xe" "xu" "xi" "xa" "xE" "x" "xo" "xWa" ;; 56
- "qe" "qu" "qi" "qa" "qE" "q" "qo" "" ;; 64
- "qWe" "" "qWi" "qWa" "qWE" "qW'" "" "" ;; 72
- "Qe" "Qu" "Qi" "Qa" "QE" "Q" "Qo" "" ;; 80
- "QWe" "" "QWi" "QWa" "QWE" "QW'" "" "" ;; 88
- "be" "bu" "bi" "ba" "bE" "b" "bo" "bWa" ;; 96
- "ve" "vu" "vi" "va" "vE" "v" "vo" "vWa" ;; 104
- "te" "tu" "ti" "ta" "tE" "t" "to" "tWa" ;; 112
- "ce" "cu" "ci" "ca" "cE" "c" "co" "cWa" ;; 120
- "`he" "`hu" "`hi" "`ha" "`hE" "`h" "`ho" "" ;; 128
- "hWe" "" "hWi" "hWa" "hWE" "hW'" "" "" ;; 136
- "ne" "nu" "ni" "na" "nE" "n" "no" "nWa" ;; 144
- "Ne" "Nu" "Ni" "Na" "NE" "N" "No" "NWa" ;; 152
- "e" "u" "i" "A" "E" "I" "o" "ea" ;; 160
- "ke" "ku" "ki" "ka" "kE" "k" "ko" "" ;; 168
- "kWe" "" "kWi" "kWa" "kWE" "kW'" "" "" ;; 176
- "Ke" "Ku" "Ki" "Ka" "KE" "K" "Ko" "" ;; 184
- "KWe" "" "KWi" "KWa" "KWE" "KW'" "" "" ;; 192
- "we" "wu" "wi" "wa" "wE" "w" "wo" "" ;; 200
- "`e" "`u" "`i" "`a" "`E" "`I" "`o" "" ;; 208
- "ze" "zu" "zi" "za" "zE" "z" "zo" "zWa" ;; 216
- "Ze" "Zu" "Zi" "Za" "ZE" "Z" "Zo" "ZWa" ;; 224
- "ye" "yu" "yi" "ya" "yE" "y" "yo" "yWa" ;; 232
- "de" "du" "di" "da" "dE" "d" "do" "dWa" ;; 240
- "De" "Du" "Di" "Da" "DE" "D" "Do" "DWa" ;; 248
- "je" "ju" "ji" "ja" "jE" "j" "jo" "jWa" ;; 256
- "ge" "gu" "gi" "ga" "gE" "g" "go" "" ;; 264
- "gWe" "" "gWi" "gWa" "gWE" "gW'" "" "" ;; 272
- "Ge" "Gu" "Gi" "Ga" "GE" "G" "Go" "GWa" ;; 280
- "Te" "Tu" "Ti" "Ta" "TE" "T" "To" "TWa" ;; 288
- "Ce" "Cu" "Ci" "Ca" "CE" "C" "Co" "CWa" ;; 296
- "Pe" "Pu" "Pi" "Pa" "PE" "P" "Po" "PWa" ;; 304
- "Se" "Su" "Si" "Sa" "SE" "S" "So" "SWa" ;; 312
- "`Se" "`Su" "`Si" "`Sa" "`SE" "`S" "`So" "" ;; 320
- "fe" "fu" "fi" "fa" "fE" "f" "fo" "fWa" ;; 328
- "pe" "pu" "pi" "pa" "pE" "p" "po" "pWa" ;; 336
- "mYa" "rYa" "fYa" "" "" "" "" "" ;; 344
- " " " : " "::" "," ";" "-:" ":-" "`?" ;; 352
- ":|:" "1" "2" "3" "4" "5" "6" "7" ;; 360
- "8" "9" "10" "20" "30" "40" "50" "60" ;; 368
- "70" "80" "90" "100" "10000" "" "" "" ;; 376
- "`qe" "`qu" "`qi" "`qa" "`qE" "`q" "`qo" "" ;; 384
- "mWe" "bWe" "GWe" "fWe" "pWe" "" "" "" ;; 392
- "`ke" "`ku" "`ki" "`ka" "`kE" "`k" "`ko" "" ;; 400
- "mWi" "bWi" "GWi" "fWi" "pWi" "" "" "" ;; 408
- "Xe" "Xu" "Xi" "Xa" "XE" "X" "Xo" "" ;; 416
- "mWE" "bWE" "GWE" "fWE" "pWE" "" "" "" ;; 424
- "`ge" "`gu" "`gi" "`ga" "`gE" "`g" "`go" "" ;; 432
- "mW'" "bW'" "GW'" "fW'" "pW'" "" "" "" ;; 440
- "\\~X " "\\~e " "\\~E " "\\~a " "\\~A " "wWe" "wWi" "wWa" ;; 448
- "wWE" "wW'" "''" "`!" "." "<<" ">>" "?" ]) ;; 456
-
-(defun ethio-prefer-amharic-p nil
- (or (eq ethio-primary-language 'amharic)
- (and (not (eq ethio-primary-language 'tigrigna))
- (eq ethio-secondary-language 'amharic))))
-
(defun ethio-language-to-flag (lang)
(cond
((eq lang 'english) "eng")
@@ -995,284 +503,142 @@
(t "")))
;;;###autoload
-(defun ethio-fidel-to-sera-region (begin end &optional secondary force)
- "Replace all the FIDEL characters in the region to the SERA format.
+(defun ethio-fidel-to-sera-buffer (&optional secondary force)
+ "Replace all the FIDEL characters in the current buffer to the SERA format.
The variable `ethio-primary-language' specifies the primary
language and `ethio-secondary-language' specifies the secondary.
-If the 3dr parameter SECONDARY is given and non-nil, try to convert
-the region so that it begins in the secondary language; otherwise with
-the primary language.
+If the 1st optional argument SECONDARY is non-nil, try to convert the
+region so that it begins with the secondary language; otherwise with the
+primary language.
-If the 4th parameter FORCE is given and non-nil, convert even if the
+If the 2nd optional argument FORCE is non-nil, convert even if the
buffer is read-only.
See also the descriptions of the variables
`ethio-use-colon-for-colon', `ethio-use-three-dot-question',
`ethio-quote-vowel-always' and `ethio-numeric-reduction'."
- (interactive "r\nP")
- (save-restriction
- (narrow-to-region begin end)
- (ethio-fidel-to-sera-buffer secondary force)))
+ (interactive "P")
+ (ethio-fidel-to-sera-region (point-min) (point-max) secondary force))
;;;###autoload
-(defun ethio-fidel-to-sera-buffer (&optional secondary force)
- "Replace all the FIDEL characters in the current buffer to the SERA format.
+(defun ethio-fidel-to-sera-region (begin end &optional secondary force)
+ "Replace all the FIDEL characters in the region to the SERA format.
+
The variable `ethio-primary-language' specifies the primary
language and `ethio-secondary-language' specifies the secondary.
-If the 1st optional parameter SECONDARY is non-nil, try to convert the
-region so that it begins in the secondary language; otherwise with the
-primary language.
+If the 3rd argument SECONDARY is given and non-nil, convert
+the region so that it begins with the secondary language; otherwise with
+the primary language.
-If the 2nd optional parameter FORCE is non-nil, convert even if the
+If the 4th argument FORCE is given and non-nil, convert even if the
buffer is read-only.
See also the descriptions of the variables
`ethio-use-colon-for-colon', `ethio-use-three-dot-question',
`ethio-quote-vowel-always' and `ethio-numeric-reduction'."
- (interactive "P")
+ (interactive "r\nP")
(if (and buffer-read-only
(not force)
(not (y-or-n-p "Buffer is read-only. Force to convert? ")))
(error ""))
+ (save-restriction
+ (narrow-to-region begin end)
+
(let ((buffer-read-only nil)
- (case-fold-search nil)
- (lonec nil) ;; t means previous char was a lone consonant
- (fidel nil) ;; t means previous char was a FIDEL
- (digit nil) ;; t means previous char was an Ethiopic digit
+ (mode (if secondary
+ ethio-secondary-language
+ ethio-primary-language))
(flag (if (ethio-prefer-amharic-p) "\\~amh " "\\~tir "))
- mode ch)
+ p ch)
- ;; user's preference in transcription
- (if ethio-use-colon-for-colon
- (progn
- (aset ethio-fidel-to-sera-map 353 "`:")
- (aset ethio-fidel-to-sera-map 357 ":"))
- (aset ethio-fidel-to-sera-map 353 " : ")
- (aset ethio-fidel-to-sera-map 357 "-:"))
-
- (if ethio-use-three-dot-question
- (progn
- (aset ethio-fidel-to-sera-map 359 "?")
- (aset ethio-fidel-to-sera-map 463 "`?"))
- (aset ethio-fidel-to-sera-map 359 "`?")
- (aset ethio-fidel-to-sera-map 463 "?"))
-
- (mapc
- '(lambda (x)
- (aset (aref ethio-fidel-to-sera-map x)
- 2
- (if ethio-W-sixth-always ?' ?u)))
- '(77 93 141 181 197 277 440 441 442 443 444 457))
-
- (if (ethio-prefer-amharic-p)
- (aset ethio-fidel-to-sera-map 160 "a")
- (aset ethio-fidel-to-sera-map 160 "e"))
- ;; end of user's preference
-
- ;; first, decompose geminated characters
- (decompose-region (point-min) (point-max))
-
- ;; main conversion routine
(goto-char (point-min))
- (while (not (eobp))
- (setq ch (following-char))
+ (ethio-adjust-robin)
+ (unless (eq mode 'english)
+ (setq mode 'ethiopic))
+ (if (and (eq mode 'english) (looking-at "\\ce"))
+ (setq mode 'ethiopic))
+ (if (and (eq mode 'ethiopic) (looking-at "\\Ce"))
+ (setq mode 'english))
+ (insert (if (eq mode 'english) "\\~eng " flag))
- (cond ; ethiopic, english, neutral
+ (while (not (eobp))
- ;; ethiopic character. must go to ethiopic mode, if not in it.
- ((eq (char-charset ch) 'ethiopic)
- (setq ch (ethio-char-to-ethiocode ch))
- (delete-char 1)
- (if (not (eq mode 'ethiopic))
+ (if (eq mode 'english)
(progn
+ (if (re-search-forward "\\(\\ce\\|\\\\\\)" nil 0)
+ (forward-char -1))
+ (cond
+ ((eq (following-char) ?\\)
+ (insert "\\")
+ (forward-char 1))
+ ((looking-at "\\ce")
(insert flag)
- (setq mode 'ethiopic)))
+ (setq mode 'ethiopic))))
- (cond ; fidel, punc, digit
-
- ;; fidels
- ((or (<= ch 346) ; he - fYa
- (and (>= ch 384) (<= ch 444)) ; `qe - pw
- (and (>= ch 453) (<= ch 457))) ; wWe - wW
- (if (and (memq ch '(160 161 162 163 164 166 167)) ; (e - ea)
- (or lonec
- (and ethio-quote-vowel-always
- fidel)))
- (insert "'"))
- (insert (aref ethio-fidel-to-sera-map ch))
- (setq lonec (ethio-lone-consonant-p ch)
- fidel t
- digit nil))
-
- ;; punctuations or icons
- ((or (and (>= ch 353) (<= ch 360)) ; : - :|:
- (>= ch 458) ; '' - ?
- (and (>= ch 448) (<= ch 452))) ; \~X \~e \~E \~a \~A
- (insert (aref ethio-fidel-to-sera-map ch))
- (setq lonec nil
- fidel nil
- digit nil))
-
- ;; now CH must be an ethiopic digit
-
- ;; reduction = 0 or not preceded by Ethiopic number(s)
- ((or (= ethio-numeric-reduction 0)
- (not digit))
- (insert "`" (aref ethio-fidel-to-sera-map ch))
- (setq lonec nil
- fidel nil
- digit t))
-
- ;; reduction = 2 and following 10s, 100s, 10000s
- ((and (= ethio-numeric-reduction 2)
- (memq ch '(370 379 380)))
- (insert (substring (aref ethio-fidel-to-sera-map ch) 1))
- (setq lonec nil
- fidel nil
- digit t))
-
- ;; ordinary following digits
- (t
- (insert (aref ethio-fidel-to-sera-map ch))
- (setq lonec nil
- fidel nil
- digit t))))
+ ;; If we reach here, mode is ethiopic.
+ (setq p (point))
+ (if (re-search-forward "[a-z,.;:'`?\\<&]" nil 0)
+ (forward-char -1))
+ (save-restriction
+ (narrow-to-region p (point))
+ (robin-invert-region (point-min) (point-max) "ethiopic-sera")
- ;; english character. must go to english mode, if not in it.
- ((or (and (>= ch ?a) (<= ch ?z))
+ ;; ethio-quote-vowel-alwyas
+ (goto-char (point-min))
+ (while (re-search-forward "'[eauio]" nil t)
+ (save-excursion
+ (forward-char -2)
+ (setq ch (preceding-char))
+ (if (or (and (>= ch ?a) (<= ch ?z))
(and (>= ch ?A) (<= ch ?Z)))
- (if (not (eq mode 'english))
- (insert "\\~eng "))
- (forward-char 1)
- (setq mode 'english
- lonec nil
- fidel nil
- digit nil))
+ (if (and (not ethio-quote-vowel-always)
+ (memq ch '(?e ?a ?u ?i ?o ?E ?A ?I)))
+ (delete-char 1))
+ (delete-char 1))))
- ;; ch can appear both in ethiopic section and in english section.
- (t
+ ;; ethio-W-sixth-always
+ (unless ethio-W-sixth-always
+ (goto-char (point-min))
+ (while (search-forward "W'" nil t)
+ (delete-char -1)
+ (insert "u")))
- ;; we must decide the mode, if not decided yet
- (if (null mode)
- (progn
- (setq mode
- (if secondary
- ethio-secondary-language
- ethio-primary-language))
- (if (eq mode 'english)
- (insert "\\~eng ")
- (insert flag)
- (setq mode 'ethiopic)))) ; tigrigna & amharic --> ethiopic
+ ;; ethio-numeric-reduction
+ (when (> ethio-numeric-reduction 0)
+ (goto-char (point-min))
+ (while (re-search-forward "\\([0-9]\\)`\\([0-9]\\)" nil t)
+ (replace-match "\\1\\2")
+ (forward-char -1)))
+ (when (= ethio-numeric-reduction 2)
+ (goto-char (point-min))
+ (while (re-search-forward "\\([0-9]\\)1\\(0+\\)" nil t)
+ (replace-match "\\1\\2")))
- (cond ; \ , eng-mode , punc , w3 , other
+ (goto-char (point-max)))
- ;; backslash is always quoted
- ((= ch ?\\ )
+ (cond
+ ((looking-at "[a-z]")
+ (insert"\\~eng ")
+ (setq mode 'english))
+ ((looking-at "[,.;:'`\\]+")
(insert "\\")
+ (goto-char (1+ (match-end 0))))
+ ((= (following-char) ??)
+ (if ethio-use-three-dot-question
+ (insert "\\"))
(forward-char 1))
-
- ;; nothing to do if in english mode
- ((eq mode 'english)
- (forward-char 1))
-
- ;; now we must be in ethiopic mode and seeing a non-"\"
-
- ;; ascii punctuations in ethiopic mode
- ((looking-at "[,.;:'`?]+")
- (insert "\\")
- (goto-char (1+ (match-end 0)))) ; because we inserted one byte (\)
-
- ;; skip from "<" to ">" (or from "&" to ";") if called from w3
- ((and (or (= ch ?<) (= ch ?&))
- (or (and (boundp 'ethio-sera-being-called-by-w3)
+ ((looking-at "[<&]")
+ (if (or (and (boundp 'ethio-sera-being-called-by-w3)
ethio-sera-being-called-by-w3)
(and (boundp 'sera-being-called-by-w3)
- sera-being-called-by-w3)))
- (search-forward (if (= ch ?<) ">" ";")
- nil 0))
-
- ;; neutral character. no need to quote. just skip it.
- (t
- (forward-char 1)))
-
- (setq lonec nil
- fidel nil
- digit nil)))
- ;; end of main conversion routine
- )))
-
-(defun ethio-lone-consonant-p (ethiocode)
- "If ETHIOCODE is an Ethiopic lone consonant, return t."
- (or (and (< ethiocode 344) (= (% ethiocode 8) 5))
-
- ;; `q `k X `g mW bW GW fW pW wW
- (memq ethiocode '(389 405 421 437 440 441 442 443 444 457))))
-
-;;;###autoload
-(defun ethio-fidel-to-sera-mail-or-marker (&optional arg)
- "Execute `ethio-fidel-to-sera-mail' or `ethio-fidel-to-sera-marker'
depending on the current major mode.
-If in rmail-mode or in mail-mode, execute the former; otherwise latter."
-
- (interactive "P")
- (if (or (eq major-mode 'rmail-mode)
- (eq major-mode 'mail-mode))
- (ethio-fidel-to-sera-mail)
- (ethio-fidel-to-sera-marker arg)))
-
-;;;###autoload
-(defun ethio-fidel-to-sera-mail nil
- "Convert FIDEL to SERA to read/write mail and news.
-
-If the body contains at least one Ethiopic character,
- 1) insert the string \"<sera>\" at the beginning of the body,
- 2) insert \"</sera>\" at the end of the body, and
- 3) convert the body into SERA.
-
-The very same procedure applies to the subject field, too."
-
- (interactive)
- (let ((buffer-read-only nil)
- border)
- (save-excursion
-
- ;; follow RFC822 rules instead of looking for a fixed separator
- (rfc822-goto-eoh)
- (forward-line 1)
- (setq border (point))
-
- ;; process body first not to change the border
- ;; note that the point is already at the border
- (if (re-search-forward "\\ce" nil t)
- (progn
- (ethio-fidel-to-sera-region border (point-max))
- (goto-char border)
- (insert "<sera>")
- (goto-char (point-max))
- (insert "</sera>")))
-
- ;; process subject
- (goto-char (point-min))
- (if (re-search-forward "^Subject: " border t)
- (let ((beg (point))
- (end (line-end-position)))
- (if (re-search-forward "\\ce" end t)
- (progn
- (ethio-fidel-to-sera-region beg end)
- (goto-char beg)
- (insert "<sera>")
- (end-of-line)
- (insert "</sera>")))))
-
- ;; adjust the rmail marker
- (if (eq major-mode 'rmail-mode)
- (set-marker
- (aref rmail-message-vector (1+ rmail-current-message))
- (point-max))))))
+ sera-being-called-by-w3))
+ (search-forward (if (= (following-char) ?<) ">" "&") nil 0)
+ (forward-char 1)))))))))
;;;###autoload
(defun ethio-fidel-to-sera-marker (&optional force)
@@ -1286,10 +652,10 @@
(error ""))
(save-excursion
(goto-char (point-min))
- (while (re-search-forward "<sera>" nil t)
+ (while (search-forward "<sera>" nil t)
(ethio-fidel-to-sera-region
(point)
- (if (re-search-forward "</sera>" nil t)
+ (if (search-forward "</sera>" nil t)
(match-beginning 0)
(point-max))
nil
@@ -1303,225 +669,31 @@
(defun ethio-modify-vowel nil
"Modify the vowel of the FIDEL that is under the cursor."
(interactive)
- (let ((ch (following-char))
- (composite nil) ; geminated or not
- newch base vowel modulo)
-
- (cond
- ;; in case of gemination
- ((eq (char-charset ch) 'composition)
- (setq ch (string-to-char (char-to-string ch))
- composite t))
- ;; neither gemination nor fidel
- ((not (eq (char-charset ch) 'ethiopic))
- (error "Not a valid character")))
-
- ;; set frequently referred character features
- (setq ch (ethio-char-to-ethiocode ch)
- base (* (/ ch 8) 8)
- modulo (% ch 8))
-
- (if (or (and (>= ch 344) (<= ch 380)) ;; mYa - `10000
- (and (>= ch 448) (<= ch 452)) ;; \~X - \~A
- (>= ch 458)) ;; private punctuations
- (error "Not a valid character"))
-
- (setq
- newch
- (cond
-
- ;; first standalone vowels
- ((= base 160)
- (if (ethio-prefer-amharic-p)
- (message "Modify vowel to: [auiAEIoW\"] ")
- (message "Modify vowel to: [euiAEIoW\"] "))
- (setq vowel (read-char))
- (cond
- ((= vowel ?e) 160)
- ((= vowel ?u) 161)
- ((= vowel ?i) 162)
- ((= vowel ?A) 163)
- ((= vowel ?E) 164)
- ((= vowel ?I) 165)
- ((= vowel ?o) 166)
- ((= vowel ?W) 167)
- ((= vowel ?a) (if (ethio-prefer-amharic-p) 160 163))
- ((= vowel ?\") (setq composite t) ch)
- (t nil)))
-
- ;; second standalone vowels
- ((= base 208)
- (message "Modify vowel to: [euiaEIo\"] ")
- (setq vowel (read-char))
- (cond
- ((= vowel ?e) 208)
- ((= vowel ?u) 209)
- ((= vowel ?i) 210)
- ((= vowel ?a) 211)
- ((= vowel ?E) 212)
- ((= vowel ?I) 213)
- ((= vowel ?o) 214)
- ((= vowel ?\") (setq composite t) ch)
- (t nil)))
-
- ;; 12-form consonants, *W* form
- ((memq base '(72 88 136 176 192 272)) ; qW QW hW kW KW gW
- (message "Modify vowel to: [euiaE'\"] ")
- (setq vowel (read-char))
- (cond
- ((= vowel ?e) base)
- ((= vowel ?u) (+ base 5))
- ((= vowel ?i) (+ base 2))
- ((= vowel ?a) (+ base 3))
- ((= vowel ?E) (+ base 4))
- ((= vowel ?') (+ base 5))
- ((= vowel ?\") (setq composite t) ch)
- (t nil)))
-
- ;; extended 12-form consonants, mWa bWa GWa fWa pWa
- ((= ch 31) ; mWa
- (message "Modify vowel to: [euiaE'\"] ")
- (setq vowel (read-char))
- (cond
- ((= vowel ?e) 392)
- ((= vowel ?u) 440)
- ((= vowel ?i) 408)
- ((= vowel ?a) ch)
- ((= vowel ?E) 424)
- ((= vowel ?') 440)
- ((= vowel ?\") (setq composite t) ch)
- (t nil)))
- ((= ch 103) ; bWa
- (message "Modify vowel to: [euiaE'\"] ")
- (setq vowel (read-char))
- (cond
- ((= vowel ?e) 393)
- ((= vowel ?u) 441)
- ((= vowel ?i) 409)
- ((= vowel ?a) ch)
- ((= vowel ?E) 425)
- ((= vowel ?') 441)
- ((= vowel ?\") (setq composite t) ch)
- (t nil)))
- ((= ch 287) ; GWa
- (message "Modify vowel to: [euiaE'\"] ")
- (setq vowel (read-char))
- (cond
- ((= vowel ?e) 394)
- ((= vowel ?u) 442)
- ((= vowel ?i) 410)
- ((= vowel ?a) ch)
- ((= vowel ?E) 426)
- ((= vowel ?') 442)
- ((= vowel ?\") (setq composite t) ch)
- (t nil)))
- ((= ch 335) ; fWa
- (message "Modify vowel to: [euiaE'\"] ")
- (setq vowel (read-char))
- (cond
- ((= vowel ?e) 395)
- ((= vowel ?u) 443)
- ((= vowel ?i) 411)
- ((= vowel ?a) ch)
- ((= vowel ?E) 427)
- ((= vowel ?') 443)
- ((= vowel ?\") (setq composite t) ch)
- (t nil)))
- ((= ch 343) ; pWa
- (message "Modify vowel to: [euiaE'\"] ")
- (setq vowel (read-char))
- (cond
- ((= vowel ?e) 396)
- ((= vowel ?u) 444)
- ((= vowel ?i) 412)
- ((= vowel ?a) ch)
- ((= vowel ?E) 428)
- ((= vowel ?') 444)
- ((= vowel ?\") (setq composite t) ch)
- (t nil)))
-
- ;; extended 12-form consonatns, mW* bW* GW* fW* pW*
- ((memq base '(392 408 424 440)) ; *We *Wi *WE *W
- (message "Modify vowel to: [eiEau'\"] ")
- (setq vowel (read-char))
- (cond
- ((= vowel ?e) (+ 392 modulo))
- ((= vowel ?i) (+ 408 modulo))
- ((= vowel ?E) (+ 424 modulo))
- ((= vowel ?a) (cond
- ((= modulo 0) 31) ; mWa
- ((= modulo 1) 103) ; bWa
- ((= modulo 2) 287) ; GWa
- ((= modulo 3) 335) ; fWa
- ((= modulo 4) 343) ; pWa
- (t nil))) ; never reach here
- ((= vowel ?') (+ 440 modulo))
- ((= vowel ?u) (+ 440 modulo))
- ((= vowel ?\") (setq composite t) ch)
- (t nil)))
-
- ((and (>= ch 453) (<= ch 457)) ; wWe wWi wWa wWE wW
- (message "Modify vowel to: [eiaE'u\"] ")
- (setq vowel (read-char))
- (cond
- ((= vowel ?e) 453)
- ((= vowel ?i) 454)
- ((= vowel ?a) 455)
- ((= vowel ?E) 456)
- ((= vowel ?') 457)
- ((= vowel ?u) 457)
- ((= vowel ?\") (setq composite t) ch)
- (t nil)))
-
- ;; 7-form consonants, or
- ;; first 7 of 8-form consonants
- ((<= modulo 6)
- (message "Modify vowel to: [euiaE'o\"] ")
- (setq vowel (read-char))
- (cond
- ((= vowel ?e) base)
- ((= vowel ?u) (+ base 1))
- ((= vowel ?i) (+ base 2))
- ((= vowel ?a) (+ base 3))
- ((= vowel ?E) (+ base 4))
- ((= vowel ?') (+ base 5))
- ((= vowel ?o) (+ base 6))
- ((= vowel ?\") (setq composite t) ch)
- (t nil)))
-
- ;; otherwise
- (t
- nil)))
-
- (cond
-
- ;; could not get new character
- ((null newch)
- (error "Invalid vowel"))
-
- ;; vowel changed on a composite Fidel
- (composite
- (delete-char 1)
- (insert
- (compose-string
- (concat (char-to-string (ethio-ethiocode-to-char newch))
"$(3%s(B"))))
-
- ;; simple vowel modification
- (t
+ (ethio-adjust-robin)
+ (let ((consonant (ethio-get-consonant (following-char)))
+ vowel)
+ (if (null consonant)
+ (error "") ; not an Ethiopic char
+ (setq vowel (read-char "Modify vowel to: "))
(delete-char 1)
- (insert (ethio-ethiocode-to-char newch))))))
-
-(defun ethio-ethiocode-to-char (ethiocode)
- (make-char
- 'ethiopic
- (+ (/ ethiocode 94) 33)
- (+ (mod ethiocode 94) 33)))
-
-(defun ethio-char-to-ethiocode (ch)
- (and (eq (char-charset ch) 'ethiopic)
- (let ((char-components (split-char ch)))
- (+ (* (- (nth 1 char-components) 33) 94)
- (- (nth 2 char-components) 33)))))
+ (if (and (string= consonant "'") (= vowel ?W))
+ (insert ?á§)
+ (save-restriction
+ (narrow-to-region (point) (point))
+ (insert consonant vowel)
+ (robin-convert-region (point-min) (point-max) "ethiopic-sera"))))))
+
+(defun ethio-get-consonant (ch)
+ "Return the consonant part of CH's SERA spelling in ethiopic-sera."
+ (let ((sera (get-char-code-property ch 'ethiopic-sera)))
+ (cond
+ ((null sera) nil)
+ ((= ch ?á§) "'") ; Only this has two vowel letters.
+ (t (with-temp-buffer
+ (insert sera)
+ (if (memq (preceding-char) '(?e ?u ?i ?a ?o ?E ?I ?A ?'))
+ (delete-char -1))
+ (buffer-substring (point-min) (point-max)))))))
;;
;; space replacement
@@ -1532,14 +704,14 @@
"Replace ASCII spaces with Ethiopic word separators in the region.
In the specified region, replace word separators surrounded by two
-Ethiopic characters, depending on the first parameter CH, which should
+Ethiopic characters, depending on the first argument CH, which should
be 1, 2, or 3.
If CH = 1, word separator will be replaced with an ASCII space.
If CH = 2, with two ASCII spaces.
If CH = 3, with the Ethiopic colon-like word separator.
-The second and third parameters BEGIN and END specify the region."
+The 2nd and 3rd arguments BEGIN and END specify the region."
(interactive "*cReplace spaces to: 1 (sg col), 2 (dbl col), 3 (Ethiopic)\nr")
(if (not (memq ch '(?1 ?2 ?3)))
@@ -1552,61 +724,62 @@
((= ch ?1)
;; an Ethiopic word separator --> an ASCII space
(goto-char (point-min))
- (while (search-forward "$(3$h(B" nil t)
- (replace-match " " nil t))
+ (while (search-forward "á¡" nil t)
+ (replace-match " "))
;; two ASCII spaces between Ethiopic characters --> an ASCII space
(goto-char (point-min))
(while (re-search-forward "\\(\\ce\\) \\(\\ce\\)" nil t)
(replace-match "\\1 \\2")
- (goto-char (match-beginning 2))))
+ (forward-char -1)))
((= ch ?2)
;; An Ethiopic word separator --> two ASCII spaces
(goto-char (point-min))
- (while (search-forward "$(3$h(B" nil t)
+ (while (search-forward "á¡" nil t)
(replace-match " "))
;; An ASCII space between Ethiopic characters --> two ASCII spaces
(goto-char (point-min))
(while (re-search-forward "\\(\\ce\\) \\(\\ce\\)" nil t)
(replace-match "\\1 \\2")
- (goto-char (match-beginning 2))))
+ (forward-char -1)))
(t
;; One or two ASCII spaces between Ethiopic characters
;; --> An Ethiopic word separator
(goto-char (point-min))
(while (re-search-forward "\\(\\ce\\) ?\\(\\ce\\)" nil t)
- (replace-match "\\1$(3$h(B\\2")
- (goto-char (match-beginning 2)))
+ (replace-match "\\1á¡\\2")
+ (forward-char -1))
;; Three or more ASCII spaces between Ethiopic characters
;; --> An Ethiopic word separator + (N - 2) ASCII spaces
(goto-char (point-min))
- (while (re-search-forward "\\(\\ce\\) \\( *\\ce\\)" nil t)
- (replace-match "\\1$(3$h(B\\2")
- (goto-char (match-beginning 2))))))))
+ (while (re-search-forward "\\(\\ce\\) \\( +\\ce\\)" nil t)
+ (replace-match "\\1á¡\\2")
+ (forward-char -1)))))))
;;
;; special icons
;;
+;; This function is deprecated.
;;;###autoload
(defun ethio-input-special-character (arg)
- "Allow the user to input special characters."
- (interactive "*cInput number: 1.$(3%j(B 2.$(3%k(B 3.$(3%l(B
4.$(3%m(B 5.$(3%i(B")
+ "This function is deprecated."
+ (interactive "*cInput number: 1.ö 2.ö 3.ö 4.ö 5.ö ")
(cond
((= arg ?1)
- (insert "$(3%j(B"))
+ (insert "ö "))
((= arg ?2)
- (insert "$(3%k(B"))
+ (insert "ö "))
((= arg ?3)
- (insert "$(3%l(B"))
+ (insert "ö "))
((= arg ?4)
- (insert "$(3%m(B"))
+ (insert "ö "))
((= arg ?5)
- (insert "$(3%i(B"))
+ (insert "ö "))
(t
(error ""))))
@@ -1614,120 +787,49 @@
;; TeX support
;;
-(defconst ethio-fidel-to-tex-map
- [ "heG" "huG" "hiG" "haG" "hEG" "hG" "hoG" "" ;; 0 - 7
- "leG" "luG" "liG" "laG" "lEG" "lG" "loG" "lWaG" ;; 8
- "HeG" "HuG" "HiG" "HaG" "HEG" "HG" "HoG" "HWaG" ;; 16
- "meG" "muG" "miG" "maG" "mEG" "mG" "moG" "mWaG" ;; 24
- "sseG" "ssuG" "ssiG" "ssaG" "ssEG" "ssG" "ssoG" "ssWaG" ;; 32
- "reG" "ruG" "riG" "raG" "rEG" "rG" "roG" "rWaG" ;; 40
- "seG" "suG" "siG" "saG" "sEG" "sG" "soG" "sWaG" ;; 48
- "xeG" "xuG" "xiG" "xaG" "xEG" "xG" "xoG" "xWaG" ;; 56
- "qeG" "quG" "qiG" "qaG" "qEG" "qG" "qoG" "" ;; 64
- "qWeG" "" "qWiG" "qWaG" "qWEG" "qWG" "" "" ;; 72
- "QeG" "QuG" "QiG" "QaG" "QEG" "QG" "QoG" "" ;; 80
- "QWeG" "" "QWiG" "QWaG" "QWEG" "QWG" "" "" ;; 88
- "beG" "buG" "biG" "baG" "bEG" "bG" "boG" "bWaG" ;; 96
- "veG" "vuG" "viG" "vaG" "vEG" "vG" "voG" "vWaG" ;; 104
- "teG" "tuG" "tiG" "taG" "tEG" "tG" "toG" "tWaG" ;; 112
- "ceG" "cuG" "ciG" "caG" "cEG" "cG" "coG" "cWaG" ;; 120
- "hheG" "hhuG" "hhiG" "hhaG" "hhEG" "hhG" "hhoG" "" ;; 128
- "hWeG" "" "hWiG" "hWaG" "hWEG" "hWG" "" "" ;; 136
- "neG" "nuG" "niG" "naG" "nEG" "nG" "noG" "nWaG" ;; 144
- "NeG" "NuG" "NiG" "NaG" "NEG" "NG" "NoG" "NWaG" ;; 152
- "eG" "uG" "iG" "AG" "EG" "IG" "oG" "eaG" ;; 160
- "keG" "kuG" "kiG" "kaG" "kEG" "kG" "koG" "" ;; 168
- "kWeG" "" "kWiG" "kWaG" "kWEG" "kWG" "" "" ;; 176
- "KeG" "KuG" "KiG" "KaG" "KEG" "KG" "KoG" "" ;; 184
- "KWeG" "" "KWiG" "KWaG" "KWEG" "KWG" "" "" ;; 192
- "weG" "wuG" "wiG" "waG" "wEG" "wG" "woG" "" ;; 200
- "eeG" "uuG" "iiG" "aaG" "EEG" "IIG" "ooG" "" ;; 208
- "zeG" "zuG" "ziG" "zaG" "zEG" "zG" "zoG" "zWaG" ;; 216
- "ZeG" "ZuG" "ZiG" "ZaG" "ZEG" "ZG" "ZoG" "ZWaG" ;; 224
- "yeG" "yuG" "yiG" "yaG" "yEG" "yG" "yoG" "yWaG" ;; 232
- "deG" "duG" "diG" "daG" "dEG" "dG" "doG" "dWaG" ;; 240
- "DeG" "DuG" "DiG" "DaG" "DEG" "DG" "DoG" "DWaG" ;; 248
- "jeG" "juG" "jiG" "jaG" "jEG" "jG" "joG" "jWaG" ;; 256
- "geG" "guG" "giG" "gaG" "gEG" "gG" "goG" "" ;; 264
- "gWeG" "" "gWiG" "gWaG" "gWEG" "gWG" "" "" ;; 272
- "GeG" "GuG" "GiG" "GaG" "GEG" "GG" "GoG" "GWaG" ;; 280
- "TeG" "TuG" "TiG" "TaG" "TEG" "TG" "ToG" "TWaG" ;; 288
- "CeG" "CuG" "CiG" "CaG" "CEG" "CG" "CoG" "CWaG" ;; 296
- "PeG" "PuG" "PiG" "PaG" "PEG" "PG" "PoG" "PWaG" ;; 304
- "SeG" "SuG" "SiG" "SaG" "SEG" "SG" "SoG" "SWaG" ;; 312
- "SSeG" "SSuG" "SSiG" "SSaG" "SSEG" "SSG" "SSoG" "" ;; 320
- "feG" "fuG" "fiG" "faG" "fEG" "fG" "foG" "fWaG" ;; 328
- "peG" "puG" "piG" "paG" "pEG" "pG" "poG" "pWaG" ;; 336
- "mYaG" "rYaG" "fYaG" "" "" "" "" "" ;; 344
- "" "spaceG" "periodG" "commaG" ;; 352
- "semicolonG" "colonG" "precolonG" "oldqmarkG" ;; 356
- "pbreakG" "andG" "huletG" "sostG" "aratG" "amstG" "sadstG" "sabatG" ;; 360
- "smntG" "zeteNG" "asrG" "heyaG" "selasaG" "arbaG" "hemsaG" "slsaG" ;; 368
- "sebaG" "semanyaG" "zeTanaG" "metoG" "asrxiG" "" "" "" ;; 376
- "qqeG" "qquG" "qqiG" "qqaG" "qqEG" "qqG" "qqoG" "" ;; 384
- "mWeG" "bWeG" "GWeG" "fWeG" "pWeG" "" "" "" ;; 392
- "kkeG" "kkuG" "kkiG" "kkaG" "kkEG" "kkG" "kkoG" "" ;; 400
- "mWiG" "bWiG" "GWiG" "fWiG" "pWiG" "" "" "" ;; 408
- "XeG" "XuG" "GXiG" "XaG" "XEG" "XG" "XoG" "" ;; 416
- "mWEG" "bWEG" "GWEG" "fWEG" "pWEG" "" "" "" ;; 424
- "ggeG" "gguG" "ggiG" "ggaG" "ggEG" "ggG" "ggoG" "" ;; 432
- "mWG" "bWG" "GWG" "fWG" "pWG" "" "" "" ;; 440
- "ornamentG" "flandG" "iflandG" "africaG" ;; 448
- "iafricaG" "wWeG" "wWiG" "wWaG" ;; 452
- "wWEG" "wWG" "" "slaqG" "dotG" "lquoteG" "rquoteG" "qmarkG" ]) ;; 456
-
-;;
-;; To make tex-to-fidel mapping.
-;; The following code makes
-;; (get 'ethio-tex-command-he 'ethio-fidel-char) ==> ?$(3!!(B
-;; etc.
-;;
-
-(let ((i 0) str)
- (while (< i (length ethio-fidel-to-tex-map))
- (setq str (aref ethio-fidel-to-tex-map i))
- (if (not (string= str ""))
- (put
- (intern (concat "ethio-tex-command-" (aref ethio-fidel-to-tex-map i)))
- 'ethio-fidel-char
- (ethio-ethiocode-to-char i)))
- (setq i (1+ i))))
-
;;;###autoload
(defun ethio-fidel-to-tex-buffer nil
- "Convert each fidel characters in the current buffer into a fidel-tex
command.
-Each command is always surrounded by braces."
+ "Convert each fidel characters in the current buffer into a fidel-tex
command."
(interactive)
- (let ((buffer-read-only nil))
+ (let ((buffer-read-only nil)
+ comp ch)
- ;; Isolated gemination marks need special treatement
+ ;; Special treatment for geminated characters.
+ ;; Geminated characters la", etc. change into \geminateG{\laG}, etc.
(goto-char (point-min))
- (while (search-forward "$(3%s(B" nil t)
- (replace-match "\\geminateG{}" t t))
-
- ;; First, decompose geminations
- ;; Here we assume that each composed character consists of
- ;; one Ethiopic character and the Ethiopic gemination mark.
- (decompose-region (point-min) (point-max))
+ (while (re-search-forward "á\\|ö " nil t)
+ (setq comp (find-composition (match-beginning 0)))
+ (if (null comp)
+ (replace-match "\\\\geminateG{}" t)
+ (decompose-region (car comp) (cadr comp))
+ (delete-char -1)
+ (forward-char -1)
+ (insert "\\geminateG{")
+ (forward-char 1)
+ (insert "}")))
- ;; Special treatment for geminated characters
- ;; The geminated character (la'') will be "\geminateG{\la}".
+ ;; Special Ethiopic punctuations.
(goto-char (point-min))
- (while (search-forward "$(3%s(B" nil t)
- (delete-backward-char 1)
- (backward-char 1)
- (insert "\\geminateG")
- (forward-char 1))
+ (while (re-search-forward "\\ce[»\\.\\?]\\|«\\ce" nil t)
+ (cond
+ ((= (setq ch (preceding-char)) ?\»)
+ (delete-char -1)
+ (insert "\\rquoteG"))
+ ((= ch ?.)
+ (delete-char -1)
+ (insert "\\dotG"))
+ ((= ch ??)
+ (delete-char -1)
+ (insert "\\qmarkG"))
+ (t
+ (forward-char -1)
+ (delete-char -1)
+ (insert "\\lquoteG")
+ (forward-char 1))))
;; Ethiopic characters to TeX macros
- (goto-char (point-min))
- (while (re-search-forward "\\ce" nil t)
- (insert
- "{\\"
- (aref ethio-fidel-to-tex-map
- (prog1 (ethio-char-to-ethiocode (preceding-char))
- (backward-delete-char 1)))
- "}"))
+ (robin-invert-region (point-min) (point-max) "ethiopic-tex")
+
(goto-char (point-min))
(set-buffer-modified-p nil)))
@@ -1738,43 +840,18 @@
(let ((buffer-read-only nil)
(p) (ch))
- ;; Special treatment for gemination
- ;; "\geminateG{\la}" or "\geminateG{{\la}}" will be "\la$(3%s(B"
- ;; "\geminateG{}" remains unchanged.
- (goto-char (point-min))
- (while (re-search-forward "\\\\geminateG{\\(\\\\[a-zA-Z]+\\)}" nil t)
- (replace-match "\\1$(3%s(B"))
-
;; TeX macros to Ethiopic characters
- (goto-char (point-min))
- (while (search-forward "\\" nil t)
- (setq p (point))
- (skip-chars-forward "a-zA-Z")
- (setq ch
- (get (intern (concat "ethio-tex-command-"
- (buffer-substring p (point))))
- 'ethio-fidel-char))
- (if ch
- (progn
- (delete-region (1- p) (point)) ; don't forget the preceding "\"
- (if (and (= (preceding-char) ?{)
- (= (following-char) ?}))
- (progn
- (backward-delete-char 1)
- (delete-char 1)))
- (insert ch))))
+ (robin-convert-region (point-min) (point-max) "ethiopic-tex")
;; compose geminated characters
(goto-char (point-min))
- (while (re-search-forward "\\ce$(3%s(B" nil 0)
- (compose-region
- (save-excursion (backward-char 2) (point))
- (point)))
+ (while (re-search-forward "\\\\geminateG{\\(\\ce?\\)}" nil t)
+ (replace-match "\\1á"))
- ;; Now it's time to convert isolated gemination marks.
+ ;; remove redundant braces, if any
(goto-char (point-min))
- (while (search-forward "\\geminateG{}" nil t)
- (replace-match "$(3%s(B"))
+ (while (re-search-forward "{\\(\\ce\\)}" nil t)
+ (replace-match "\\1"))
(goto-char (point-min))
(set-buffer-modified-p nil)))
@@ -1794,47 +871,24 @@
Otherwise, [0-9A-F]."
(let ((ucode))
- ;; first, decompose geminations
- (decompose-region (point-min) (point-max))
-
(goto-char (point-min))
- (while (re-search-forward "\\ce" nil t)
- (setq ucode (+ ?\x1200 (ethio-char-to-ethiocode (preceding-char))))
- (if (> ucode ?\x13bc)
- (setq ucode (+ ucode 59952)))
+ (while (re-search-forward "[á-á¼]" nil t)
+ (setq ucode (preceding-char))
(delete-backward-char 1)
- (if ethio-java-save-lowercase
- (insert (format "\\u%4x" ucode))
- (insert (upcase (format "\\u%4x" ucode)))))))
+ (insert
+ (format (if ethio-java-save-lowercase "\\u%4x" "\\u%4X")
+ ucode)))))
;;;###autoload
(defun ethio-java-to-fidel-buffer nil
"Convert the Java escape sequences into corresponding Ethiopic characters."
- (let ((ucode))
- (goto-char (point-min))
- (while (re-search-forward
"\\\\u\\([0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]\\)" nil t)
- (setq ucode
- (read
- (concat
- "?\\x"
- (buffer-substring (match-beginning 1) (match-end 1)))))
- (cond
- ((and (>= ucode ?\x1200) (<= ucode ?\x13bc))
- (replace-match "")
- (insert (ethio-ethiocode-to-char (- ucode ?\x1200))))
- ((and (>= ucode ?\xfdf1) (<= ucode ?\xfdff))
- (replace-match "")
- (insert (ethio-ethiocode-to-char (- ucode 64560))))
- (t
- nil)))
-
- ;; gemination
+ (let ((case-fold-search t)
+ (ucode))
(goto-char (point-min))
- (while (re-search-forward "\\ce$(3%s(B" nil 0)
- (compose-region
- (save-excursion (backward-char 2) (point))
- (point)))
- ))
+ (while (re-search-forward "\\\\u\\([0-9a-f][0-9a-f][0-9a-f][0-9a-f]\\)"
nil t)
+ (setq ucode (read (concat "#x" (match-string 1))))
+ (when (and (>= ucode #x1200) (<= ucode #x137f))
+ (replace-match (char-to-string ucode))))))
;;
;; file I/O hooks
@@ -1842,7 +896,7 @@
;;;###autoload
(defun ethio-find-file nil
- "Transcribe file content into Ethiopic depending on filename suffix."
+ "Transliterate file content into Ethiopic dependig on filename suffix."
(cond
((string-match "\\.sera$" (buffer-file-name))
@@ -1855,10 +909,10 @@
(save-excursion
(ethio-sera-to-fidel-marker 'force)
(goto-char (point-min))
- (while (re-search-forward "&[lr]aquote;" nil t)
+ (while (re-search-forward "&[lr]aquo;" nil t)
(if (= (char-after (1+ (match-beginning 0))) ?l)
- (replace-match "$(3%v(B")
- (replace-match "$(3%w(B")))
+ (replace-match "«")
+ (replace-match "»")))
(set-buffer-modified-p nil))))
((string-match "\\.tex$" (buffer-file-name))
@@ -1876,7 +930,7 @@
;;;###autoload
(defun ethio-write-file nil
- "Transcribe Ethiopic characters in ASCII depending on the file extension."
+ "Transliterate Ethiopic characters in ASCII depending on the file extension."
(cond
((string-match "\\.sera$" (buffer-file-name))
@@ -1888,17 +942,14 @@
((string-match "\\.html$" (buffer-file-name))
(save-excursion
- (let ((ethio-sera-being-called-by-w3 t)
- (lq (aref ethio-fidel-to-sera-map 461))
- (rq (aref ethio-fidel-to-sera-map 462)))
- (aset ethio-fidel-to-sera-map 461 "«te;")
- (aset ethio-fidel-to-sera-map 462 "»te;")
+ (let ((ethio-sera-being-called-by-w3 t))
(ethio-fidel-to-sera-marker 'force)
(goto-char (point-min))
+ (while (re-search-forward "[«»]" nil t)
+ (replace-match (if (= (preceding-char) ?«) "«" "»")))
+ (goto-char (point-min))
(if (search-forward "<sera>" nil t)
(ethio-record-user-preference))
- (aset ethio-fidel-to-sera-map 461 lq)
- (aset ethio-fidel-to-sera-map 462 rq)
(set-buffer-modified-p nil))))
((string-match "\\.tex$" (buffer-file-name))
@@ -1915,11 +966,8 @@
nil)))
(defun ethio-record-user-preference nil
- (if (looking-at "\\\\~\\(tir?\\|amh?\\) ")
- (goto-char (match-end 0))
- (insert (if (ethio-prefer-amharic-p) "\\~amh " "\\~tir ")))
(insert (if ethio-use-colon-for-colon "\\~-: " "\\~`: ")
- (if ethio-use-three-dot-question "\\~`| " "\\~`? ")))
+ (if ethio-use-three-dot-question "\\~`| " "\\~? ")))
;;
;; Ethiopic word separator vs. ASCII space
@@ -1932,10 +980,7 @@
"Toggle ASCII space and Ethiopic separator for keyboard input."
(interactive)
(setq ethio-prefer-ascii-space
- (not ethio-prefer-ascii-space))
- (if (equal current-input-method "ethiopic")
- (setq current-input-method-title (quail-title)))
- (force-mode-line-update))
+ (not ethio-prefer-ascii-space)))
(defun ethio-insert-space (arg)
"Insert ASCII spaces or Ethiopic word separators depending on context.
@@ -1958,68 +1003,1080 @@
((save-excursion
(skip-chars-backward " ")
(memq (preceding-char)
- '(?$(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)))
+ '(?á¡ ?ᢠ?ᣠ?ᤠ?ᥠ?ᦠ?᧠?ᨠ?ö ?ö ?ö ?ö
?ö )))
(insert-char 32 arg))
(t
- (insert-char ?$(3$h(B arg))))
+ (insert-char ?á¡ arg))))
+;;;###autoload
(defun ethio-insert-ethio-space (arg)
"Insert the Ethiopic word delimiter (the colon-like character).
With ARG, insert that many delimiters."
(interactive "*p")
- (insert-char ?$(3$h(B arg))
-
-;;
-;; Ethiopic punctuation vs. ASCII punctuation
-;;
-
-(defvar ethio-prefer-ascii-punctuation nil)
-(make-variable-buffer-local 'ethio-prefer-ascii-punctuation)
-
-(defun ethio-toggle-punctuation nil
- "Toggle Ethiopic punctuations and ASCII punctuations for keyboard input."
- (interactive)
- (setq ethio-prefer-ascii-punctuation
- (not ethio-prefer-ascii-punctuation))
- (let* ((keys '("." ".." "..." "," ",," ";" ";;" ":" "::" ":::" "*" "**"))
- (puncs
- (if ethio-prefer-ascii-punctuation
- '(?. [".."] ["..."] ?, [",,"] ?\; [";;"] ?: ["::"] [":::"] ?*
["**"])
- '(?$(3$i(B ?$(3%u(B ?. ?$(3$j(B ?, ?$(3$k(B ?\; ?$(3$h(B
?$(3$i(B ?: ?* ?$(3$o(B))))
- (while keys
- (quail-defrule (car keys) (car puncs) "ethiopic")
- (setq keys (cdr keys)
- puncs (cdr puncs)))
- (if (equal current-input-method "ethiopic")
- (setq current-input-method-title (quail-title)))
- (force-mode-line-update)))
+ (insert-char ?á¡ arg))
;;
;; Gemination
;;
+;;;###autoload
+(defun ethio-composition-function (pos to font-object string)
+ (setq pos (1- pos))
+ (let ((pattern "\\ce\\(á\\|ö \\)"))
+ (if string
+ (if (and (>= pos 0)
+ (eq (string-match pattern string pos) pos))
+ (prog1 (match-end 0)
+ (compose-string string pos (match-end 0))))
+ (if (>= pos (point-min))
+ (progn
+ (goto-char pos)
+ (if (looking-at pattern)
+ (prog1 (match-end 0)
+ (compose-region pos (match-end 0)))))))))
+
+;; This function is not used any more.
(defun ethio-gemination nil
"Compose the character before the point with the Ethiopic gemination mark.
If the character is already composed, decompose it and remove the gemination
mark."
(interactive "*")
+ (let ((ch (preceding-char)))
(cond
- ((eq (char-charset (preceding-char)) 'ethiopic)
- (insert "$(3%s(B")
- (compose-region
- (save-excursion (backward-char 2) (point))
- (point))
- (forward-char 1))
- ((eq (char-charset (preceding-char)) 'leading-code-composition)
- (decompose-region
- (save-excursion (backward-char 1) (point))
- (point))
- (delete-backward-char 1))
+ ((and (= ch ?ö ) (find-composition (1- (point))))
+ (decompose-region (- (point) 2) (point)))
+ ((and (>= ch #x1200) (<= ch #x137f))
+ (insert "ö ")
+ (compose-region (- (point) 2) (point)))
(t
- (error ""))))
+ (error "")))))
+
+;;;
+;;; Robin packages
+;;;
+
+(robin-define-package "ethiopic-sera"
+ "SERA transliteration system for Ethiopic."
+
+ ("he" ?á)
+ ("hu" ?á)
+ ("hi" ?á)
+ ("ha" ?á)
+ ("hE" ?á) ("hee" "á")
+ ("h" ?á
)
+ ("ho" ?á)
+
+ ("le" ?á) ("Le" "á")
+ ("lu" ?á) ("Lu" "á")
+ ("li" ?á) ("Li" "á")
+ ("la" ?á) ("La" "á")
+ ("lE" ?á) ("LE" "á") ("lee" "á") ("Lee" "á")
+ ("l" ?á) ("L" "á")
+ ("lo" ?á) ("Lo" "á")
+ ("lWa" ?á) ("LWa" "á") ("lW" "á") ("LW" "á")
+
+ ("He" ?á)
+ ("Hu" ?á)
+ ("Hi" ?á)
+ ("Ha" ?á)
+ ("HE" ?á) ("Hee" "á")
+ ("H" ?á)
+ ("Ho" ?á)
+ ("HWa" ?á) ("HW" "á")
+
+ ("me" ?á) ("Me" "á")
+ ("mu" ?á) ("Mu" "á")
+ ("mi" ?á) ("Mi" "á")
+ ("ma" ?á) ("Ma" "á")
+ ("mE" ?á) ("ME" "á") ("mee" "á") ("Mee" "á")
+ ("m" ?á) ("M" "á")
+ ("mo" ?á) ("Mo" "á")
+ ("mWa" ?á) ("MWa" "á") ("mW" "á") ("MW" "á")
+
+ ("`se" ?á ) ("sse" "á ") ("s2e" "á ")
+ ("`su" ?á¡) ("ssu" "á¡") ("s2u" "á¡")
+ ("`si" ?á¢) ("ssi" "á¢") ("s2i" "á¢")
+ ("`sa" ?á£) ("ssa" "á£") ("s2a" "á£")
+ ("`sE" ?á¤) ("ssE" "á¤") ("s2E" "á¤")
+ ("`see" "á¤") ("ssee" "á¤") ("s2ee" "á¤")
+ ("`s" ?á¥) ("ss" "á¥") ("s2" "á¥")
+ ("`so" ?á¦) ("sso" "á¦") ("s2o" "á¦")
+ ("`sWa" ?á§) ("ssWa" "á§") ("s2Wa" "á§")
+ ("`sW" "á§") ("ssW" "á§") ("s2W" "á§")
+
+ ("re" ?á¨) ("Re" "á¨")
+ ("ru" ?á©) ("Ru" "á©")
+ ("ri" ?áª) ("Ri" "áª")
+ ("ra" ?á«) ("Ra" "á«")
+ ("rE" ?á¬) ("RE" "á¬") ("ree" "á¬") ("Ree" "á¬")
+ ("r" ?á) ("R" "á")
+ ("ro" ?á®) ("Ro" "á®")
+ ("rWa" ?á¯) ("RWa" "á¯") ("rW" "á¯") ("RW" "á¯")
+
+ ("se" ?á°)
+ ("su" ?á±)
+ ("si" ?á²)
+ ("sa" ?á³)
+ ("sE" ?á´) ("see" "á´")
+ ("s" ?áµ)
+ ("so" ?á¶)
+ ("sWa" ?á·) ("sW" "á·")
+
+ ("xe" ?á¸)
+ ("xu" ?á¹)
+ ("xi" ?áº)
+ ("xa" ?á»)
+ ("xE" ?á¼) ("xee" "á¼")
+ ("x" ?á½)
+ ("xo" ?á¾)
+ ("xWa" ?á¿) ("xW" "á¿")
+
+ ("qe" ?á)
+ ("qu" ?á)
+ ("qi" ?á)
+ ("qa" ?á)
+ ("qE" ?á) ("qee" "á")
+ ("q" ?á
)
+ ("qo" ?á)
+ ("qWe" ?á)
+ ("qWi" ?á)
+ ("qWa" ?á) ("qW" "á")
+ ("qWE" ?á) ("qWee" "á")
+ ("qW'" ?á) ("qWu" "á")
+
+ ("Qe" ?á)
+ ("Qu" ?á)
+ ("Qi" ?á)
+ ("Qa" ?á)
+ ("QE" ?á) ("Qee" "á")
+ ("Q" ?á)
+ ("Qo" ?á)
+ ("QWe" ?á)
+ ("QWi" ?á)
+ ("QWa" ?á) ("QW" "á")
+ ("QWE" ?á) ("QWee" "á")
+ ("QW'" ?á) ("QWu" "á")
+
+ ("be" ?á ) ("Be" "á ")
+ ("bu" ?á¡) ("Bu" "á¡")
+ ("bi" ?á¢) ("Bi" "á¢")
+ ("ba" ?á£) ("Ba" "á£")
+ ("bE" ?á¤) ("BE" "á¤") ("bee" "á¤") ("Bee" "á¤")
+ ("b" ?á¥) ("B" "á¥")
+ ("bo" ?á¦) ("Bo" "á¦")
+ ("bWa" ?á§) ("BWa" "á§") ("bW" "á§") ("BW" "á§")
+
+ ("ve" ?á¨) ("Ve" "á¨")
+ ("vu" ?á©) ("Vu" "á©")
+ ("vi" ?áª) ("Vi" "áª")
+ ("va" ?á«) ("Va" "á«")
+ ("vE" ?á¬) ("VE" "á¬") ("vee" "á¬") ("Vee" "á¬")
+ ("v" ?á) ("V" "á")
+ ("vo" ?á®) ("Vo" "á®")
+ ("vWa" ?á¯) ("VWa" "á¯") ("vW" "á¯") ("VW" "á¯")
+
+ ("te" ?á°)
+ ("tu" ?á±)
+ ("ti" ?á²)
+ ("ta" ?á³)
+ ("tE" ?á´) ("tee" "á´")
+ ("t" ?áµ)
+ ("to" ?á¶)
+ ("tWa" ?á·) ("tW" "á·")
+
+ ("ce" ?á¸)
+ ("cu" ?á¹)
+ ("ci" ?áº)
+ ("ca" ?á»)
+ ("cE" ?á¼) ("cee" "á¼")
+ ("c" ?á½)
+ ("co" ?á¾)
+ ("cWa" ?á¿) ("cW" "á¿")
+
+ ("`he" ?á) ("hhe" "á") ("h2e" "á")
+ ("`hu" ?á) ("hhu" "á") ("h2u" "á")
+ ("`hi" ?á) ("hhi" "á") ("h2i" "á")
+ ("`ha" ?á) ("hha" "á") ("h2a" "á")
+ ("`hE" ?á) ("hhE" "á") ("h2E" "á")
+ ("`hee" "á") ("hhee" "á") ("h2ee" "á")
+ ("`h" ?á
) ("hh" "á
") ("h2" "á
")
+ ("`ho" ?á) ("hho" "á") ("h2o" "á")
+ ("`hWe" ?á) ("hhWe" "á") ("h2We" "á") ("hWe" "á")
+ ("`hWi" ?á) ("hhWi" "á") ("h2Wi" "á") ("hWi" "á")
+ ("`hWa" ?á) ("hhWa" "á") ("h2Wa" "á") ("hWa" "á")
+ ("`hW" "á") ("hhW" "á") ("h2W" "á")
+ ("`hWE" ?á) ("hhWE" "á") ("h2WE" "á") ("hWE" "á")
+ ("`hWee" "á") ("hhWee" "á") ("h2Wee" "á") ("hWee" "á")
+ ("`hW'" ?á) ("hhW'" "á") ("h2W'" "á") ("hW'" "á")
+ ("`hWu" "á") ("hhWu" "á") ("h2Wu" "á") ("hWu" "á")
+
+ ("ne" ?á)
+ ("nu" ?á)
+ ("ni" ?á)
+ ("na" ?á)
+ ("nE" ?á) ("nee" "á")
+ ("n" ?á)
+ ("no" ?á)
+ ("nWa" ?á) ("nW" "á")
+
+ ("Ne" ?á)
+ ("Nu" ?á)
+ ("Ni" ?á)
+ ("Na" ?á)
+ ("NE" ?á) ("Nee" "á")
+ ("N" ?á)
+ ("No" ?á)
+ ("NWa" ?á) ("NW" "á")
+
+ ("'A" ?á ) ("A" "á ")
+ ("'u" ?á¡) ("u" "á¡") ("'U" "á¡") ("U" "á¡")
+ ("'i" ?á¢) ("i" "á¢")
+ ("'a" ?á£) ("a" "á£")
+ ("'E" ?á¤) ("E" "á¤")
+ ("'I" ?á¥) ("I" "á¥") ("'e" "á¥") ("e" "á¥")
+ ("'o" ?á¦) ("o" "á¦") ("'O" "á¦") ("O" "á¦")
+ ("'ea" ?á§) ("ea" "á§")
+
+ ("ke" ?á¨)
+ ("ku" ?á©)
+ ("ki" ?áª)
+ ("ka" ?á«)
+ ("kE" ?á¬) ("kee" "á¬")
+ ("k" ?á)
+ ("ko" ?á®)
+ ("kWe" ?á°)
+ ("kWi" ?á²)
+ ("kWa" ?á³) ("kW" "á³")
+ ("kWE" ?á´) ("kWee" "á´")
+ ("kW'" ?áµ) ("kWu" "áµ")
+
+ ("Ke" ?á¸)
+ ("Ku" ?á¹)
+ ("Ki" ?áº)
+ ("Ka" ?á»)
+ ("KE" ?á¼) ("Kee" "á¼")
+ ("K" ?á½)
+ ("Ko" ?á¾)
+ ("KWe" ?á)
+ ("KWi" ?á)
+ ("KWa" ?á) ("KW" "á")
+ ("KWE" ?á) ("KWee" "á")
+ ("KW'" ?á
) ("KWu" "á
")
+
+ ("we" ?á)
+ ("wu" ?á)
+ ("wi" ?á)
+ ("wa" ?á)
+ ("wE" ?á) ("wee" "á")
+ ("w" ?á)
+ ("wo" ?á)
+
+ ("`e" ?á) ("ae" "á") ("aaa" "á") ("e2" "á")
+ ("`u" ?á) ("uu" "á") ("u2" "á") ("`U" "á") ("UU" "á") ("U2" "á")
+ ("`i" ?á) ("ii" "á") ("i2" "á")
+ ("`a" ?á) ("aa" "á") ("a2" "á") ("`A" "á") ("AA" "á") ("A2" "á")
+ ("`E" ?á) ("EE" "á") ("E2" "á")
+ ("`I" ?á) ("II" "á") ("I2" "á") ("ee" "á")
+ ("`o" ?á) ("oo" "á") ("o2" "á") ("`O" "á") ("OO" "á") ("O2" "á")
+
+ ("ze" ?á)
+ ("zu" ?á)
+ ("zi" ?á)
+ ("za" ?á)
+ ("zE" ?á) ("zee" "á")
+ ("z" ?á)
+ ("zo" ?á)
+ ("zWa" ?á) ("zW" "á")
+
+ ("Ze" ?á )
+ ("Zu" ?á¡)
+ ("Zi" ?á¢)
+ ("Za" ?á£)
+ ("ZE" ?á¤) ("Zee" "á¤")
+ ("Z" ?á¥)
+ ("Zo" ?á¦)
+ ("ZWa" ?á§) ("ZW" "á§")
+
+ ("ye" ?á¨) ("Ye" "á¨")
+ ("yu" ?á©) ("Yu" "á©")
+ ("yi" ?áª) ("Yi" "áª")
+ ("ya" ?á«) ("Ya" "á«")
+ ("yE" ?á¬) ("YE" "á¬") ("yee" "á¬") ("Yee" "á¬")
+ ("y" ?á) ("Y" "á")
+ ("yo" ?á®) ("Yo" "á®")
+
+ ("de" ?á°)
+ ("du" ?á±)
+ ("di" ?á²)
+ ("da" ?á³)
+ ("dE" ?á´) ("dee" "á´")
+ ("d" ?áµ)
+ ("do" ?á¶)
+ ("dWa" ?á·) ("dW" "á·")
+
+ ("De" ?á¸)
+ ("Du" ?á¹)
+ ("Di" ?áº)
+ ("Da" ?á»)
+ ("DE" ?á¼) ("Dee" "á¼")
+ ("D" ?á½)
+ ("Do" ?á¾)
+ ("DWa" ?á¿) ("DW" "á¿")
+
+ ("je" ?á) ("Je" "á")
+ ("ju" ?á) ("Ju" "á")
+ ("ji" ?á) ("Ji" "á")
+ ("ja" ?á) ("Ja" "á")
+ ("jE" ?á) ("JE" "á") ("jee" "á") ("Jee" "á")
+ ("j" ?á
) ("J" "á
")
+ ("jo" ?á) ("Jo" "á")
+ ("jWa" ?á) ("jW" "á") ("JWa" "á") ("JW" "á")
+
+ ("ge" ?á)
+ ("gu" ?á)
+ ("gi" ?á)
+ ("ga" ?á)
+ ("gE" ?á) ("gee" "á")
+ ("g" ?á)
+ ("go" ?á)
+ ("gWe" ?á)
+ ("gWi" ?á)
+ ("gWa" ?á) ("gW" "á")
+ ("gWE" ?á) ("gWee" "á")
+ ("gW'" ?á) ("gWu" "á")
+
+ ("Ge" ?á)
+ ("Gu" ?á)
+ ("Gi" ?á)
+ ("Ga" ?á)
+ ("GE" ?á) ("Gee" "á")
+ ("G" ?á)
+ ("Go" ?á)
+
+ ("Te" ?á )
+ ("Tu" ?á¡)
+ ("Ti" ?á¢)
+ ("Ta" ?á£)
+ ("TE" ?á¤) ("Tee" "á¤")
+ ("T" ?á¥)
+ ("To" ?á¦)
+ ("TWa" ?á§) ("TW" "á§")
+
+ ("Ce" ?á¨)
+ ("Cu" ?á©)
+ ("Ci" ?áª)
+ ("Ca" ?á«)
+ ("CE" ?á¬) ("Cee" "á¬")
+ ("C" ?á)
+ ("Co" ?á®)
+ ("CWa" ?á¯) ("CW" "á¯")
+
+ ("Pe" ?á°)
+ ("Pu" ?á±)
+ ("Pi" ?á²)
+ ("Pa" ?á³)
+ ("PE" ?á´) ("Pee" "á´")
+ ("P" ?áµ)
+ ("Po" ?á¶)
+ ("PWa" ?á·) ("PW" "á·")
+
+ ("Se" ?á¸)
+ ("Su" ?á¹)
+ ("Si" ?áº)
+ ("Sa" ?á»)
+ ("SE" ?á¼) ("See" "á¼")
+ ("S" ?á½)
+ ("So" ?á¾)
+ ("SWa" ?á¿) ("`SWa" "á¿") ("SSWa" "á¿") ("S2Wa" "á¿")
+ ("SW" "á¿") ("`SW" "á¿") ("SSW" "á¿") ("S2W" "á¿")
+
+ ("`Se" ?á) ("SSe" "á") ("S2e" "á")
+ ("`Su" ?á) ("SSu" "á") ("S2u" "á")
+ ("`Si" ?á) ("SSi" "á") ("S2i" "á")
+ ("`Sa" ?á) ("SSa" "á") ("S2a" "á")
+ ("`SE" ?á) ("SSE" "á") ("S2E" "á")
+ ("`See" "á") ("SSee" "á") ("S2ee" "á")
+ ("`S" ?á
) ("SS" "á
") ("S2" "á
")
+ ("`So" ?á) ("SSo" "á") ("S2o" "á")
+
+ ("fe" ?á) ("Fe" "á")
+ ("fu" ?á) ("Fu" "á")
+ ("fi" ?á) ("Fi" "á")
+ ("fa" ?á) ("Fa" "á")
+ ("fE" ?á) ("FE" "á") ("fee" "á") ("Fee" "á")
+ ("f" ?á) ("F" "á")
+ ("fo" ?á) ("Fo" "á")
+ ("fWa" ?á) ("FWa" "á") ("fW" "á") ("FW" "á")
+
+ ("pe" ?á)
+ ("pu" ?á)
+ ("pi" ?á)
+ ("pa" ?á)
+ ("pE" ?á) ("pee" "á")
+ ("p" ?á)
+ ("po" ?á)
+ ("pWa" ?á) ("pW" "á")
+
+ ("rYa" ?á) ("RYa" "á") ("rY" "á") ("RY" "á")
+ ("mYa" ?á) ("MYa" "á") ("mY" "á") ("MY" "á")
+ ("fYa" ?á) ("FYa" "á") ("fY" "á") ("FY" "á")
+
+ (" : " ?á¡) (":" "á¡") ("`:" "á¡")
+ ("::" ?á¢) ("." "á¢")
+ ("," ?á£)
+ (";" ?á¤)
+ ("-:" ?á¥)
+ (":-" ?á¦)
+ ("`?" ?á§) ("??" "á§")
+ (":|:" ?á¨) ("**" "á¨")
+
+ ;; Explicit syllable delimiter
+ ("'" "")
+
+ ;; Quick ASCII input
+ ("''" "'")
+ (":::" ":")
+ (".." ".")
+ (",," ",")
+ (";;" ";")
+
+ ("`1" ?á©)
+ ("`2" ?áª)
+ ("`3" ?á«)
+ ("`4" ?á¬)
+ ("`5" ?á)
+ ("`6" ?á®)
+ ("`7" ?á¯)
+ ("`8" ?á°)
+ ("`9" ?á±)
+ ("`10" ?á²)
+ ("`20" ?á³)
+ ("`30" ?á´)
+ ("`40" ?áµ)
+ ("`50" ?á¶)
+ ("`60" ?á·)
+ ("`70" ?á¸)
+ ("`80" ?á¹)
+ ("`90" ?áº)
+ ("`100" ?á»)
+ ("`10000" ?á¼)
+
+ ("`200" "áªá»")
+ ("`300" "á«á»")
+ ("`400" "á¬á»")
+ ("`500" "áá»")
+ ("`600" "á®á»")
+ ("`700" "á¯á»")
+ ("`800" "á°á»")
+ ("`900" "á±á»")
+ ("`1000" "á²á»")
+ ("`2000" "á³á»")
+ ("`3000" "á´á»")
+ ("`4000" "áµá»")
+ ("`5000" "á¶á»")
+ ("`6000" "á·á»")
+ ("`7000" "á¸á»")
+ ("`8000" "á¹á»")
+ ("`9000" "áºá»")
+ ("`20000" "áªá¼")
+ ("`30000" "á«á¼")
+ ("`40000" "á¬á¼")
+ ("`50000" "áá¼")
+ ("`60000" "á®á¼")
+ ("`70000" "á¯á¼")
+ ("`80000" "á°á¼")
+ ("`90000" "á±á¼")
+ ("`100000" "á²á¼")
+ ("`200000" "á³á¼")
+ ("`300000" "á´á¼")
+ ("`400000" "áµá¼")
+ ("`500000" "á¶á¼")
+ ("`600000" "á·á¼")
+ ("`700000" "á¸á¼")
+ ("`800000" "á¹á¼")
+ ("`900000" "áºá¼")
+ ("`1000000" "á»á¼")
+ )
+
+(register-input-method
+ "ethiopic-sera" "Ethiopic"
+ 'robin-use-package "et" "An input method for Ethiopic.")
+
+(robin-define-package "ethiopic-tex"
+ "TeX transliteration system for Ethiopic."
+
+ ("\\heG" ?á) ; U+1200 ..
+ ("\\huG" ?á)
+ ("\\hiG" ?á)
+ ("\\haG" ?á)
+ ("\\hEG" ?á)
+ ("\\hG" ?á
)
+ ("\\hoG" ?á)
+ ;; reserved
+ ("\\leG" ?á)
+ ("\\luG" ?á)
+ ("\\liG" ?á)
+ ("\\laG" ?á)
+ ("\\lEG" ?á)
+ ("\\lG" ?á)
+ ("\\loG" ?á)
+ ("\\lWaG" ?á)
+
+ ("\\HeG" ?á) ; U+1210 ..
+ ("\\HuG" ?á)
+ ("\\HiG" ?á)
+ ("\\HaG" ?á)
+ ("\\HEG" ?á)
+ ("\\HG" ?á)
+ ("\\HoG" ?á)
+ ("\\HWaG" ?á)
+ ("\\meG" ?á)
+ ("\\muG" ?á)
+ ("\\miG" ?á)
+ ("\\maG" ?á)
+ ("\\mEG" ?á)
+ ("\\mG" ?á)
+ ("\\moG" ?á)
+ ("\\mWaG" ?á)
+
+ ("\\sseG" ?á ) ; U+1220 ..
+ ("\\ssuG" ?á¡)
+ ("\\ssiG" ?á¢)
+ ("\\ssaG" ?á£)
+ ("\\ssEG" ?á¤)
+ ("\\ssG" ?á¥)
+ ("\\ssoG" ?á¦)
+ ("\\ssWaG" ?á§)
+ ("\\reG" ?á¨)
+ ("\\ruG" ?á©)
+ ("\\riG" ?áª)
+ ("\\raG" ?á«)
+ ("\\rEG" ?á¬)
+ ("\\rG" ?á)
+ ("\\roG" ?á®)
+ ("\\rWaG" ?á¯)
+
+ ("\\seG" ?á°) ; U+1230 ..
+ ("\\suG" ?á±)
+ ("\\siG" ?á²)
+ ("\\saG" ?á³)
+ ("\\sEG" ?á´)
+ ("\\sG" ?áµ)
+ ("\\soG" ?á¶)
+ ("\\sWaG" ?á·)
+ ("\\xeG" ?á¸)
+ ("\\xuG" ?á¹)
+ ("\\xiG" ?áº)
+ ("\\xaG" ?á»)
+ ("\\xEG" ?á¼)
+ ("\\xG" ?á½)
+ ("\\xoG" ?á¾)
+ ("\\xWaG" ?á¿)
+
+ ("\\qeG" ?á) ; U+1240 ..
+ ("\\quG" ?á)
+ ("\\qiG" ?á)
+ ("\\qaG" ?á)
+ ("\\qEG" ?á)
+ ("\\qG" ?á
)
+ ("\\qoG" ?á)
+ ;; reserved
+ ("\\qWeG" ?á)
+ ;; reserved
+ ("\\qWiG" ?á)
+ ("\\qWaG" ?á)
+ ("\\qWEG" ?á)
+ ("\\qWG" ?á)
+ ;; reserved
+ ;; reserved
+
+ ("\\QeG" ?á) ; U+1250 ..
+ ("\\QuG" ?á)
+ ("\\QiG" ?á)
+ ("\\QaG" ?á)
+ ("\\QEG" ?á)
+ ("\\QG" ?á)
+ ("\\QoG" ?á)
+ ;; reserved
+ ("\\QWeG" ?á)
+ ;; reserved
+ ("\\QWiG" ?á)
+ ("\\QWaG" ?á)
+ ("\\QWEG" ?á)
+ ("\\QWG" ?á)
+ ;; reserved
+ ;; reserved
+
+ ("\\beG" ?á ) ; U+1260 ..
+ ("\\buG" ?á¡)
+ ("\\biG" ?á¢)
+ ("\\baG" ?á£)
+ ("\\bEG" ?á¤)
+ ("\\bG" ?á¥)
+ ("\\boG" ?á¦)
+ ("\\bWaG" ?á§)
+ ("\\veG" ?á¨)
+ ("\\vuG" ?á©)
+ ("\\viG" ?áª)
+ ("\\vaG" ?á«)
+ ("\\vEG" ?á¬)
+ ("\\vG" ?á)
+ ("\\voG" ?á®)
+ ("\\vWaG" ?á¯)
+
+ ("\\teG" ?á°) ; U+1270 ..
+ ("\\tuG" ?á±)
+ ("\\tiG" ?á²)
+ ("\\taG" ?á³)
+ ("\\tEG" ?á´)
+ ("\\tG" ?áµ)
+ ("\\toG" ?á¶)
+ ("\\tWaG" ?á·)
+ ("\\ceG" ?á¸)
+ ("\\cuG" ?á¹)
+ ("\\ciG" ?áº)
+ ("\\caG" ?á»)
+ ("\\cEG" ?á¼)
+ ("\\cG" ?á½)
+ ("\\coG" ?á¾)
+ ("\\cWaG" ?á¿)
+
+ ("\\hheG" ?á) ; U+1280 ..
+ ("\\hhuG" ?á)
+ ("\\hhiG" ?á)
+ ("\\hhaG" ?á)
+ ("\\hhEG" ?á)
+ ("\\hhG" ?á
)
+ ("\\hhoG" ?á)
+ ;; reserved
+ ("\\hWeG" ?á)
+ ;; reserved
+ ("\\hWiG" ?á)
+ ("\\hWaG" ?á)
+ ("\\hWEG" ?á)
+ ("\\hWG" ?á)
+ ;; reserved
+ ;; reserved
+
+ ("\\neG" ?á) ; U+1290 ..
+ ("\\nuG" ?á)
+ ("\\niG" ?á)
+ ("\\naG" ?á)
+ ("\\nEG" ?á)
+ ("\\nG" ?á)
+ ("\\noG" ?á)
+ ("\\nWaG" ?á)
+ ("\\NeG" ?á)
+ ("\\NuG" ?á)
+ ("\\NiG" ?á)
+ ("\\NaG" ?á)
+ ("\\NEG" ?á)
+ ("\\NG" ?á)
+ ("\\NoG" ?á)
+ ("\\NWaG" ?á)
+
+ ("\\eG" ?á ) ; U+12A0 ..
+ ("\\uG" ?á¡)
+ ("\\iG" ?á¢)
+ ("\\AG" ?á£)
+ ("\\EG" ?á¤)
+ ("\\IG" ?á¥)
+ ("\\oG" ?á¦)
+ ("\\eaG" ?á§)
+ ("\\keG" ?á¨)
+ ("\\kuG" ?á©)
+ ("\\kiG" ?áª)
+ ("\\kaG" ?á«)
+ ("\\kEG" ?á¬)
+ ("\\kG" ?á)
+ ("\\koG" ?á®)
+ ;; reserved
+
+ ("\\kWeG" ?á°) ; U+12B0 ..
+ ;; reserved
+ ("\\kWiG" ?á²)
+ ("\\kWaG" ?á³)
+ ("\\kWEG" ?á´)
+ ("\\kWG" ?áµ)
+ ;; reserved
+ ;; reserved
+ ("\\KeG" ?á¸)
+ ("\\KuG" ?á¹)
+ ("\\KiG" ?áº)
+ ("\\KaG" ?á»)
+ ("\\KEG" ?á¼)
+ ("\\KG" ?á½)
+ ("\\KoG" ?á¾)
+ ;; reserved
+
+ ("\\KWeG" ?á) ; U+12C0 ..
+ ;; reserved
+ ("\\KWiG" ?á)
+ ("\\KWaG" ?á)
+ ("\\KWEG" ?á)
+ ("\\KWG" ?á
)
+ ;; reserved
+ ;; reserved
+ ("\\weG" ?á)
+ ("\\wuG" ?á)
+ ("\\wiG" ?á)
+ ("\\waG" ?á)
+ ("\\wEG" ?á)
+ ("\\wG" ?á)
+ ("\\woG" ?á)
+ ;; reserved
+
+ ("\\eeG" ?á) ; U+12D0 ..
+ ("\\uuG" ?á)
+ ("\\iiG" ?á)
+ ("\\aaG" ?á)
+ ("\\EEG" ?á)
+ ("\\IIG" ?á)
+ ("\\ooG" ?á)
+ ;; reserved
+ ("\\zeG" ?á)
+ ("\\zuG" ?á)
+ ("\\ziG" ?á)
+ ("\\zaG" ?á)
+ ("\\zEG" ?á)
+ ("\\zG" ?á)
+ ("\\zoG" ?á)
+ ("\\zWaG" ?á)
+
+ ("\\ZeG" ?á ) ; U+12E0 ..
+ ("\\ZuG" ?á¡)
+ ("\\ZiG" ?á¢)
+ ("\\ZaG" ?á£)
+ ("\\ZEG" ?á¤)
+ ("\\ZG" ?á¥)
+ ("\\ZoG" ?á¦)
+ ("\\ZWaG" ?á§)
+ ("\\yeG" ?á¨)
+ ("\\yuG" ?á©)
+ ("\\yiG" ?áª)
+ ("\\yaG" ?á«)
+ ("\\yEG" ?á¬)
+ ("\\yG" ?á)
+ ("\\yoG" ?á®)
+ ;; reserved
+
+ ("\\deG" ?á°) ; U+12F0 ..
+ ("\\duG" ?á±)
+ ("\\diG" ?á²)
+ ("\\daG" ?á³)
+ ("\\dEG" ?á´)
+ ("\\dG" ?áµ)
+ ("\\doG" ?á¶)
+ ("\\dWaG" ?á·)
+ ("\\DeG" ?á¸)
+ ("\\DuG" ?á¹)
+ ("\\DiG" ?áº)
+ ("\\DaG" ?á»)
+ ("\\DEG" ?á¼)
+ ("\\DG" ?á½)
+ ("\\DoG" ?á¾)
+ ("\\DWaG" ?á¿)
+
+ ("\\jeG" ?á) ; U+1300 ..
+ ("\\juG" ?á)
+ ("\\jiG" ?á)
+ ("\\jaG" ?á)
+ ("\\jEG" ?á)
+ ("\\jG" ?á
)
+ ("\\joG" ?á)
+ ("\\jWaG" ?á)
+ ("\\geG" ?á)
+ ("\\guG" ?á)
+ ("\\giG" ?á)
+ ("\\gaG" ?á)
+ ("\\gEG" ?á)
+ ("\\gG" ?á)
+ ("\\goG" ?á)
+ ;; reserved
+
+ ("\\gWeG" ?á) ; U+1310 ..
+ ;; reserved
+ ("\\gWiG" ?á)
+ ("\\gWaG" ?á)
+ ("\\gWEG" ?á)
+ ("\\gWG" ?á)
+ ;; reserved
+ ;; reserved
+ ("\\GeG" ?á)
+ ("\\GuG" ?á)
+ ("\\GiG" ?á)
+ ("\\GaG" ?á)
+ ("\\GEG" ?á)
+ ("\\GG" ?á)
+ ("\\GoG" ?á)
+ ;; reserved
+
+ ("\\TeG" ?á ) ; U+1320 ..
+ ("\\TuG" ?á¡)
+ ("\\TiG" ?á¢)
+ ("\\TaG" ?á£)
+ ("\\TEG" ?á¤)
+ ("\\TG" ?á¥)
+ ("\\ToG" ?á¦)
+ ("\\TWaG" ?á§)
+ ("\\CeG" ?á¨)
+ ("\\CuG" ?á©)
+ ("\\CiG" ?áª)
+ ("\\CaG" ?á«)
+ ("\\CEG" ?á¬)
+ ("\\CG" ?á)
+ ("\\CoG" ?á®)
+ ("\\CWaG" ?á¯)
+
+ ("\\PeG" ?á°) ; U+1330 ..
+ ("\\PuG" ?á±)
+ ("\\PiG" ?á²)
+ ("\\PaG" ?á³)
+ ("\\PEG" ?á´)
+ ("\\PG" ?áµ)
+ ("\\PoG" ?á¶)
+ ("\\PWaG" ?á·)
+ ("\\SeG" ?á¸)
+ ("\\SuG" ?á¹)
+ ("\\SiG" ?áº)
+ ("\\SaG" ?á»)
+ ("\\SEG" ?á¼)
+ ("\\SG" ?á½)
+ ("\\SoG" ?á¾)
+ ("\\SWaG" ?á¿)
+
+ ("\\SSeG" ?á) ; U+1340 ..
+ ("\\SSuG" ?á)
+ ("\\SSiG" ?á)
+ ("\\SSaG" ?á)
+ ("\\SSEG" ?á)
+ ("\\SSG" ?á
)
+ ("\\SSoG" ?á)
+ ;; reserved
+ ("\\feG" ?á)
+ ("\\fuG" ?á)
+ ("\\fiG" ?á)
+ ("\\faG" ?á)
+ ("\\fEG" ?á)
+ ("\\fG" ?á)
+ ("\\foG" ?á)
+ ("\\fWaG" ?á)
+
+ ("\\peG" ?á) ; U+1350 ..
+ ("\\puG" ?á)
+ ("\\piG" ?á)
+ ("\\paG" ?á)
+ ("\\pEG" ?á)
+ ("\\pG" ?á)
+ ("\\poG" ?á)
+ ("\\pWaG" ?á)
+ ("\\mYaG" ?á)
+ ("\\rYaG" ?á)
+ ("\\fYaG" ?á)
+ ;; reserved
+ ;; reserved
+ ;; reserved
+ ;; reserved
+ ;; reserved
+
+ ;; reserved ; U+1360 ..
+ ("\\spaceG" ?á¡)
+ ("\\periodG" ?á¢)
+ ("\\commaG" ?á£)
+ ("\\semicolonG" ?á¤)
+ ("\\colonG" ?á¥)
+ ("\\precolonG" ?á¦)
+ ("\\oldqmarkG" ?á§)
+ ("\\pbreakG" ?á¨)
+ ("\\andG" ?á©)
+ ("\\huletG" ?áª)
+ ("\\sostG" ?á«)
+ ("\\aratG" ?á¬)
+ ("\\amstG" ?á)
+ ("\\sadstG" ?á®)
+ ("\\sabatG" ?á¯)
+
+ ("\\smntG" ?á°) ; U+1370 ..
+ ("\\zeteNG" ?á±)
+ ("\\asrG" ?á²)
+ ("\\heyaG" ?á³)
+ ("\\selasaG" ?á´)
+ ("\\arbaG" ?áµ)
+ ("\\hemsaG" ?á¶)
+ ("\\slsaG" ?á·)
+ ("\\sebaG" ?á¸)
+ ("\\semanyaG" ?á¹)
+ ("\\zeTanaG" ?áº)
+ ("\\metoG" ?á»)
+ ("\\asrxiG" ?á¼)
+ ;; reserved
+ ;; reserved
+ ;; reserved
+
+ ;;
+ ;; private extension
+ ;;
+
+ ("\\yWaG" ?ö ¯) ; U+1A00EF (was U+12EF)
+
+ ("\\GWaG" ?ö ) ; U+1A011F (was U+131F)
+
+ ("\\qqeG" ?ö ) ; U+1A0180 .. (was U+1380 ..)
+ ("\\qquG" ?ö )
+ ("\\qqiG" ?ö )
+ ("\\qqaG" ?ö )
+ ("\\qqEG" ?ö )
+ ("\\qqG" ?ö
)
+ ("\\qqoG" ?ö )
+ ;; unused
+ ("\\MWeG" ?ö )
+ ("\\bWeG" ?ö )
+ ("\\GWeG" ?ö )
+ ("\\fWeG" ?ö )
+ ("\\pWeG" ?ö )
+ ;; unused
+ ;; unused
+ ;; unused
+
+ ("\\kkeG" ?ö ) ; U+1A0190 .. (was U+1390 ..)
+ ("\\kkuG" ?ö )
+ ("\\kkiG" ?ö )
+ ("\\kkaG" ?ö )
+ ("\\kkEG" ?ö )
+ ("\\kkG" ?ö )
+ ("\\kkoG" ?ö )
+ ;; unused
+ ("\\mWiG" ?ö )
+ ("\\bWiG" ?ö )
+ ("\\GWiG" ?ö )
+ ("\\fWiG" ?ö )
+ ("\\pWiG" ?ö )
+ ;; unused
+ ;; unused
+ ;; unused
+
+ ("\\XeG" ?ö ) ; U+1A01A0 .. (was U+13A0 ..)
+ ("\\XuG" ?ö ¡)
+ ("\\XiG" ?ö ¢)
+ ("\\XaG" ?ö £)
+ ("\\XEG" ?ö ¤)
+ ("\\XG" ?ö ¥)
+ ("\\XoG" ?ö ¦)
+ ;; unused
+ ("\\mWEG" ?ö ¨)
+ ("\\bWEG" ?ö ©)
+ ("\\GWEG" ?ö ª)
+ ("\\fWEG" ?ö «)
+ ("\\pWEG" ?ö ¬)
+ ;; unused
+ ;; unused
+ ;; unused
+
+ ("\\ggeG" ?ö °) ; U+1A01B0 .. (was U+13B0 ..)
+ ("\\gguG" ?ö ±)
+ ("\\ggiG" ?ö ²)
+ ("\\ggaG" ?ö ³)
+ ("\\ggEG" ?ö ´)
+ ("\\ggG" ?ö µ)
+ ("\\ggoG" ?ö ¶)
+ ;; unused
+ ("\\mWG" ?ö ¸)
+ ("\\bWG" ?ö ¹)
+ ("\\GWG" ?ö º)
+ ("\\fWG" ?ö »)
+ ("\\pWG" ?ö ¼)
+ ;; unused
+ ;; unused
+ ;; unused
+
+ ("\\ornamentG" ?ö ) ; U+1A01C0 .. (was U+FDF0 ..)
+ ("\\flandG" ?ö )
+ ("\\iflandG" ?ö )
+ ("\\africaG" ?ö )
+ ("\\iafricaG" ?ö )
+ ("\\wWeG" ?ö
)
+ ("\\wWiG" ?ö )
+ ("\\wWaG" ?ö )
+ ("\\wWEG" ?ö )
+ ("\\wWG" ?ö )
+ ;; Gemination (ö ) is handled in a special way.
+ ("\\slaqG" ?ö )
+
+ ;; Assign reverse conversion to Fidel chars.
+ ;; Then override forward conversion with ASCII chars.
+ ;; ASCII chars should not have reverse conversions.
+ ("\\dotG" ?ö ) ("\\dotG" ".")
+ ("\\lquoteG" ?ö ) ("\\lquoteG" "«")
+ ("\\rquoteG" ?ö ) ("\\rquoteG" "»")
+ ("\\qmarkG" ?ö ) ("\\qmarkG" "?")
+
+ ;;
+ ;; New characters in Unicode 4.1.
+ ;;
+ ;; In forward conversion, these characters override the old private
+ ;; extensions above. The old private extensions still keep their
+ ;; reverse conversion.
+ ;;
+
+ ("\\ornamentG" ?á )
+ ("\\yWaG" ?á¯)
+ ("\\GWaG" ?á)
+ ("\\MWeG" ?á)
+ ("\\mWiG" ?á)
+ ("\\mWEG" ?á)
+ ("\\mWG" ?á)
+ ("\\bWeG" ?á)
+ ("\\bWiG" ?á
)
+ ("\\bWEG" ?á)
+ ("\\bWG" ?á)
+ ("\\fWeG" ?á)
+ ("\\fWiG" ?á)
+ ("\\fWEG" ?á)
+ ("\\fWG" ?á)
+ ("\\pWeG" ?á)
+ ("\\pWiG" ?á)
+ ("\\pWEG" ?á)
+ ("\\pWG" ?á)
+ ("\\GWeG" ?â¶)
+ ("\\GWiG" ?â¶)
+ ("\\GWEG" ?â¶)
+ ("\\GWG" ?â¶)
+ ("\\qqeG" ?â·)
+ ("\\qquG" ?â·)
+ ("\\qqiG" ?â·)
+ ("\\qqaG" ?â·)
+ ("\\qqEG" ?â·)
+ ("\\qqG" ?â·
)
+ ("\\qqoG" ?â·)
+ ("\\kkeG" ?â·)
+ ("\\kkuG" ?â·)
+ ("\\kkiG" ?â·)
+ ("\\kkaG" ?â·)
+ ("\\kkEG" ?â·)
+ ("\\kkG" ?â·)
+ ("\\kkoG" ?â·)
+ ("\\XeG" ?â·)
+ ("\\XuG" ?â·)
+ ("\\XiG" ?â·)
+ ("\\XaG" ?â·)
+ ("\\XEG" ?â·)
+ ("\\XG" ?â·)
+ ("\\XoG" ?â·)
+ ("\\ggeG" ?â·)
+ ("\\gguG" ?â·)
+ ("\\ggiG" ?â·)
+ ("\\ggaG" ?â·)
+ ("\\ggEG" ?â·)
+ ("\\ggG" ?â·)
+ ("\\ggoG" ?â·)
+ )
+
+;; The ethiopic-tex package is not used for keyboard input, therefore
+;; not registered with the register-input-method function.
-;;
(provide 'ethio-util)
+;;; ethio-util.el ends here
+
;;; arch-tag: c8feb3d6-39bf-4b0a-b6ef-26f03fbc8140
;;; ethio-util.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/language/ethio-util.el,v,
Miles Bader <=