Commit 474a8465 authored by Eli Zaretskii's avatar Eli Zaretskii

Use uniprop tables instead of biditype.h and bidimirror.h.

 src/bidi.c (bidi_initialize): Use uniprop_table instead of including
 biditype.h and bidimirror.h.
 src/biditype.h: File removed.
 src/bidimirror.h: File removed.
 src/deps.mk (bidi.o): Remove biditype.h and
 bidimirror.h.
 src/makefile.w32-in ($(BLD)/bidi.$(O)): Remove biditype.h and
 bidimirror.h.
 src/dispextern.h: Fix a typo in the comment to bidi_type_t.
 src/chartab.c: Improve commentary for the uniprop_table API.

 admin/unidata/bidimirror.awk: File removed.
 admin/unidata/biditype.awk: File removed.
 admin/unidata/makefile.w32-in (all): Remove src/biditype.h and
 src/bidimirror.h.
 (../../src/biditype.h, ../../src/bidimirror.h): Deleted.
 admin/unidata/Makefile.in (all): Remove src/biditype.h and
 src/bidimirror.h.
 (../../src/biditype.h, ../../src/bidimirror.h): Deleted.
parent 934eacb9
2011-08-15 Eli Zaretskii <eliz@gnu.org>
* unidata/bidimirror.awk: File removed.
* unidata/biditype.awk: File removed.
* unidata/makefile.w32-in (all): Remove src/biditype.h and
src/bidimirror.h.
(../../src/biditype.h, ../../src/bidimirror.h): Deleted.
* unidata/Makefile.in (all): Remove src/biditype.h and
src/bidimirror.h.
(../../src/biditype.h, ../../src/bidimirror.h): Deleted.
2011-07-07 Juanma Barranquero <lekktu@gmail.com>
* unidata/makefile.w32-in (charprop-SH, charprop-CMD):
......
......@@ -23,7 +23,7 @@ EMACS = ../../src/emacs
DSTDIR = ../../lisp/international
RUNEMACS = ${EMACS} -Q -batch
all: ${DSTDIR}/charprop.el ../../src/biditype.h ../../src/bidimirror.h
all: ${DSTDIR}/charprop.el
.el.elc:
${RUNEMACS} -batch -f batch-byte-compile $<
......@@ -38,12 +38,6 @@ ${DSTDIR}/charprop.el: unidata-gen.elc unidata.txt
cd ${DSTDIR}; \
${RUNEMACS} -batch --load $${ELC} -f unidata-gen-files $${DATADIR} $${DATA}
../../src/biditype.h: UnicodeData.txt
gawk -F";" -f biditype.awk $< > $@
../../src/bidimirror.h: BidiMirroring.txt
gawk -F"[; ]+" -f bidimirror.awk $< > $@
install: charprop.el
cp charprop.el ${DSTDIR}
cp `sed -n 's/^;; FILE: //p' < charprop.el` ${DSTDIR}
......
# Generate data for bidi_mirroring_table, see src/bidi.c:bidi_initialize.
# Copyright (C) 2010-2011 Free Software Foundation, Inc.
# 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 <http://www.gnu.org/licenses/>.
# Written by Eli Zaretskii <eliz@gnu.org>
BEGIN {
printf " struct {\n int from, to;\n } bidi_mirror[] = {\n";
first = 1;
}
$1 !~ /^#/ && NF >= 2 {
if (!first)
printf ",\n";
else
first = 0;
printf "\t{ 0x%s, 0x%s }", $1, $2;
}
END {
printf " };\n";
}
# Generate data for filling bidi_type_table, see src/bidi.c:bidi_initialize.
# Copyright (C) 2010-2011 Free Software Foundation, Inc.
# 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 <http://www.gnu.org/licenses/>.
# Written by Eli Zaretskii <eliz@gnu.org>
function trtype(type)
{
# Types are listed in the order of decresing use in UnicodeData.txt:
if (type == "ON")
return "NEUTRAL_ON";
else if (type == "NSM")
return "WEAK_NSM";
else if (type == "AL")
return "STRONG_AL";
else if (type == "R")
return "STRONG_R";
else if (type == "BN")
return "WEAK_BN";
else if (type == "EN")
return "WEAK_EN";
else if (type == "ET")
return "WEAK_ET";
else if (type == "AN")
return "WEAK_AN";
else if (type == "WS")
return "NEUTRAL_WS";
else if (type == "CS")
return "WEAK_CS";
else if (type == "ES")
return "WEAK_ES";
else if (type == "B")
return "NEUTRAL_B";
else if (type == "S")
return "NEUTRAL_S";
else if (type == "LRE" || type == "RLE" || type == "LRO" || type == "RLO" || type == "PDF")
return type;
else if (type == "L")
return "STRONG_L";
else
{
printf "Unknown type: %s\n", type > "/dev/stderr";
exit 1;
}
}
BEGIN {
otype = "";
startcode = "";
endcode = "";
printf " struct {\n int from, to;\n bidi_type_t type;\n } bidi_type[] = {\n";
first = 1;
}
{ code = $1;
ntype = $5;
if (ntype != otype)
{
# Don't output data for L, as that's the default value, see bidi.c.
if (otype != "L" && startcode != "")
{
if (!first)
printf ",\n";
else
first = 0;
printf "\t{ 0x%s, 0x%s, %s }", startcode, endcode, trtype(otype);
}
otype = ntype;
startcode = code;
endcode = code;
}
else
endcode = code;
}
END {
printf " };\n";
}
......@@ -29,7 +29,7 @@ EMACSLOADPATH = $(lisp);$(lisp)/international;$(lisp)/emacs-lisp
# Quote EMACS so it could be a file name with embedded whitespace
RUNEMACS = "$(EMACS)" -Q -batch
all: $(DSTDIR)/charprop.el ../../src/biditype.h ../../src/bidimirror.h
all: $(DSTDIR)/charprop.el
.el.elc:
$(RUNEMACS) -f batch-byte-compile $<
......@@ -51,16 +51,6 @@ charprop-CMD: unidata-gen.elc unidata.txt
${DSTDIR}/charprop.el: charprop-$(SHELLTYPE)
../../src/biditype.h: UnicodeData.txt
gawk -F";" -f biditype.awk -v BINMODE=2 $< > biditype.h
$(CP) biditype.h $@
$(DEL) biditype.h
../../src/bidimirror.h: BidiMirroring.txt
gawk -F"[; ]+" -f bidimirror.awk -v BINMODE=2 $< > bidimirror.h
$(CP) bidimirror.h $@
$(DEL) bidimirror.h
clean:
- $(DEL) unidata-gen.elc unidata.txt biditype.h bidimirror.h
2011-08-15 Eli Zaretskii <eliz@gnu.org>
* biditype.h: File removed.
* bidimirror.h: File removed.
* deps.mk (bidi.o): Remove biditype.h and
bidimirror.h.
* makefile.w32-in ($(BLD)/bidi.$(O)): Remove biditype.h and
bidimirror.h.
* dispextern.h: Fix a typo in the comment to bidi_type_t.
* chartab.c: Improve commentary for the uniprop_table API.
* bidi.c (bidi_paragraph_init): Support zero value of
bidi_ignore_explicit_marks_for_paragraph_level.
(bidi_initialize): Use uniprop_table instead of including
biditype.h and bidimirror.h.
* xdisp.c (move_it_in_display_line_to): Don't reset pixel
coordinates of the iterator when restoring from ppos_it.
......
......@@ -746,26 +746,18 @@ bidi_unshelve_cache (void *databuf, int just_free)
static void
bidi_initialize (void)
{
#include "biditype.h"
#include "bidimirror.h"
int i;
bidi_type_table = Fmake_char_table (Qnil, make_number (STRONG_L));
bidi_type_table = uniprop_table (intern ("bidi-class"));
if (NILP (bidi_type_table))
abort ();
staticpro (&bidi_type_table);
for (i = 0; i < sizeof bidi_type / sizeof bidi_type[0]; i++)
char_table_set_range (bidi_type_table, bidi_type[i].from, bidi_type[i].to,
make_number (bidi_type[i].type));
bidi_mirror_table = Fmake_char_table (Qnil, Qnil);
bidi_mirror_table = uniprop_table (intern ("mirroring"));
if (NILP (bidi_mirror_table))
abort ();
staticpro (&bidi_mirror_table);
for (i = 0; i < sizeof bidi_mirror / sizeof bidi_mirror[0]; i++)
char_table_set (bidi_mirror_table, bidi_mirror[i].from,
make_number (bidi_mirror[i].to));
Qparagraph_start = intern ("paragraph-start");
staticpro (&Qparagraph_start);
paragraph_start_re = Fsymbol_value (Qparagraph_start);
......
struct {
int from, to;
} bidi_mirror[] = {
{ 0x0028, 0x0029 },
{ 0x0029, 0x0028 },
{ 0x003C, 0x003E },
{ 0x003E, 0x003C },
{ 0x005B, 0x005D },
{ 0x005D, 0x005B },
{ 0x007B, 0x007D },
{ 0x007D, 0x007B },
{ 0x00AB, 0x00BB },
{ 0x00BB, 0x00AB },
{ 0x0F3A, 0x0F3B },
{ 0x0F3B, 0x0F3A },
{ 0x0F3C, 0x0F3D },
{ 0x0F3D, 0x0F3C },
{ 0x169B, 0x169C },
{ 0x169C, 0x169B },
{ 0x2039, 0x203A },
{ 0x203A, 0x2039 },
{ 0x2045, 0x2046 },
{ 0x2046, 0x2045 },
{ 0x207D, 0x207E },
{ 0x207E, 0x207D },
{ 0x208D, 0x208E },
{ 0x208E, 0x208D },
{ 0x2208, 0x220B },
{ 0x2209, 0x220C },
{ 0x220A, 0x220D },
{ 0x220B, 0x2208 },
{ 0x220C, 0x2209 },
{ 0x220D, 0x220A },
{ 0x2215, 0x29F5 },
{ 0x223C, 0x223D },
{ 0x223D, 0x223C },
{ 0x2243, 0x22CD },
{ 0x2252, 0x2253 },
{ 0x2253, 0x2252 },
{ 0x2254, 0x2255 },
{ 0x2255, 0x2254 },
{ 0x2264, 0x2265 },
{ 0x2265, 0x2264 },
{ 0x2266, 0x2267 },
{ 0x2267, 0x2266 },
{ 0x2268, 0x2269 },
{ 0x2269, 0x2268 },
{ 0x226A, 0x226B },
{ 0x226B, 0x226A },
{ 0x226E, 0x226F },
{ 0x226F, 0x226E },
{ 0x2270, 0x2271 },
{ 0x2271, 0x2270 },
{ 0x2272, 0x2273 },
{ 0x2273, 0x2272 },
{ 0x2274, 0x2275 },
{ 0x2275, 0x2274 },
{ 0x2276, 0x2277 },
{ 0x2277, 0x2276 },
{ 0x2278, 0x2279 },
{ 0x2279, 0x2278 },
{ 0x227A, 0x227B },
{ 0x227B, 0x227A },
{ 0x227C, 0x227D },
{ 0x227D, 0x227C },
{ 0x227E, 0x227F },
{ 0x227F, 0x227E },
{ 0x2280, 0x2281 },
{ 0x2281, 0x2280 },
{ 0x2282, 0x2283 },
{ 0x2283, 0x2282 },
{ 0x2284, 0x2285 },
{ 0x2285, 0x2284 },
{ 0x2286, 0x2287 },
{ 0x2287, 0x2286 },
{ 0x2288, 0x2289 },
{ 0x2289, 0x2288 },
{ 0x228A, 0x228B },
{ 0x228B, 0x228A },
{ 0x228F, 0x2290 },
{ 0x2290, 0x228F },
{ 0x2291, 0x2292 },
{ 0x2292, 0x2291 },
{ 0x2298, 0x29B8 },
{ 0x22A2, 0x22A3 },
{ 0x22A3, 0x22A2 },
{ 0x22A6, 0x2ADE },
{ 0x22A8, 0x2AE4 },
{ 0x22A9, 0x2AE3 },
{ 0x22AB, 0x2AE5 },
{ 0x22B0, 0x22B1 },
{ 0x22B1, 0x22B0 },
{ 0x22B2, 0x22B3 },
{ 0x22B3, 0x22B2 },
{ 0x22B4, 0x22B5 },
{ 0x22B5, 0x22B4 },
{ 0x22B6, 0x22B7 },
{ 0x22B7, 0x22B6 },
{ 0x22C9, 0x22CA },
{ 0x22CA, 0x22C9 },
{ 0x22CB, 0x22CC },
{ 0x22CC, 0x22CB },
{ 0x22CD, 0x2243 },
{ 0x22D0, 0x22D1 },
{ 0x22D1, 0x22D0 },
{ 0x22D6, 0x22D7 },
{ 0x22D7, 0x22D6 },
{ 0x22D8, 0x22D9 },
{ 0x22D9, 0x22D8 },
{ 0x22DA, 0x22DB },
{ 0x22DB, 0x22DA },
{ 0x22DC, 0x22DD },
{ 0x22DD, 0x22DC },
{ 0x22DE, 0x22DF },
{ 0x22DF, 0x22DE },
{ 0x22E0, 0x22E1 },
{ 0x22E1, 0x22E0 },
{ 0x22E2, 0x22E3 },
{ 0x22E3, 0x22E2 },
{ 0x22E4, 0x22E5 },
{ 0x22E5, 0x22E4 },
{ 0x22E6, 0x22E7 },
{ 0x22E7, 0x22E6 },
{ 0x22E8, 0x22E9 },
{ 0x22E9, 0x22E8 },
{ 0x22EA, 0x22EB },
{ 0x22EB, 0x22EA },
{ 0x22EC, 0x22ED },
{ 0x22ED, 0x22EC },
{ 0x22F0, 0x22F1 },
{ 0x22F1, 0x22F0 },
{ 0x22F2, 0x22FA },
{ 0x22F3, 0x22FB },
{ 0x22F4, 0x22FC },
{ 0x22F6, 0x22FD },
{ 0x22F7, 0x22FE },
{ 0x22FA, 0x22F2 },
{ 0x22FB, 0x22F3 },
{ 0x22FC, 0x22F4 },
{ 0x22FD, 0x22F6 },
{ 0x22FE, 0x22F7 },
{ 0x2308, 0x2309 },
{ 0x2309, 0x2308 },
{ 0x230A, 0x230B },
{ 0x230B, 0x230A },
{ 0x2329, 0x232A },
{ 0x232A, 0x2329 },
{ 0x2768, 0x2769 },
{ 0x2769, 0x2768 },
{ 0x276A, 0x276B },
{ 0x276B, 0x276A },
{ 0x276C, 0x276D },
{ 0x276D, 0x276C },
{ 0x276E, 0x276F },
{ 0x276F, 0x276E },
{ 0x2770, 0x2771 },
{ 0x2771, 0x2770 },
{ 0x2772, 0x2773 },
{ 0x2773, 0x2772 },
{ 0x2774, 0x2775 },
{ 0x2775, 0x2774 },
{ 0x27C3, 0x27C4 },
{ 0x27C4, 0x27C3 },
{ 0x27C5, 0x27C6 },
{ 0x27C6, 0x27C5 },
{ 0x27C8, 0x27C9 },
{ 0x27C9, 0x27C8 },
{ 0x27D5, 0x27D6 },
{ 0x27D6, 0x27D5 },
{ 0x27DD, 0x27DE },
{ 0x27DE, 0x27DD },
{ 0x27E2, 0x27E3 },
{ 0x27E3, 0x27E2 },
{ 0x27E4, 0x27E5 },
{ 0x27E5, 0x27E4 },
{ 0x27E6, 0x27E7 },
{ 0x27E7, 0x27E6 },
{ 0x27E8, 0x27E9 },
{ 0x27E9, 0x27E8 },
{ 0x27EA, 0x27EB },
{ 0x27EB, 0x27EA },
{ 0x27EC, 0x27ED },
{ 0x27ED, 0x27EC },
{ 0x27EE, 0x27EF },
{ 0x27EF, 0x27EE },
{ 0x2983, 0x2984 },
{ 0x2984, 0x2983 },
{ 0x2985, 0x2986 },
{ 0x2986, 0x2985 },
{ 0x2987, 0x2988 },
{ 0x2988, 0x2987 },
{ 0x2989, 0x298A },
{ 0x298A, 0x2989 },
{ 0x298B, 0x298C },
{ 0x298C, 0x298B },
{ 0x298D, 0x2990 },
{ 0x298E, 0x298F },
{ 0x298F, 0x298E },
{ 0x2990, 0x298D },
{ 0x2991, 0x2992 },
{ 0x2992, 0x2991 },
{ 0x2993, 0x2994 },
{ 0x2994, 0x2993 },
{ 0x2995, 0x2996 },
{ 0x2996, 0x2995 },
{ 0x2997, 0x2998 },
{ 0x2998, 0x2997 },
{ 0x29B8, 0x2298 },
{ 0x29C0, 0x29C1 },
{ 0x29C1, 0x29C0 },
{ 0x29C4, 0x29C5 },
{ 0x29C5, 0x29C4 },
{ 0x29CF, 0x29D0 },
{ 0x29D0, 0x29CF },
{ 0x29D1, 0x29D2 },
{ 0x29D2, 0x29D1 },
{ 0x29D4, 0x29D5 },
{ 0x29D5, 0x29D4 },
{ 0x29D8, 0x29D9 },
{ 0x29D9, 0x29D8 },
{ 0x29DA, 0x29DB },
{ 0x29DB, 0x29DA },
{ 0x29F5, 0x2215 },
{ 0x29F8, 0x29F9 },
{ 0x29F9, 0x29F8 },
{ 0x29FC, 0x29FD },
{ 0x29FD, 0x29FC },
{ 0x2A2B, 0x2A2C },
{ 0x2A2C, 0x2A2B },
{ 0x2A2D, 0x2A2E },
{ 0x2A2E, 0x2A2D },
{ 0x2A34, 0x2A35 },
{ 0x2A35, 0x2A34 },
{ 0x2A3C, 0x2A3D },
{ 0x2A3D, 0x2A3C },
{ 0x2A64, 0x2A65 },
{ 0x2A65, 0x2A64 },
{ 0x2A79, 0x2A7A },
{ 0x2A7A, 0x2A79 },
{ 0x2A7D, 0x2A7E },
{ 0x2A7E, 0x2A7D },
{ 0x2A7F, 0x2A80 },
{ 0x2A80, 0x2A7F },
{ 0x2A81, 0x2A82 },
{ 0x2A82, 0x2A81 },
{ 0x2A83, 0x2A84 },
{ 0x2A84, 0x2A83 },
{ 0x2A8B, 0x2A8C },
{ 0x2A8C, 0x2A8B },
{ 0x2A91, 0x2A92 },
{ 0x2A92, 0x2A91 },
{ 0x2A93, 0x2A94 },
{ 0x2A94, 0x2A93 },
{ 0x2A95, 0x2A96 },
{ 0x2A96, 0x2A95 },
{ 0x2A97, 0x2A98 },
{ 0x2A98, 0x2A97 },
{ 0x2A99, 0x2A9A },
{ 0x2A9A, 0x2A99 },
{ 0x2A9B, 0x2A9C },
{ 0x2A9C, 0x2A9B },
{ 0x2AA1, 0x2AA2 },
{ 0x2AA2, 0x2AA1 },
{ 0x2AA6, 0x2AA7 },
{ 0x2AA7, 0x2AA6 },
{ 0x2AA8, 0x2AA9 },
{ 0x2AA9, 0x2AA8 },
{ 0x2AAA, 0x2AAB },
{ 0x2AAB, 0x2AAA },
{ 0x2AAC, 0x2AAD },
{ 0x2AAD, 0x2AAC },
{ 0x2AAF, 0x2AB0 },
{ 0x2AB0, 0x2AAF },
{ 0x2AB3, 0x2AB4 },
{ 0x2AB4, 0x2AB3 },
{ 0x2ABB, 0x2ABC },
{ 0x2ABC, 0x2ABB },
{ 0x2ABD, 0x2ABE },
{ 0x2ABE, 0x2ABD },
{ 0x2ABF, 0x2AC0 },
{ 0x2AC0, 0x2ABF },
{ 0x2AC1, 0x2AC2 },
{ 0x2AC2, 0x2AC1 },
{ 0x2AC3, 0x2AC4 },
{ 0x2AC4, 0x2AC3 },
{ 0x2AC5, 0x2AC6 },
{ 0x2AC6, 0x2AC5 },
{ 0x2ACD, 0x2ACE },
{ 0x2ACE, 0x2ACD },
{ 0x2ACF, 0x2AD0 },
{ 0x2AD0, 0x2ACF },
{ 0x2AD1, 0x2AD2 },
{ 0x2AD2, 0x2AD1 },
{ 0x2AD3, 0x2AD4 },
{ 0x2AD4, 0x2AD3 },
{ 0x2AD5, 0x2AD6 },
{ 0x2AD6, 0x2AD5 },
{ 0x2ADE, 0x22A6 },
{ 0x2AE3, 0x22A9 },
{ 0x2AE4, 0x22A8 },
{ 0x2AE5, 0x22AB },
{ 0x2AEC, 0x2AED },
{ 0x2AED, 0x2AEC },
{ 0x2AF7, 0x2AF8 },
{ 0x2AF8, 0x2AF7 },
{ 0x2AF9, 0x2AFA },
{ 0x2AFA, 0x2AF9 },
{ 0x2E02, 0x2E03 },
{ 0x2E03, 0x2E02 },
{ 0x2E04, 0x2E05 },
{ 0x2E05, 0x2E04 },
{ 0x2E09, 0x2E0A },
{ 0x2E0A, 0x2E09 },
{ 0x2E0C, 0x2E0D },
{ 0x2E0D, 0x2E0C },
{ 0x2E1C, 0x2E1D },
{ 0x2E1D, 0x2E1C },
{ 0x2E20, 0x2E21 },
{ 0x2E21, 0x2E20 },
{ 0x2E22, 0x2E23 },
{ 0x2E23, 0x2E22 },
{ 0x2E24, 0x2E25 },
{ 0x2E25, 0x2E24 },
{ 0x2E26, 0x2E27 },
{ 0x2E27, 0x2E26 },
{ 0x2E28, 0x2E29 },
{ 0x2E29, 0x2E28 },
{ 0x3008, 0x3009 },
{ 0x3009, 0x3008 },
{ 0x300A, 0x300B },
{ 0x300B, 0x300A },
{ 0x300C, 0x300D },
{ 0x300D, 0x300C },
{ 0x300E, 0x300F },
{ 0x300F, 0x300E },
{ 0x3010, 0x3011 },
{ 0x3011, 0x3010 },
{ 0x3014, 0x3015 },
{ 0x3015, 0x3014 },
{ 0x3016, 0x3017 },
{ 0x3017, 0x3016 },
{ 0x3018, 0x3019 },
{ 0x3019, 0x3018 },
{ 0x301A, 0x301B },
{ 0x301B, 0x301A },
{ 0xFE59, 0xFE5A },
{ 0xFE5A, 0xFE59 },
{ 0xFE5B, 0xFE5C },
{ 0xFE5C, 0xFE5B },
{ 0xFE5D, 0xFE5E },
{ 0xFE5E, 0xFE5D },
{ 0xFE64, 0xFE65 },
{ 0xFE65, 0xFE64 },
{ 0xFF08, 0xFF09 },
{ 0xFF09, 0xFF08 },
{ 0xFF1C, 0xFF1E },
{ 0xFF1E, 0xFF1C },
{ 0xFF3B, 0xFF3D },
{ 0xFF3D, 0xFF3B },
{ 0xFF5B, 0xFF5D },
{ 0xFF5D, 0xFF5B },
{ 0xFF5F, 0xFF60 },
{ 0xFF60, 0xFF5F },
{ 0xFF62, 0xFF63 },
{ 0xFF63, 0xFF62 } };
This diff is collapsed.
......@@ -1095,22 +1095,31 @@ map_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
/* Unicode character property tables.
This section provides a convenient and efficient way to get a
Unicode character property from C code (from Lisp, you must use
get-char-code-property).
This section provides a convenient and efficient way to get Unicode
character properties of characters from C code (from Lisp, you must
use get-char-code-property).
The typical usage is to get a char-table for a specific property at
a proper initialization time as this:
The typical usage is to get a char-table object for a specific
property like this (use of the "bidi-class" property below is just
an example):
Lisp_Object bidi_class_table = uniprop_table (intern ("bidi-class"));
and get a property value for character CH as this:
(uniprop_table can return nil if it fails to find data for the
named property, or if it fails to load the appropriate Lisp support
file, so the return value should be tested to be non-nil, before it
is used.)
Lisp_Object bidi_class = CHAR_TABLE_REF (CH, bidi_class_table);
To get a property value for character CH use CHAR_TABLE_REF:
Lisp_Object bidi_class = CHAR_TABLE_REF (bidi_class_table, CH);