1 ;; mule-charsets.el -- Generate Mule-orignal charset maps.
2 ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
3 ;; National Institute of Advanced Industrial Science and Technology (AIST)
4 ;; Registration Number H13PRO009
6 ;; This file is part of GNU Emacs.
8 ;; GNU Emacs is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 3, or (at your option)
13 ;; GNU Emacs is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU Emacs; see the file COPYING. If not, write to the
20 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 ;; Boston, MA 02110-1301, USA.
23 (if (or (< emacs-major-version
21)
24 (< emacs-minor-version
3)
25 (and (= emacs-minor-version
3)
26 (string< emacs-version
"21.3.50")))
27 (error "Use Emacs of version 21.3.50 or later"))
29 (defun func (start end
)
31 (let ((split (split-char start
))
32 (unicode (encode-char start
'ucs
)))
35 (insert (format "0x%02X%02X 0x%04X\n"
36 (nth 1 split
) (nth 2 split
) unicode
))
37 (insert (format "0x%02X 0x%04X\n" (nth 1 split
) unicode
)))))
38 (setq start
(1+ start
))))
40 (defconst charset-alist
41 '(("MULE-ethiopic.map" . ethiopic
)
42 ("MULE-ipa.map" . ipa
)
43 ("MULE-is13194.map" . indian-is13194
)
44 ("MULE-sisheng.map" . chinese-sisheng
)
45 ("MULE-tibetan.map" . tibetan
)
46 ("MULE-lviscii.map" . vietnamese-viscii-lower
)
47 ("MULE-uviscii.map" . vietnamese-viscii-upper
)))
49 (setq file
(car command-line-args-left
))
51 (error "Invalid file name: %s" file
))
52 (setq charset
(cdr (assoc file charset-alist
)))
54 (error "Invalid charset: %s" (car command-line-args-left
)))
57 (map-charset-chars 'func charset
)
60 ;;; arch-tag: 515989d7-2e2d-41cc-9163-05ad472fede4