diff options
author | Hans Hagen <pragma@wxs.nl> | 2022-08-25 17:57:42 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2022-08-25 17:57:42 +0200 |
commit | a389a16197fed7803672a8e16fd31d634725d49a (patch) | |
tree | ff79e88e68f213d0a226f57caa23809e720d3c5c /tex/context/base/mkxl/char-tex.lmt | |
parent | 178de9556e3cb519672f9b54db7b5b29eec43c69 (diff) | |
download | context-a389a16197fed7803672a8e16fd31d634725d49a.tar.gz |
2022-08-25 17:40:00
Diffstat (limited to 'tex/context/base/mkxl/char-tex.lmt')
-rw-r--r-- | tex/context/base/mkxl/char-tex.lmt | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/tex/context/base/mkxl/char-tex.lmt b/tex/context/base/mkxl/char-tex.lmt index 3d8f6a259..e5ce1c4ab 100644 --- a/tex/context/base/mkxl/char-tex.lmt +++ b/tex/context/base/mkxl/char-tex.lmt @@ -770,24 +770,36 @@ if not csletters then storage.register("characters/csletters", csletters, "characters.csletters") end + local function setname(category,chr,u,contextname) + if is_character[category] then + if chr.unicodeslot < 128 then + if is_letter[category] then + texsetmacro(contextname,utfchar(u),"immutable") + else + texsetchar(contextname,u,"immutable") + end + else + texsetmacro(contextname,utfchar(u),"immutable") + end + elseif is_command[category] and not forbidden[u] then + texsetmacro(contextname,utfchar(u),"immutable") + end + end + function characters.setcharacternames(ctt) for u, chr in next, data do -- will move up local contextname = chr.contextname + local contextspec = chr.contextspec local category = chr.category - local isletter = is_letter[category] if contextname then - if is_character[category] then - if chr.unicodeslot < 128 then - if isletter then - texsetmacro(contextname,utfchar(u),"immutable") - else - texsetchar(contextname,u,"immutable") - end - else - texsetmacro(contextname,utfchar(u),"immutable") + setname(category,chr,u,contextname) + end + if contextspec then + for i=1,#contextspec do + local extraname = contextspec[i] + if extraname ~= contextname then + setname(category,chr,u,extraname) end - elseif is_command[category] and not forbidden[u] then - texsetmacro(contextname,utfchar(u),"immutable") end end end |