Commit | Line | Data |
---|---|---|
d7136fd3 DL |
1 | ;;; subst-jis.el --- Unicode/JISX translation -*-coding: euc-jp;-*- |
2 | ;; Copyright (C) 2002 Free Software Foundation, Inc. | |
3 | ||
4 | ;; Author: Dave Love <fx@gnu.org> | |
5 | ;; Keywords: i18n | |
6 | ||
7 | ;; This file is free software; you can redistribute it and/or modify | |
8 | ;; it under the terms of the GNU General Public License as published by | |
9 | ;; the Free Software Foundation; either version 2, or (at your option) | |
10 | ;; any later version. | |
11 | ||
12 | ;; This file is distributed in the hope that it will be useful, | |
13 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | ;; GNU General Public License for more details. | |
16 | ||
17 | ;; You should have received a copy of the GNU General Public License | |
18 | ;; along with GNU Emacs; see the file COPYING. If not, write to | |
19 | ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
20 | ;; Boston, MA 02111-1307, USA. | |
21 | ||
22 | ;;; Commentary: | |
23 | ||
24 | ;; Provides translation tables between Unicode and | |
25 | ;; japanese-jisx0208/japanese-jisx0212 charsets for use by the | |
26 | ;; `utf-translate-cjk' option. | |
27 | ||
28 | ;;; Code: | |
29 | ||
30 | ;; Derived in Emacs 22 using | |
31 | ;; (map-charset-chars | |
32 | ;; (lambda (range arg) | |
33 | ;; (let ((i (car range)) | |
34 | ;; c) | |
35 | ;; (while (<= i (cdr range)) | |
36 | ;; (setq c (encode-char i 'ucs)) | |
37 | ;; (if c | |
38 | ;; (if (or (memq (char-syntax c) '(?\( ?\" ?\) ?\;)) | |
39 | ;; (insert "(" (format "#x%x ?\\%c" c c) ")\n") | |
40 | ;; (insert "(" (format "#x%x ?%c" c c) ")\n"))) | |
41 | ;; (setq i (1+ i)))))) | |
42 | ;; 'japanese-jisx0208) | |
43 | ;; and similarly. | |
44 | ||
45 | (mapc | |
46 | (lambda (pair) | |
47 | (let ((unicode (car pair)) | |
48 | (char (cadr pair))) | |
49 | ;; exclude non-CJK components from decode table | |
50 | (if (and (>= unicode #x2e80) (<= unicode #xd7a3)) | |
51 | (puthash unicode char ucs-unicode-to-mule-cjk)) | |
52 | (puthash char unicode ucs-mule-cjk-to-unicode))) | |
53 | '( | |
54 | ;; jisx0208 | |
55 |