Hi, Well, it is friday, so ... the new snapshot has the following changes compared to 20060915: * The texio table has gained a new function: tex_file = texio.open(filename) returns a file handle of a type that luatex can use internally (the return of io.open is unusable in callbacks because it will be garbage-collected at a random time) * In related news, there are two new callbacks you can define: callback.register('open_read_file', f) callback.register('open_write_file', f) where your function should have the following conventions: function f (number id_number, string asked_name) return boolean success, string actual_name, tex_file filep end id_number: zero for the log or \input files or TeX's \read number incremented by one (\read0 becomes 1). asked_name: the user-supplied filename success: return false for error, true otherwise. The remaining two items are only looked at if you return true: actual_name: the true filename used (with extension!) filep: a file object opened though texio.open() * The tex.print function has an extra optional parameter: tex.print(ctt_id n, strings ...) This prints the strings using the catcode regime defined by \catcodetable n (assuming n is valid, see below) * The new function tex.sprint has the same lua conventions as tex.print, but behaces slightly different on the tex side: ** tex does not switch to the 'new_line' state (this implies that leading spaces are not ignored) ** no \endlinechars are inserted ** trailing spaces are not removed from the argument * Catcode tables are a completely new feature, that allows you to switch the current catcode regime in one simple statement: \catcodetable <count> Switches to the use of a different set of catcodes (table), that is stored under the number <count>. Such a table has to be previously created using one of the two command below, or the number 0 (which is pre-inititialized) This command obeys normal grouping rules. \initcatcodetable <count> creates a new, global, independent catcode table with catcodes matching the code that are predefined by initex (tex -ini). This allocation is global \savecatcodetable <count> copies the current set of catcodes to a new, global, table with id number <count>. The definitions in this new table are all treated as if they were made in the outermost level. This allocation is global At the end of each grouping level, items within all existing catcodetables are restored, regardless of which one is the currently active table. Catcode table numbers cannot be larger than 0xFFFFFFF (2^28-1) * There is a new lua table: lua. It contains three read-only items: lua.id -- the id number of the instance lua.version -- a luatex version identifier string lua.startupfile -- the full filename (+path) of startup.lua and it also contains a read/write array: lua.bytecode[] -- lua executable bytecode This array can be used to save and restore lua functions across lua states. The accepted values are for assignments are functions and nil. Likewise, the retrieved value is either a function or nil. The contents of the lua.bytecode array is stored inside the format file, so it can also be used to preload lua code. * The format files are quire a bit smaller than before Have fun, Taco Downloading and installation details: If you go to https://foundry.supelec.fr/frs/?group_id=10 you will see that there are two new released files: * luatex-snapshot-20060922.tar.gz This is the source tree. * luatex-snapshot-20060922-win32.zip A cross-compiled (mingw) windows binary. This is a web2c based binary, so it needs a texmf.cnf file (It will NOT work if you have only miktex installed). This executable cannot run dynamically loaded lua dlls. Perhaps that can be fixed but I do not know how.
participants (1)
-
Taco Hoekwater