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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
41469
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
1 ;;; indian.el --- Indian languages support -*- coding: iso-2022-7bit; -*-
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
2
41469
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
3 ;; Copyright (C) 1999, 2001 Free Software Foundation, Inc.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4
41469
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
5 ;; Maintainer: KAWABATA, Taichi <batta@beige.ocn.ne.jp>
42312
c7ffa58f9637 Add keyword.
Pavel Janík <Pavel@Janik.cz>
parents: 42152
diff changeset
6 ;; Keywords: multilingual, i18n, Indian
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
13 ;; any later version.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
14
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
18 ;; GNU General Public License for more details.
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
19
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
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
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
24
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
25 ;;; Commentary:
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
26
41469
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
27 ;; This file defines in-is13194 coding system and relationship between
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
28 ;; indian-glyph character-set and various CDAC fonts.
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
29
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
30 ;;; Code:
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
31
41469
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
32 (make-coding-system
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
33 'in-is13194 2 ?D
42152
e3ae5ef41293 Improving doc strings.
Werner LEMBERG <wl@gnu.org>
parents: 42055
diff changeset
34 "8-bit encoding for ASCII (MSB=0) and IS13194-Devanagari (MSB=1)."
41469
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
35 '(ascii indian-is13194 nil nil
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
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
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
43 (post-read-conversion . in-is13194-post-read-conversion)
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
44 (pre-write-conversion . in-is13194-pre-write-conversion)))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
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
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
48 (defvar indian-script-table
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
49 '[
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
50 devanagari
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
51 sanskrit
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
52 bengali
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
53 tamil
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
54 telugu
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
55 assamese
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
56 oriya
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
57 kannada
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
58 malayalam
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
59 gujarati
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
60 punjabi
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
61 ]
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
62 "Vector of Indian script names.")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
63
41469
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
64 (let ((len (length indian-script-table))
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
65 (i 0))
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
66 (while (< i len)
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
67 (put (aref indian-script-table i) 'indian-glyph-code-offset (* 256 i))
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
68 (setq i (1+ i))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
69
41469
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
70 (defvar indian-default-script 'devanagari
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
71 "Default script for Indian languages.
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
72 Each Indian language environment sets this value
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
73 to one of `indian-script-table' (which see).
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
74 The default value is `devanagari'.")
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
75
41469
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
76 (define-ccl-program ccl-encode-indian-glyph-font
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
77 `(0
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
78 ;; Shorten (r1 = (((((r1 - 32) * 96) + r2) - 32) % 256))
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
79 (r1 = ((((r1 * 96) + r2) - ,(+ (* 32 96) 32)) % 256))))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
80
41469
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
81 (setq font-ccl-encoder-alist
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
82 (cons (cons "-CDAC" 'ccl-encode-indian-glyph-font)
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
83 font-ccl-encoder-alist))
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
84
33778
6d966e8b4bbe Use provide.
Dave Love <fx@gnu.org>
parents: 23158
diff changeset
85 (provide 'indian)
41469
f091948e4d1c Completely re-written.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
86
17052
d0d7b244b1d0 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
87 ;;; indian.el ends here