Mercurial > emacs
annotate lisp/language/indian.el @ 48983:72ee05ebcd06
Initial version.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 28 Dec 2002 21:22:23 +0000 |
parents | db70b6adccfa |
children | 003055ca7e13 |
rev | line source |
---|---|
41469 | 1 ;;; indian.el --- Indian languages support -*- coding: iso-2022-7bit; -*- |
17052 | 2 |
41469 | 3 ;; Copyright (C) 1999, 2001 Free Software Foundation, Inc. |
17052 | 4 |
41469 | 5 ;; Maintainer: KAWABATA, Taichi <batta@beige.ocn.ne.jp> |
42312 | 6 ;; Keywords: multilingual, i18n, Indian |
17052 | 7 |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
17314
f438ebf1c679
Fix FSF address in comment.
Kenichi Handa <handa@m17n.org>
parents:
17300
diff
changeset
|
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
f438ebf1c679
Fix FSF address in comment.
Kenichi Handa <handa@m17n.org>
parents:
17300
diff
changeset
|
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
f438ebf1c679
Fix FSF address in comment.
Kenichi Handa <handa@m17n.org>
parents:
17300
diff
changeset
|
23 ;; Boston, MA 02111-1307, USA. |
17052 | 24 |
25 ;;; Commentary: | |
26 | |
41469 | 27 ;; This file defines in-is13194 coding system and relationship between |
28 ;; indian-glyph character-set and various CDAC fonts. | |
17052 | 29 |
30 ;;; Code: | |
31 | |
41469 | 32 (make-coding-system |
33 'in-is13194 2 ?D | |
42152 | 34 "8-bit encoding for ASCII (MSB=0) and IS13194-Devanagari (MSB=1)." |
41469 | 35 '(ascii indian-is13194 nil nil |
36 nil ascii-eol) | |
46743
d341cac00baf
(in-is13194): Give correct `safe-chars' property.
Kenichi Handa <handa@m17n.org>
parents:
42312
diff
changeset
|
37 `((safe-chars . ,(let ((table (make-char-table 'safe-chars nil))) |
d341cac00baf
(in-is13194): Give correct `safe-chars' property.
Kenichi Handa <handa@m17n.org>
parents:
42312
diff
changeset
|
38 (set-char-table-range table 'indian-is13194 t) |
d341cac00baf
(in-is13194): Give correct `safe-chars' property.
Kenichi Handa <handa@m17n.org>
parents:
42312
diff
changeset
|
39 (dotimes (i 127) |
d341cac00baf
(in-is13194): Give correct `safe-chars' property.
Kenichi Handa <handa@m17n.org>
parents:
42312
diff
changeset
|
40 (aset table i t) |
d341cac00baf
(in-is13194): Give correct `safe-chars' property.
Kenichi Handa <handa@m17n.org>
parents:
42312
diff
changeset
|
41 (aset table (decode-char 'ucs (+ #x900 i)) t)) |
d341cac00baf
(in-is13194): Give correct `safe-chars' property.
Kenichi Handa <handa@m17n.org>
parents:
42312
diff
changeset
|
42 table)) |
41469 | 43 (post-read-conversion . in-is13194-post-read-conversion) |
44 (pre-write-conversion . in-is13194-pre-write-conversion))) | |
17052 | 45 |
46743
d341cac00baf
(in-is13194): Give correct `safe-chars' property.
Kenichi Handa <handa@m17n.org>
parents:
42312
diff
changeset
|
46 (define-coding-system-alias 'devanagari 'in-is13194) |
d341cac00baf
(in-is13194): Give correct `safe-chars' property.
Kenichi Handa <handa@m17n.org>
parents:
42312
diff
changeset
|
47 |
41469 | 48 (defvar indian-script-table |
49 '[ | |
50 devanagari | |
51 sanskrit | |
52 bengali | |
53 tamil | |
54 telugu | |
55 assamese | |
56 oriya | |
57 kannada | |
58 malayalam | |
59 gujarati | |
60 punjabi | |
61 ] | |
62 "Vector of Indian script names.") | |
17052 | 63 |
41469 | 64 (let ((len (length indian-script-table)) |
65 (i 0)) | |
66 (while (< i len) | |
67 (put (aref indian-script-table i) 'indian-glyph-code-offset (* 256 i)) | |
68 (setq i (1+ i)))) | |
17052 | 69 |
41469 | 70 (defvar indian-default-script 'devanagari |
71 "Default script for Indian languages. | |
72 Each Indian language environment sets this value | |
73 to one of `indian-script-table' (which see). | |
74 The default value is `devanagari'.") | |
17052 | 75 |
41469 | 76 (define-ccl-program ccl-encode-indian-glyph-font |
77 `(0 | |
78 ;; Shorten (r1 = (((((r1 - 32) * 96) + r2) - 32) % 256)) | |
79 (r1 = ((((r1 * 96) + r2) - ,(+ (* 32 96) 32)) % 256)))) | |
17052 | 80 |
41469 | 81 (setq font-ccl-encoder-alist |
82 (cons (cons "-CDAC" 'ccl-encode-indian-glyph-font) | |
83 font-ccl-encoder-alist)) | |
17052 | 84 |
33778 | 85 (provide 'indian) |
41469 | 86 |
17052 | 87 ;;; indian.el ends here |