summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/char-tex.lmt
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkxl/char-tex.lmt')
-rw-r--r--tex/context/base/mkxl/char-tex.lmt36
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