annotate lisp/language/ethiopic.el @ 165:5a88923fcbfe r20-3b9

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