159
|
1 ;;; ethiopic.el --- Support for Ethiopic
|
|
2
|
|
3 ;; Copyright (C) 1995 Free Software Foundation, Inc.
|
|
4 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
|
165
|
5 ;; Copyright (C) 1997 MORIOKA Tomohiko
|
159
|
6
|
|
7 ;; Keywords: multilingual, Ethiopic
|
|
8
|
165
|
9 ;; This file is part of XEmacs.
|
159
|
10
|
165
|
11 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
12 ;; under the terms of the GNU General Public License as published by
|
159
|
13 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
14 ;; any later version.
|
|
15
|
165
|
16 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
19 ;; General Public License for more details.
|
159
|
20
|
|
21 ;; You should have received a copy of the GNU General Public License
|
165
|
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
24 ;; 02111-1307, USA.
|
159
|
25
|
|
26 ;; Author: TAKAHASHI Naoto <ntakahas@etl.go.jp>
|
165
|
27 ;; modified by MORIOKA Tomohiko <morioka@jaist.ac.jp> for XEmacs.
|
159
|
28
|
|
29 ;;; Code:
|
|
30
|
165
|
31 ;; Ethiopic
|
|
32 (make-charset 'ethiopic "Ethiopic"
|
|
33 '(registry "Ethio"
|
|
34 dimension 2
|
|
35 chars 94
|
|
36 final ?3
|
|
37 graphic 0
|
|
38 ))
|
|
39
|
|
40 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
41 ;;; ETHIOPIC
|
|
42 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
43
|
|
44 (define-category ?E "Ethiopic (Ge'ez) character.")
|
|
45 (modify-category-entry 'ethiopic ?E)
|
|
46
|
|
47 ;; (define-ccl-program ccl-encode-ethio-font
|
|
48 ;; '(0
|
|
49 ;; ;; In: R0:ethiopic (not checked)
|
|
50 ;; ;; R1:position code 1
|
|
51 ;; ;; R2:position code 2
|
|
52 ;; ;; Out: R1:font code point 1
|
|
53 ;; ;; R2:font code point 2
|
|
54 ;; ((r1 -= 33)
|
|
55 ;; (r2 -= 33)
|
|
56 ;; (r1 *= 94)
|
|
57 ;; (r2 += r1)
|
|
58 ;; (if (r2 < 256)
|
|
59 ;; (r1 = ?\x12)
|
|
60 ;; (if (r2 < 448)
|
|
61 ;; ((r1 = ?\x13) (r2 -= 256))
|
|
62 ;; ((r1 = ?\xfd) (r2 -= 208))
|
|
63 ;; ))))
|
|
64 ;; "CCL program to encode an Ehitopic code to code point of Ehitopic font.")
|
159
|
65 (define-ccl-program ccl-encode-ethio-font
|
165
|
66 '(((r0 -= #x21)
|
|
67 (r1 -= #x21)
|
|
68 (r0 *= 94)
|
|
69 (r1 += r0)
|
|
70 (if (r1 < 256) (r0 = 0) ((r1 -= 256) (r0 = 1))))))
|
159
|
71
|
165
|
72 ;; (setq font-ccl-encoder-alist
|
|
73 ;; (cons (cons "ethiopic" ccl-encode-ethio-font) font-ccl-encoder-alist))
|
|
74 (set-charset-ccl-program 'ethiopic ccl-encode-ethio-font)
|
159
|
75
|
|
76 (register-input-method
|
|
77 "Ethiopic" '("quail-ethio" quail-use-package "quail/ethiopic"))
|
|
78
|
|
79 (defun setup-ethiopic-environment ()
|
|
80 "Setup multilingual environment for Ethiopic."
|
|
81 (interactive)
|
|
82 (setq primary-language "Ethiopic")
|
|
83
|
|
84 (setq default-input-method '("Ethiopic" . "quail-ethio"))
|
|
85
|
|
86 ;;
|
|
87 ;; key bindings
|
|
88 ;;
|
|
89 (define-key global-map [f4] 'sera-to-fidel-buffer)
|
|
90 (define-key global-map [S-f4] 'sera-to-fidel-region)
|
|
91 (define-key global-map [C-f4] 'sera-to-fidel-marker)
|
|
92 (define-key global-map [f5] 'fidel-to-sera-buffer)
|
|
93 (define-key global-map [S-f5] 'fidel-to-sera-region)
|
|
94 (define-key global-map [C-f5] 'fidel-to-sera-marker)
|
|
95 (define-key global-map [f6] 'ethio-modify-vowel)
|
|
96 (define-key global-map [f7] 'ethio-replace-space)
|
|
97 (define-key global-map [f8] 'ethio-input-special-character)
|
|
98 (define-key global-map [S-f2] 'ethio-replace-space) ; as requested
|
|
99
|
|
100 (add-hook
|
|
101 'rmail-mode-hook
|
|
102 '(lambda ()
|
|
103 (define-key rmail-mode-map [C-f4] 'sera-to-fidel-mail)
|
|
104 (define-key rmail-mode-map [C-f5] 'fidel-to-sera-mail)))
|
|
105
|
|
106 (add-hook
|
|
107 'mail-mode-hook
|
|
108 '(lambda ()
|
|
109 (define-key mail-mode-map [C-f4] 'sera-to-fidel-mail)
|
|
110 (define-key mail-mode-map [C-f5] 'fidel-to-sera-mail)))
|
|
111 )
|
|
112
|
|
113 (defun describe-ethiopic-support ()
|
|
114 "Describe how Emacs supports Ethiopic."
|
|
115 (interactive)
|
|
116 (describe-language-support-internal "Ethiopic"))
|
|
117
|
|
118 (set-language-info-alist
|
|
119 "Ethiopic" '((setup-function . setup-ethiopic-environment)
|
|
120 (describe-function . describe-ethiopic-support)
|
|
121 (charset . (ethiopic))
|
|
122 (sample-text . "$(3$O#U!.(B")
|
|
123 (documentation . nil)))
|
|
124
|
165
|
125 ;; for XEmacs (will be obsoleted)
|
|
126 (define-language-environment 'ethiopic
|
|
127 "Ethiopic"
|
|
128 #'(lambda ()
|
|
129 (setq-default quail-current-package
|
|
130 (assoc "ethio" quail-package-alist))))
|
|
131
|
159
|
132 ;;; ethiopic.el ends here
|