That commit overlooked the tstring_concat_aux function in
lua_common.cpp, a helper function for tstring concatenation. This
caused lua errors when HttT was started, arising in the code to
display objectives.
This commit fixes up the tstring_concat_aux function to more
directly check the tstring type.
It also fixes luaW_totstring and luaW_toconfig so that they don't
immediately flag a type error if they fail to convert userdata to
a tstring... this was caused by inappropriately using
luaL_checkudata when luaL_testudata should be used.
In lua 5.0, the preferred way to define custom metatables is to
use registry keys defined by pushing pointers as lightuserdata to
lua. (These pointers can be pointers to arbitrary constant objects,
as long as they are unique.)
In lua 5.2, the preferred way is to use constant strings as the
registry indices, and several lua API functions are introduced:
"luaL_newmetatable, luaL_setmetatable, luaL_checkudata,
luaL_testudata" which greatly simplify the operations for creating
the metatable, assigning it to a userdata, and checking if the
userdata has that type.
This commit switches over the keys associated to textdomains,
translatable strings, vconfigs, and lua gui2 dialogs to use the
new style, and simplifies some of the implementation details in
the process. For instance, luaW_toconfig no longer has to have an
optional argument to an index on the stack where the tstring
metatable is... these details are handled by the lua API instead.
This includes the gettext and vconfig impl functions, and many
macros used to write lua callbacks. This code can't properly go in
the lua_kernel_base files, so it goes here.