annotate lisp/language/ethiopic.el @ 159:3bb7ccffb0c0 r20-3b6

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