aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2015-06-16 23:43:03 -0700
committerGlenn Morris2015-06-16 23:43:03 -0700
commitd67d49ceb31777cb731a56b9518bf1a1f2a94d25 (patch)
tree37aea7063e35326b069c12d9f4c16e5cf172d57f
parentc9e2003b44b446a2f994039d9fc73d387cf6a1df (diff)
downloademacs-d67d49ceb31777cb731a56b9518bf1a1f2a94d25.tar.gz
emacs-d67d49ceb31777cb731a56b9518bf1a1f2a94d25.zip
Generate char-script-table from Unicode source. (Bug#20789)
* admin/unidata/Makefile.in (AWK): New, set by configure. (all): Add charscript.el. (blocks): New variable. (charscript.el, ${unidir}/charscript.el): New targets. (extraclean): Also remove generated charscript.el. * admin/unidata/blocks.awk: New script. * admin/unidata/Blocks.txt: New data file, from unicode.org. * lisp/international/characters.el: Load charscript. * src/Makefile.in (charscript): New variable. (${charscript}): New target. (${lispintdir}/characters.elc): Depend on charscript.elc. (temacs$(EXEEXT)): Depend on charscript. ; * admin/unidata/README: Mention Blocks.txt. ; * .gitignore: Add lisp/international/charscript.el.
-rw-r--r--.gitignore1
-rw-r--r--admin/unidata/Blocks.txt298
-rw-r--r--admin/unidata/Makefile.in16
-rw-r--r--admin/unidata/README4
-rwxr-xr-xadmin/unidata/blocks.awk225
-rw-r--r--lisp/international/characters.el234
-rw-r--r--src/Makefile.in8
7 files changed, 554 insertions, 232 deletions
diff --git a/.gitignore b/.gitignore
index 092fd03fb64..1e2f2065581 100644
--- a/.gitignore
+++ b/.gitignore
@@ -195,6 +195,7 @@ admin/charsets/jisx2131-filter
195admin/unidata/unidata.txt 195admin/unidata/unidata.txt
196etc/charsets/*.map 196etc/charsets/*.map
197lisp/international/charprop.el 197lisp/international/charprop.el
198lisp/international/charscript.el
198lisp/international/cp51932.el 199lisp/international/cp51932.el
199lisp/international/eucjp-ms.el 200lisp/international/eucjp-ms.el
200lisp/international/uni-*.el 201lisp/international/uni-*.el
diff --git a/admin/unidata/Blocks.txt b/admin/unidata/Blocks.txt
new file mode 100644
index 00000000000..0a4a5807635
--- /dev/null
+++ b/admin/unidata/Blocks.txt
@@ -0,0 +1,298 @@
1# Blocks-8.0.0.txt
2# Date: 2014-11-10, 23:04:00 GMT [KW]
3#
4# Unicode Character Database
5# Copyright (c) 1991-2014 Unicode, Inc.
6# For terms of use, see http://www.unicode.org/terms_of_use.html
7# For documentation, see http://www.unicode.org/reports/tr44/
8#
9# Format:
10# Start Code..End Code; Block Name
11
12# ================================================
13
14# Note: When comparing block names, casing, whitespace, hyphens,
15# and underbars are ignored.
16# For example, "Latin Extended-A" and "latin extended a" are equivalent.
17# For more information on the comparison of property values,
18# see UAX #44: http://www.unicode.org/reports/tr44/
19#
20# All block ranges start with a value where (cp MOD 16) = 0,
21# and end with a value where (cp MOD 16) = 15. In other words,
22# the last hexadecimal digit of the start of range is ...0
23# and the last hexadecimal digit of the end of range is ...F.
24# This constraint on block ranges guarantees that allocations
25# are done in terms of whole columns, and that code chart display
26# never involves splitting columns in the charts.
27#
28# All code points not explicitly listed for Block
29# have the value No_Block.
30
31# Property: Block
32#
33# @missing: 0000..10FFFF; No_Block
34
350000..007F; Basic Latin
360080..00FF; Latin-1 Supplement
370100..017F; Latin Extended-A
380180..024F; Latin Extended-B
390250..02AF; IPA Extensions
4002B0..02FF; Spacing Modifier Letters
410300..036F; Combining Diacritical Marks
420370..03FF; Greek and Coptic
430400..04FF; Cyrillic
440500..052F; Cyrillic Supplement
450530..058F; Armenian
460590..05FF; Hebrew
470600..06FF; Arabic
480700..074F; Syriac
490750..077F; Arabic Supplement
500780..07BF; Thaana
5107C0..07FF; NKo
520800..083F; Samaritan
530840..085F; Mandaic
5408A0..08FF; Arabic Extended-A
550900..097F; Devanagari
560980..09FF; Bengali
570A00..0A7F; Gurmukhi
580A80..0AFF; Gujarati
590B00..0B7F; Oriya
600B80..0BFF; Tamil
610C00..0C7F; Telugu
620C80..0CFF; Kannada
630D00..0D7F; Malayalam
640D80..0DFF; Sinhala
650E00..0E7F; Thai
660E80..0EFF; Lao
670F00..0FFF; Tibetan
681000..109F; Myanmar
6910A0..10FF; Georgian
701100..11FF; Hangul Jamo
711200..137F; Ethiopic
721380..139F; Ethiopic Supplement
7313A0..13FF; Cherokee
741400..167F; Unified Canadian Aboriginal Syllabics
751680..169F; Ogham
7616A0..16FF; Runic
771700..171F; Tagalog
781720..173F; Hanunoo
791740..175F; Buhid
801760..177F; Tagbanwa
811780..17FF; Khmer
821800..18AF; Mongolian
8318B0..18FF; Unified Canadian Aboriginal Syllabics Extended
841900..194F; Limbu
851950..197F; Tai Le
861980..19DF; New Tai Lue
8719E0..19FF; Khmer Symbols
881A00..1A1F; Buginese
891A20..1AAF; Tai Tham
901AB0..1AFF; Combining Diacritical Marks Extended
911B00..1B7F; Balinese
921B80..1BBF; Sundanese
931BC0..1BFF; Batak
941C00..1C4F; Lepcha
951C50..1C7F; Ol Chiki
961CC0..1CCF; Sundanese Supplement
971CD0..1CFF; Vedic Extensions
981D00..1D7F; Phonetic Extensions
991D80..1DBF; Phonetic Extensions Supplement
1001DC0..1DFF; Combining Diacritical Marks Supplement
1011E00..1EFF; Latin Extended Additional
1021F00..1FFF; Greek Extended
1032000..206F; General Punctuation
1042070..209F; Superscripts and Subscripts
10520A0..20CF; Currency Symbols
10620D0..20FF; Combining Diacritical Marks for Symbols
1072100..214F; Letterlike Symbols
1082150..218F; Number Forms
1092190..21FF; Arrows
1102200..22FF; Mathematical Operators
1112300..23FF; Miscellaneous Technical
1122400..243F; Control Pictures
1132440..245F; Optical Character Recognition
1142460..24FF; Enclosed Alphanumerics
1152500..257F; Box Drawing
1162580..259F; Block Elements
11725A0..25FF; Geometric Shapes
1182600..26FF; Miscellaneous Symbols
1192700..27BF; Dingbats
12027C0..27EF; Miscellaneous Mathematical Symbols-A
12127F0..27FF; Supplemental Arrows-A
1222800..28FF; Braille Patterns
1232900..297F; Supplemental Arrows-B
1242980..29FF; Miscellaneous Mathematical Symbols-B
1252A00..2AFF; Supplemental Mathematical Operators
1262B00..2BFF; Miscellaneous Symbols and Arrows
1272C00..2C5F; Glagolitic
1282C60..2C7F; Latin Extended-C
1292C80..2CFF; Coptic
1302D00..2D2F; Georgian Supplement
1312D30..2D7F; Tifinagh
1322D80..2DDF; Ethiopic Extended
1332DE0..2DFF; Cyrillic Extended-A
1342E00..2E7F; Supplemental Punctuation
1352E80..2EFF; CJK Radicals Supplement
1362F00..2FDF; Kangxi Radicals
1372FF0..2FFF; Ideographic Description Characters
1383000..303F; CJK Symbols and Punctuation
1393040..309F; Hiragana
14030A0..30FF; Katakana
1413100..312F; Bopomofo
1423130..318F; Hangul Compatibility Jamo
1433190..319F; Kanbun
14431A0..31BF; Bopomofo Extended
14531C0..31EF; CJK Strokes
14631F0..31FF; Katakana Phonetic Extensions
1473200..32FF; Enclosed CJK Letters and Months
1483300..33FF; CJK Compatibility
1493400..4DBF; CJK Unified Ideographs Extension A
1504DC0..4DFF; Yijing Hexagram Symbols
1514E00..9FFF; CJK Unified Ideographs
152A000..A48F; Yi Syllables
153A490..A4CF; Yi Radicals
154A4D0..A4FF; Lisu
155A500..A63F; Vai
156A640..A69F; Cyrillic Extended-B
157A6A0..A6FF; Bamum
158A700..A71F; Modifier Tone Letters
159A720..A7FF; Latin Extended-D
160A800..A82F; Syloti Nagri
161A830..A83F; Common Indic Number Forms
162A840..A87F; Phags-pa
163A880..A8DF; Saurashtra
164A8E0..A8FF; Devanagari Extended
165A900..A92F; Kayah Li
166A930..A95F; Rejang
167A960..A97F; Hangul Jamo Extended-A
168A980..A9DF; Javanese
169A9E0..A9FF; Myanmar Extended-B
170AA00..AA5F; Cham
171AA60..AA7F; Myanmar Extended-A
172AA80..AADF; Tai Viet
173AAE0..AAFF; Meetei Mayek Extensions
174AB00..AB2F; Ethiopic Extended-A
175AB30..AB6F; Latin Extended-E
176AB70..ABBF; Cherokee Supplement
177ABC0..ABFF; Meetei Mayek
178AC00..D7AF; Hangul Syllables
179D7B0..D7FF; Hangul Jamo Extended-B
180D800..DB7F; High Surrogates
181DB80..DBFF; High Private Use Surrogates
182DC00..DFFF; Low Surrogates
183E000..F8FF; Private Use Area
184F900..FAFF; CJK Compatibility Ideographs
185FB00..FB4F; Alphabetic Presentation Forms
186FB50..FDFF; Arabic Presentation Forms-A
187FE00..FE0F; Variation Selectors
188FE10..FE1F; Vertical Forms
189FE20..FE2F; Combining Half Marks
190FE30..FE4F; CJK Compatibility Forms
191FE50..FE6F; Small Form Variants
192FE70..FEFF; Arabic Presentation Forms-B
193FF00..FFEF; Halfwidth and Fullwidth Forms
194FFF0..FFFF; Specials
19510000..1007F; Linear B Syllabary
19610080..100FF; Linear B Ideograms
19710100..1013F; Aegean Numbers
19810140..1018F; Ancient Greek Numbers
19910190..101CF; Ancient Symbols
200101D0..101FF; Phaistos Disc
20110280..1029F; Lycian
202102A0..102DF; Carian
203102E0..102FF; Coptic Epact Numbers
20410300..1032F; Old Italic
20510330..1034F; Gothic
20610350..1037F; Old Permic
20710380..1039F; Ugaritic
208103A0..103DF; Old Persian
20910400..1044F; Deseret
21010450..1047F; Shavian
21110480..104AF; Osmanya
21210500..1052F; Elbasan
21310530..1056F; Caucasian Albanian
21410600..1077F; Linear A
21510800..1083F; Cypriot Syllabary
21610840..1085F; Imperial Aramaic
21710860..1087F; Palmyrene
21810880..108AF; Nabataean
219108E0..108FF; Hatran
22010900..1091F; Phoenician
22110920..1093F; Lydian
22210980..1099F; Meroitic Hieroglyphs
223109A0..109FF; Meroitic Cursive
22410A00..10A5F; Kharoshthi
22510A60..10A7F; Old South Arabian
22610A80..10A9F; Old North Arabian
22710AC0..10AFF; Manichaean
22810B00..10B3F; Avestan
22910B40..10B5F; Inscriptional Parthian
23010B60..10B7F; Inscriptional Pahlavi
23110B80..10BAF; Psalter Pahlavi
23210C00..10C4F; Old Turkic
23310C80..10CFF; Old Hungarian
23410E60..10E7F; Rumi Numeral Symbols
23511000..1107F; Brahmi
23611080..110CF; Kaithi
237110D0..110FF; Sora Sompeng
23811100..1114F; Chakma
23911150..1117F; Mahajani
24011180..111DF; Sharada
241111E0..111FF; Sinhala Archaic Numbers
24211200..1124F; Khojki
24311280..112AF; Multani
244112B0..112FF; Khudawadi
24511300..1137F; Grantha
24611480..114DF; Tirhuta
24711580..115FF; Siddham
24811600..1165F; Modi
24911680..116CF; Takri
25011700..1173F; Ahom
251118A0..118FF; Warang Citi
25211AC0..11AFF; Pau Cin Hau
25312000..123FF; Cuneiform
25412400..1247F; Cuneiform Numbers and Punctuation
25512480..1254F; Early Dynastic Cuneiform
25613000..1342F; Egyptian Hieroglyphs
25714400..1467F; Anatolian Hieroglyphs
25816800..16A3F; Bamum Supplement
25916A40..16A6F; Mro
26016AD0..16AFF; Bassa Vah
26116B00..16B8F; Pahawh Hmong
26216F00..16F9F; Miao
2631B000..1B0FF; Kana Supplement
2641BC00..1BC9F; Duployan
2651BCA0..1BCAF; Shorthand Format Controls
2661D000..1D0FF; Byzantine Musical Symbols
2671D100..1D1FF; Musical Symbols
2681D200..1D24F; Ancient Greek Musical Notation
2691D300..1D35F; Tai Xuan Jing Symbols
2701D360..1D37F; Counting Rod Numerals
2711D400..1D7FF; Mathematical Alphanumeric Symbols
2721D800..1DAAF; Sutton SignWriting
2731E800..1E8DF; Mende Kikakui
2741EE00..1EEFF; Arabic Mathematical Alphabetic Symbols
2751F000..1F02F; Mahjong Tiles
2761F030..1F09F; Domino Tiles
2771F0A0..1F0FF; Playing Cards
2781F100..1F1FF; Enclosed Alphanumeric Supplement
2791F200..1F2FF; Enclosed Ideographic Supplement
2801F300..1F5FF; Miscellaneous Symbols and Pictographs
2811F600..1F64F; Emoticons
2821F650..1F67F; Ornamental Dingbats
2831F680..1F6FF; Transport and Map Symbols
2841F700..1F77F; Alchemical Symbols
2851F780..1F7FF; Geometric Shapes Extended
2861F800..1F8FF; Supplemental Arrows-C
2871F900..1F9FF; Supplemental Symbols and Pictographs
28820000..2A6DF; CJK Unified Ideographs Extension B
2892A700..2B73F; CJK Unified Ideographs Extension C
2902B740..2B81F; CJK Unified Ideographs Extension D
2912B820..2CEAF; CJK Unified Ideographs Extension E
2922F800..2FA1F; CJK Compatibility Ideographs Supplement
293E0000..E007F; Tags
294E0100..E01EF; Variation Selectors Supplement
295F0000..FFFFF; Supplementary Private Use Area-A
296100000..10FFFF; Supplementary Private Use Area-B
297
298# EOF
diff --git a/admin/unidata/Makefile.in b/admin/unidata/Makefile.in
index 6c81d32484a..954e9faacae 100644
--- a/admin/unidata/Makefile.in
+++ b/admin/unidata/Makefile.in
@@ -23,6 +23,8 @@
23 23
24SHELL = @SHELL@ 24SHELL = @SHELL@
25 25
26AWK = @AWK@
27
26srcdir = @srcdir@ 28srcdir = @srcdir@
27top_srcdir = @top_srcdir@ 29top_srcdir = @top_srcdir@
28top_builddir = @top_builddir@ 30top_builddir = @top_builddir@
@@ -51,7 +53,7 @@ am__v_at_1 =
51 53
52.PHONY: all unifiles 54.PHONY: all unifiles
53 55
54all: ${top_srcdir}/src/macuvs.h unifiles 56all: ${top_srcdir}/src/macuvs.h unifiles ${unidir}/charscript.el
55 57
56## Specify .elc as an order-only prereq so as to not needlessly rebuild 58## Specify .elc as an order-only prereq so as to not needlessly rebuild
57## target just because the .elc is missing. 59## target just because the .elc is missing.
@@ -94,6 +96,16 @@ unifiles: ${unidir}/charprop.el
94 [ -f $(unidir)/$$f ] || exec $(MAKE) PHONY_EXTRAS=$< $<; \ 96 [ -f $(unidir)/$$f ] || exec $(MAKE) PHONY_EXTRAS=$< $<; \
95 done 97 done
96 98
99
100.PHONY: charscript.el
101charscript.el: ${unidir}/charscript.el
102
103blocks = ${srcdir}/blocks.awk
104
105${unidir}/charscript.el: ${srcdir}/Blocks.txt ${blocks}
106 $(AM_V_GEN)$(AWK) -f ${blocks} < $< > $@
107
108
97.PHONY: clean bootstrap-clean distclean maintainer-clean extraclean 109.PHONY: clean bootstrap-clean distclean maintainer-clean extraclean
98 110
99clean: 111clean:
@@ -110,7 +122,7 @@ maintainer-clean: distclean
110## change and it slows down bootstrap (a tiny bit). 122## change and it slows down bootstrap (a tiny bit).
111## Cf leim/ja-dic (which is much slower). 123## Cf leim/ja-dic (which is much slower).
112extraclean: 124extraclean:
113 rm -f ${top_srcdir}/src/macuvs.h 125 rm -f ${top_srcdir}/src/macuvs.h ${unidir}/charscript.el*
114 ifneq (,$(wildcard $(unidir)/charprop.el)) 126 ifneq (,$(wildcard $(unidir)/charprop.el))
115 cd $(unidir) && \ 127 cd $(unidir) && \
116 rm -f `sed -n 's/^;; FILE: //p' < charprop.el` charprop.el 128 rm -f `sed -n 's/^;; FILE: //p' < charprop.el` charprop.el
diff --git a/admin/unidata/README b/admin/unidata/README
index e0d0e00417f..8ad0a12d728 100644
--- a/admin/unidata/README
+++ b/admin/unidata/README
@@ -16,3 +16,7 @@ http://www.unicode.org/ivd/data/2014-05-16/IVD_Sequences.txt
16UnicodeData.txt 16UnicodeData.txt
17http://www.unicode.org/Public/UNIDATA/UnicodeData.txt 17http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
182014-03-10 182014-03-10
19
20Blocks.txt
21http://www.unicode.org/Public/8.0.0/ucd/Blocks.txt
222014-11-10
diff --git a/admin/unidata/blocks.awk b/admin/unidata/blocks.awk
new file mode 100755
index 00000000000..892ac58c927
--- /dev/null
+++ b/admin/unidata/blocks.awk
@@ -0,0 +1,225 @@
1#!/usr/bin/awk -f
2
3## Copyright (C) 2015 Free Software Foundation, Inc.
4
5## Author: Glenn Morris <rgm@gnu.org>
6
7## This file is part of GNU Emacs.
8
9## GNU Emacs is free software: you can redistribute it and/or modify
10## it under the terms of the GNU General Public License as published by
11## the Free Software Foundation, either version 3 of the License, or
12## (at your option) any later version.
13
14## GNU Emacs is distributed in the hope that it will be useful,
15## but WITHOUT ANY WARRANTY; without even the implied warranty of
16## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17## GNU General Public License for more details.
18
19## You should have received a copy of the GNU General Public License
20## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22### Commentary:
23
24## This script takes as input Unicode's Blocks.txt
25## (http://www.unicode.org/Public/UNIDATA/Blocks.txt)
26## and produces output for Emacs's lisp/international/charscript.el.
27
28## It lumps together all the blocks belonging to the same language.
29## E.g., "Basic Latin", "Latin-1 Supplement", "Latin Extended-A",
30## etc. are all lumped together under "latin".
31
32## The Unicode blocks actually extend past some of these ranges with
33## undefined codepoints.
34
35## For additional details, see <http://debbugs.gnu.org/20789#11>.
36
37## Things to do after installing a new version of Blocks.txt:
38## Check the output against the old output.
39## Adjust the alias array, and the name2alias function for any new
40## entries, if necessary.
41## Check fix_start (and fix_end) to see if entries need adding/removing.
42## Review the hard-coded splits at the end of the main body.
43
44### Code:
45
46BEGIN {
47 ## Hard-coded names. See name2alias for the rest.
48 alias["ipa extensions"] = "phonetic"
49 alias["letterlike symbols"] = "symbol"
50 alias["number forms"] = "symbol"
51 alias["miscellaneous technical"] = "symbol"
52 alias["control pictures"] = "symbol"
53 alias["optical character recognition"] = "symbol"
54 alias["enclosed alphanumerics"] = "symbol"
55 alias["box drawing"] = "symbol"
56 alias["block elements"] = "symbol"
57 alias["miscellaneous symbols"] = "symbol"
58 alias["cjk strokes"] = "cjk-misc"
59 alias["cjk symbols and punctuation"] = "cjk-misc"
60 alias["halfwidth and fullwidth forms"] = "cjk-misc"
61 alias["common indic number forms"] = "north-indic-number"
62
63 tohex["a"] = 10
64 tohex["b"] = 11
65 tohex["c"] = 12
66 tohex["d"] = 13
67 tohex["e"] = 14
68 tohex["f"] = 15
69
70 fix_start["0080"] = "00A0"
71 ## Define fix_end here if you need it.
72}
73
74## From admin/charsets/.
75## With gawk's --non-decimal-data switch we wouldn't need this.
76function decode_hex(str , n, len, i, c) {
77 n = 0
78 len = length(str)
79 for (i = 1; i <= len; i++)
80 {
81 c = substr (str, i, 1)
82 if (c >= "0" && c <= "9")
83 n = n * 16 + (c - "0")
84 else
85 n = n * 16 + tohex[tolower(c)]
86 }
87 return n
88}
89
90function name2alias(name , w, w2) {
91 name = tolower(name)
92 if (alias[name]) return alias[name]
93 else if (name ~ /for symbols/) return "symbol"
94 else if (name ~ /latin|combining .* marks|spacing modifier|tone letters|alphabetic presentation/) return "latin"
95 else if (name ~ /cjk|yijing|enclosed ideograph|kangxi/) return "han"
96 else if (name ~ /arabic/) return "arabic"
97 else if (name ~ /^greek/) return "greek"
98 else if (name ~ /^coptic/) return "coptic"
99 else if (name ~ /cuneiform number/) return "cuneiform-numbers-and-punctuation"
100 else if (name ~ /cuneiform/) return "cuneiform"
101 else if (name ~ /mathematical alphanumeric symbol/) return "mathematical"
102 else if (name ~ /punctuation|mathematical|arrows|currency|superscript|small form variants|geometric|dingbats|enclosed|alchemical|pictograph|emoticon|transport/) return "symbol"
103 else if (name ~ /canadian aboriginal/) return "canadian-aboriginal"
104 else if (name ~ /katakana|hiragana/) return "kana"
105 else if (name ~ /myanmar/) return "burmese"
106 else if (name ~ /hangul/) return "hangul"
107 else if (name ~ /khmer/) return "khmer"
108 else if (name ~ /braille/) return "braille"
109 else if (name ~ /^yi /) return "yi"
110 else if (name ~ /surrogates|private use|variation selectors/) return 0
111 else if (name ~/^(specials|tags)$/) return 0
112 else if (name ~ /linear b/) return "linear-b"
113 else if (name ~ /aramaic/) return "aramaic"
114 else if (name ~ /rumi num/) return "rumi-number"
115 else if (name ~ /duployan|shorthand/) return "duployan-shorthand"
116 else if (name ~ /sutton signwriting/) return "sutton-sign-writing"
117
118 sub(/ (extended|extensions|supplement).*/, "", name)
119 sub(/numbers/, "number", name)
120 sub(/numerals/, "numeral", name)
121 sub(/symbols/, "symbol", name)
122 sub(/forms$/, "form", name)
123 sub(/tiles$/, "tile", name)
124 sub(/^new /, "", name)
125 sub(/ (characters|hieroglyphs|cursive)$/, "", name)
126 gsub(/ /, "-", name)
127
128 return name
129}
130
131/^[0-9A-F]/ {
132 sep = index($1, "..")
133 len = length($1)
134 s = substr($1,1,sep-1)
135 e = substr($1,sep+2,len-sep-2)
136 $1 = ""
137 sub(/^ */, "", $0)
138 i++
139 start[i] = fix_start[s] ? fix_start[s] : s
140 end[i] = fix_end[e] ? fix_end[e]: e
141 name[i] = $0
142
143 alt[i] = name2alias(name[i])
144
145 if (!alt[i])
146 {
147 i--
148 next
149 }
150
151 ## Combine adjacent ranges with the same name.
152 if (alt[i] == alt[i-1] && decode_hex(start[i]) == 1 + decode_hex(end[i-1]))
153 {
154 end[i-1] = end[i]
155 name[i-1] = (name[i-1] ", " name[i])
156 i--
157 }
158
159 ## Some hard-coded splits.
160 if (start[i] == "0370")
161 {
162 end[i] = "03E1"
163 i++
164 start[i] = "03E2"
165 end[i] = "03EF"
166 alt[i] = "coptic"
167 i++
168 start[i] = "03F0"
169 end[i] = "03FF"
170 alt[i] = "greek"
171 }
172 else if (start[i] == "FB00")
173 {
174 end[i] = "FB06"
175 i++
176 start[i] = "FB13"
177 end[i] = "FB17"
178 alt[i] = "armenian"
179 i++
180 start[i] = "FB1D"
181 end[i] = "FB4F"
182 alt[i] = "hebrew"
183 }
184 else if (start[i] == "FF00")
185 {
186 end[i] = "FF60"
187 i++
188 start[i] = "FF61"
189 end[i] = "FF9F"
190 alt[i] = "kana"
191 i++
192 start[i] = "FFA0"
193 end[i] = "FFDF"
194 alt[i] = "hangul"
195 i++
196 start[i] = "FFE0"
197 end[i] = "FFEF"
198 alt[i] = "cjk-misc"
199 }
200}
201
202END {
203 print ";;; charscript.el --- character script table"
204 print ";;; Automatically generated from admin/unidata/Blocks.txt"
205 print "(let (script-list)"
206 print " (dolist (elt '("
207
208 for (j=1;j<=i;j++)
209 {
210 printf(" (#x%s #x%s %s)", start[j], end[j], alt[j])
211 ## Fuzz to decide whether worth printing original name as a comment.
212 if (name[j] && alt[j] != tolower(name[j]) && alt[j] !~ /-/)
213 printf(" ; %s", name[j])
214 printf("\n")
215 }
216
217 print " ))"
218 print " (set-char-table-range char-script-table"
219 print " (cons (car elt) (nth 1 elt)) (nth 2 elt))"
220 print " (or (memq (nth 2 elt) script-list)"
221 print " (setq script-list (cons (nth 2 elt) script-list))))"
222 print " (set-char-table-extra-slot char-script-table 0 (nreverse script-list)))"
223 print ""
224 print "(provide 'charscript)"
225}
diff --git a/lisp/international/characters.el b/lisp/international/characters.el
index c4c9060d842..310384aa969 100644
--- a/lisp/international/characters.el
+++ b/lisp/international/characters.el
@@ -1163,235 +1163,11 @@ Setup char-width-table appropriate for non-CJK language environment."
1163 1163
1164 1164
1165;; Setting char-script-table. 1165;; Setting char-script-table.
1166 1166(if purify-flag
1167;; The data is compiled from Blocks.txt and Scripts.txt in the 1167 ;; While dumping, we can't use require, and international is not
1168;; "Unicode Character Database", simplified to lump together all the 1168 ;; in load-path.
1169;; blocks belonging to the same language. E.g., "Basic Latin", 1169 (load "international/charscript")
1170;; "Latin-1 Supplement", "Latin Extended-A", etc. are all lumped 1170 (require 'charscript))
1171;; together under "latin".
1172;;
1173;; The Unicode blocks actually extend past some of these ranges with
1174;; undefined codepoints.
1175;;
1176;; Last update: http://www.unicode.org/Public/8.0.0/ucd/Blocks-8.0.0d3.txt
1177(let ((script-list nil))
1178 (dolist
1179 (elt
1180 '((#x0000 #x007F latin)
1181 (#x00A0 #x024F latin)
1182 (#x0250 #x02AF phonetic) ; IPA Extensions
1183 (#x02B0 #x036F latin) ; Spacing Modifiers and Diacriticals
1184 (#x0370 #x03E1 greek)
1185 (#x03E2 #x03EF coptic)
1186 (#x03F0 #x03FF greek)
1187 (#x0400 #x052F cyrillic)
1188 (#x0530 #x058F armenian)
1189 (#x0590 #x05FF hebrew)
1190 (#x0600 #x06FF arabic)
1191 (#x0700 #x074F syriac)
1192 (#x0750 #x077F arabic) ; Arabic Supplement
1193 (#x0780 #x07BF thaana)
1194 (#x07C0 #x07FF nko)
1195 (#x0800 #x083F samaritan)
1196 (#x0840 #x085F mandaic)
1197 (#x08A0 #x08FF arabic) ; Arabic Extended-A
1198 (#x0900 #x097F devanagari)
1199 (#x0980 #x09FF bengali)
1200 (#x0A00 #x0A7F gurmukhi)
1201 (#x0A80 #x0AFF gujarati)
1202 (#x0B00 #x0B7F oriya)
1203 (#x0B80 #x0BFF tamil)
1204 (#x0C00 #x0C7F telugu)
1205 (#x0C80 #x0CFF kannada)
1206 (#x0D00 #x0D7F malayalam)
1207 (#x0D80 #x0DFF sinhala)
1208 (#x0E00 #x0E7F thai)
1209 (#x0E80 #x0EFF lao)
1210 (#x0F00 #x0FFF tibetan)
1211 (#x1000 #x109F burmese) ; Myanmar
1212 (#x10A0 #x10FF georgian)
1213 (#x1100 #x11FF hangul)
1214 (#x1200 #x139F ethiopic) ; Ethiopic and Ethiopic Supplement
1215 (#x13A0 #x13FF cherokee)
1216 (#x1400 #x167F canadian-aboriginal)
1217 (#x1680 #x169F ogham)
1218 (#x16A0 #x16FF runic)
1219 (#x1700 #x171F tagalog)
1220 (#x1720 #x173F hanunoo)
1221 (#x1740 #x175F buhid)
1222 (#x1760 #x177F tagbanwa)
1223 (#x1780 #x17FF khmer)
1224 (#x1800 #x18AF mongolian)
1225 (#x18B0 #x18FF canadian-aboriginal) ; Canadian Aboriginal Syllabics Extended
1226 (#x1900 #x194F limbu)
1227 (#x1950 #x197F tai-le)
1228 (#x1980 #x19DF tai-lue) ; New Tai Lue
1229 (#x19E0 #x19FF khmer) ; Khmer Symbols
1230 (#x1A00 #x1A1F buginese)
1231 (#x1A20 #x1AAF tai-tham)
1232 (#x1AB0 #x1AFF latin) ; Combining Diacritical Marks Extended
1233 (#x1B00 #x1B7F balinese)
1234 (#x1B80 #x1BBF sundanese)
1235 (#x1BC0 #x1BFF batak)
1236 (#x1C00 #x1C4F lepcha)
1237 (#x1C50 #x1C7F ol-chiki)
1238 (#x1CC0 #x1CCF sundanese)
1239 (#x1CD0 #x1CFF vedic)
1240 (#x1D00 #x1DBF phonetic) ; Phonetic Extensions & Supplement
1241 (#x1DC0 #x1EFF latin) ; Latin Extended Additional
1242 (#x1F00 #x1FFF greek) ; Greek Extended
1243 (#x2000 #x27FF symbol)
1244 (#x2800 #x28FF braille)
1245 (#x2900 #x2BFF symbol)
1246 (#x2C00 #x2C5F glagolitic)
1247 (#x2C60 #x2C7F latin) ; Latin Extended-C
1248 (#x2C80 #x2CFF coptic)
1249 (#x2D00 #x2D2F georgian) ; Georgian Supplement
1250 (#x2D30 #x2D7F tifinagh)
1251 (#x2D80 #x2DDF ethiopic) ; Ethiopic Extended
1252 (#x2DE0 #x2DFF cyrillic) ; Cyrillic Extended-A
1253 (#x2E00 #x2E7F symbol)
1254 (#x2E80 #x2FDF han)
1255 (#x2FF0 #x2FFF ideographic-description)
1256 (#x3000 #x303F cjk-misc)
1257 (#x3040 #x30FF kana) ; Hiragana and Katakana
1258 (#x3100 #x312F bopomofo)
1259 (#x3130 #x318F hangul) ; Hangul Compatibility Jamo
1260 (#x3190 #x319F kanbun)
1261 (#x31A0 #x31BF bopomofo) ; Bopomofo Extended
1262 (#x31C0 #x31EF cjk-misc) ; CJK Strokes
1263 (#x31F0 #x31FF kana) ; Katakana Phonetic Extensions
1264 (#x3200 #x9FFF han)
1265 (#xA000 #xA4CF yi)
1266 (#xA4D0 #xA4FF lisu)
1267 (#xA500 #xA63F vai)
1268 (#xA640 #xA69F cyrillic) ; Cyrillic Extended-B
1269 (#xA6A0 #xA6FF bamum)
1270 (#xA700 #xA7FF latin)
1271 (#xA800 #xA82F syloti-nagri)
1272 (#xA830 #xA83F north-indic-number)
1273 (#xA840 #xA87F phags-pa)
1274 (#xA880 #xA8DF saurashtra)
1275 (#xA8E0 #xA8FF devanagari) ; Devanagari Extended
1276 (#xA900 #xA92F kayah-li)
1277 (#xA930 #xA95F rejang)
1278 (#xA960 #xA97F hangul) ; Hangul Jamo Extended
1279 (#xA980 #xA9DF javanese)
1280 (#xA9E0 #xA9FF burmese) ; Myanmar Extended-B
1281 (#xAA00 #xAA5F cham)
1282 (#xAA60 #xAA7F burmese) ; Myanmar Extended-A
1283 (#xAA80 #xAADF tai-viet)
1284 (#xAAE0 #xAAFF meetei-mayek) ; Meetei Mayek Extensions
1285 (#xAB00 #xAB2F ethiopic) ; Ethiopic Extended-A
1286 (#xAB30 #xAB6F latin) ; Latin Extended-E
1287 (#xAB70 #xABBF cherokee) ; Cherokee Supplement
1288 (#xABC0 #xABFF meetei-mayek)
1289 (#xAC00 #xD7FF hangul)
1290 (#xF900 #xFAFF han)
1291 (#xFB00 #xFB06 latin) ; Latin ligatures
1292 (#xFB13 #xFB17 armenian) ; Armenian ligatures
1293 (#xFB1D #xFB4F hebrew) ; Alphabetic Presentation Forms
1294 (#xFB50 #xFDFF arabic) ; Arabic Presentation Forms-A
1295 (#xFE10 #xFE1F vertical-form)
1296 (#xFE20 #xFE2F latin) ; Combining Half Marks
1297 (#xFE30 #xFE4F han)
1298 (#xFE50 #xFE6F symbol) ; Small Form Variants
1299 (#xFE70 #xFEFF arabic) ; Arabic Presentation Forms-B
1300 (#xFF00 #xFF60 cjk-misc)
1301 (#xFF61 #xFF9F kana)
1302 (#xFFA0 #xFFDF hangul)
1303 (#xFFE0 #xFFEF cjk-misc)
1304 (#x10000 #x100FF linear-b)
1305 (#x10100 #x1013F aegean-number)
1306 (#x10140 #x1018F ancient-greek-number)
1307 (#x10190 #x101CF ancient-symbol)
1308 (#x101D0 #x101FF phaistos-disc)
1309 (#x10280 #x1029F lycian)
1310 (#x102A0 #x102DF carian)
1311 (#x102E0 #x102FF coptic) ; Coptic Epact Numbers
1312 (#x10300 #x1032F old-italic)
1313 (#x10330 #x1034F gothic)
1314 (#x10350 #x1037F old-permic)
1315 (#x10380 #x1039F ugaritic)
1316 (#x103A0 #x103DF old-persian)
1317 (#x10400 #x1044F deseret)
1318 (#x10450 #x1047F shavian)
1319 (#x10480 #x104AF osmanya)
1320 (#x10500 #x1052F elbasan)
1321 (#x10530 #x1056F caucasian-albanian)
1322 (#x10600 #x1077F linear-a)
1323 (#x10800 #x1083F cypriot-syllabary)
1324 (#x10840 #x1085F aramaic)
1325 (#x10860 #x1087F palmyrene)
1326 (#x10880 #x108AF nabataean)
1327 (#x108E0 #x108FF hatran)
1328 (#x10900 #x1091F phoenician)
1329 (#x10920 #x1093F lydian)
1330 (#x10980 #x109FF meroitic)
1331 (#x10A00 #x10A5F kharoshthi)
1332 (#x10A60 #x10A7F old-south-arabian)
1333 (#x10A80 #x10A9F old-north-arabian)
1334 (#x10AC0 #x10AFF manichaean)
1335 (#x10B00 #x10B3F avestan)
1336 (#x10B40 #x10B5F inscriptional-parthian)
1337 (#x10B60 #x10B7F inscriptional-pahlavi)
1338 (#x10B80 #x10BAF psalter-pahlavi)
1339 (#x10C00 #x10C4F old-turkic)
1340 (#x10C80 #x10CFF old-hungarian)
1341 (#x10E60 #x10E7F rumi-number)
1342 (#x11000 #x1107F brahmi)
1343 (#x11080 #x110CF kaithi)
1344 (#x110D0 #x110FF sora-sompeng)
1345 (#x11100 #x1114F chakma)
1346 (#x11150 #x1117F mahajani)
1347 (#x11180 #x111DF sharada)
1348 (#x111E0 #x111FF sinhala-archaic-number)
1349 (#x11200 #x1124F khojki)
1350 (#x11280 #x112AF multani)
1351 (#x112B0 #x112FF khudawadi)
1352 (#x11300 #x1137F grantha)
1353 (#x11480 #x114DF tirhuta)
1354 (#x11580 #x115FF siddham)
1355 (#x11600 #x1165F modi)
1356 (#x11680 #x116CF takri)
1357 (#x11700 #x1173F ahom)
1358 (#x118A0 #x118FF warang-citi)
1359 (#x11AC0 #x11AFF pau-cin-hau)
1360 (#x12000 #x123FF cuneiform)
1361 (#x12400 #x1247F cuneiform-numbers-and-punctuation)
1362 (#x12480 #x1254F cuneiform) ; Early Dynastic Cuneiform
1363 (#x13000 #x1342F egyptian)
1364 (#x14400 #x1467F anatolian)
1365 (#x16800 #x16A3F bamum)
1366 (#x16A40 #x16A6F mro)
1367 (#x16AD0 #x16AFF bassa-vah)
1368 (#x16B00 #x16B8F pahawh-hmong)
1369 (#x16F00 #x16F9F miao)
1370 (#x1B000 #x1B0FF kana) ; Kana Supplement
1371 (#x1BC00 #x1BCAF duployan-shorthand)
1372 (#x1D000 #x1D0FF byzantine-musical-symbol)
1373 (#x1D100 #x1D1FF musical-symbol)
1374 (#x1D200 #x1D24F ancient-greek-musical-notation)
1375 (#x1D300 #x1D35F tai-xuan-jing-symbol)
1376 (#x1D360 #x1D37F counting-rod-numeral)
1377 (#x1D400 #x1D7FF mathematical)
1378 (#x1D800 #x1DAAF sutton-sign-writing)
1379 (#x1E800 #x1E8DF mende-kikakui)
1380 (#x1EE00 #x1EEFF arabic) ; Arabic Mathematical Alphabetic Symbols
1381 (#x1F000 #x1F02F mahjong-tile)
1382 (#x1F030 #x1F09F domino-tile)
1383 (#x1F0A0 #x1F0FF playing-cards)
1384 (#x1F100 #x1F1FF symbol) ; Enclosed Alphanumeric Supplement
1385 (#x1F200 #x1F2FF han) ; Enclosed Ideographic Supplement
1386 (#x1F300 #x1F9FF symbol)
1387 (#x20000 #x2A6DF han)
1388 (#x2A700 #x2CEAF han)
1389 (#x2F800 #x2FA1F han)))
1390 (set-char-table-range char-script-table
1391 (cons (car elt) (nth 1 elt)) (nth 2 elt))
1392 (or (memq (nth 2 elt) script-list)
1393 (setq script-list (cons (nth 2 elt) script-list))))
1394 (set-char-table-extra-slot char-script-table 0 (nreverse script-list)))
1395 1171
1396(map-charset-chars 1172(map-charset-chars
1397 #'(lambda (range _ignore) 1173 #'(lambda (range _ignore)
diff --git a/src/Makefile.in b/src/Makefile.in
index 172fa8e47cd..e5c5ddbcbc6 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -488,6 +488,12 @@ charsets = ${top_srcdir}/admin/charsets/charsets.stamp
488${charsets}: FORCE 488${charsets}: FORCE
489 ${MAKE} -C ../admin/charsets all 489 ${MAKE} -C ../admin/charsets all
490 490
491charscript = ${lispintdir}/charscript.el
492${charscript}: FORCE
493 $(MAKE) -C ../admin/unidata $(notdir $@)
494
495${lispintdir}/characters.elc: ${charscript:.el=.elc}
496
491## The dumped Emacs is as functional and more efficient than 497## The dumped Emacs is as functional and more efficient than
492## bootstrap-emacs, so we replace the latter with the former. 498## bootstrap-emacs, so we replace the latter with the former.
493## Strictly speaking, emacs does not depend directly on all of $lisp, 499## Strictly speaking, emacs does not depend directly on all of $lisp,
@@ -557,7 +563,7 @@ $(lib)/libgnu.a: $(config_h)
557## This goes on to affect various things, and the emacs binary fails 563## This goes on to affect various things, and the emacs binary fails
558## to start if Vinstallation_directory has the wrong value. 564## to start if Vinstallation_directory has the wrong value.
559temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) \ 565temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) \
560 $(lib)/libgnu.a $(EMACSRES) ${charsets} 566 $(lib)/libgnu.a $(EMACSRES) ${charsets} ${charscript}
561 $(AM_V_CCLD)$(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \ 567 $(AM_V_CCLD)$(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
562 -o temacs $(ALLOBJS) $(lib)/libgnu.a $(W32_RES_LINK) $(LIBES) 568 -o temacs $(ALLOBJS) $(lib)/libgnu.a $(W32_RES_LINK) $(LIBES)
563 $(MKDIR_P) $(etc) 569 $(MKDIR_P) $(etc)