[luatex] Short command names and token.set_macro
Henri Menke
henrimenke at gmail.com
Tue Dec 10 21:28:39 CET 2019
That is probably a problem with the catcodes, but attempting to use
initex catcodes (catcodetable -1) results in a segmentation fault. I
reported that on the ConTeXt list:
https://mailman.ntg.nl/pipermail/ntg-context/2019/096532.html
Cheers, Henri
On 12/11/19 8:26 AM, Harald Hanche-Olsen wrote:
> Consider the following tex file:
>
> \directlua{require "foo"}
> \show\foo
> \bye
>
> where foo.lua is the single line
>
> token.set_macro("foo","\\,")
>
> When I run this, the result is as follows:
>
>> \foo=macro:
> ->BAD,.
>
> I understand how and why similar behaviour happens if \, is replaced by some command name that is NOT known from before, such as \foo. But \, IS known, so I had expected this to work. The same happens with any non-letter command name that I have tried. (I originally ran into this in lualatex, where I wanted to build a command expanding to a bunch of strings separated by \\, encoded as \\\\ in the lua strings of course.)
>
> Is it a bug, or have I misunderstood how this works?
>
> (This is with TL 2019 on a mac. Luatex 1.10.0.)
>
> – Harald
>
>
More information about the luatex
mailing list