1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00
emacs/admin/charsets/cp51932.awk
Stefan Monnier 898a94a9be Use lexical-binding in the remaining preloaded files
* lisp/widget.el:
* lisp/w32-fns.el:
* lisp/textmodes/fill.el:
* lisp/term/common-win.el:
* lisp/scroll-bar.el:
* lisp/rfn-eshadow.el:
* lisp/menu-bar.el:
* lisp/language/tibetan.el:
* lisp/language/thai.el:
* lisp/language/misc-lang.el:
* lisp/language/lao.el:
* lisp/language/korean.el:
* lisp/language/japanese.el:
* lisp/language/indian.el:
* lisp/language/hebrew.el:
* lisp/language/european.el:
* lisp/language/ethiopic.el:
* lisp/language/english.el:
* lisp/language/cyrillic.el:
* lisp/language/chinese.el:
* lisp/jka-cmpr-hook.el:
* lisp/international/ucs-normalize.el:
* lisp/international/mule.el:
* lisp/international/mule-conf.el:
* lisp/international/iso-transl.el:
* lisp/international/fontset.el:
* lisp/international/characters.el:
* lisp/format.el:
* lisp/facemenu.el:
* lisp/electric.el:
* lisp/dos-w32.el:
* lisp/dos-fns.el:
* lisp/disp-table.el:
* lisp/cus-face.el:
* lisp/composite.el:
* lisp/bindings.el:
* admin/unidata/blocks.awk:
* admin/charsets/eucjp-ms.awk:
* admin/charsets/cp51932.awk: Use `lexical-binding`.
2021-01-04 20:57:42 -05:00

59 lines
2.0 KiB
Awk

# cp51932.awk -- Generate a translation table for CP51932.
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
# National Institute of Advanced Industrial Science and Technology (AIST)
# Registration Number H13PRO009
# This file is part of GNU Emacs.
# GNU Emacs is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# GNU Emacs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
# Commentary:
# Generate a translation table for CP51932 (EUC-JP of MicroSoft Version).
# It maps invalid JISX0208 code points used by CP51932 to Unicode.
# 4th field of the input has these meanings:
# 0: JISX0208 characters.
# 1: NEC special characters.
# 2: IBM extension characters.
# 3: NEC selection of IBM extension characters.
# Among them, 1 and 3 are the target characters. 2 should have
# already been mapped to 1 or 3.
BEGIN {
print ";;; cp51932.el -- translation table for CP51932 -*- lexical-binding:t -*-";
print ";;; Automatically generated from CP932-2BYTE.map";
print "(let ((map";
printf " '(;JISEXT<->UNICODE";
}
/# [13]/ {
printf "\n (#x%s . #x%s)", $5 ,substr($2, 3, 4);
}
END {
print ")))";
print " (setq map (mapcar (lambda (x)";
print " (cons (decode-char 'japanese-jisx0208 (car x))";
print " (cdr x)))";
print " map))";
print " (define-translation-table 'cp51932-decode map)";
print " (mapc (lambda (x)";
print " (let ((tmp (car x)))";
print " (setcar x (cdr x)) (setcdr x tmp)))";
print " map)";
print " (define-translation-table 'cp51932-encode map))";
print "";
print "(provide 'cp51932)";
}