What should be taken into account to convert the following three commands to \directlua so, that they will behave the same way? If you're making a new luatex version of cwebmac.tex anyway, my suggestion would be to simply remove (ignore) the curious \expandafter in the new file and see if any problematic situation arises. -k