Re: [code] [textadept] Textadept 8.0 alpha

From: Chris Emerson <>
Date: Tue, 14 Apr 2015 00:04:47 +0100

Hi Mitchell,

On Mon, Apr 13, 2015 at 11:21:19AM -0400, Mitchell wrote:
[Error on require'lfs' in luajit]
> It appears to have been introduced in lfs 1.6.2, at least 9 months
> ago, but I'm not sure how. I don't know enough about Lua 5.1/LuaJITs
> module architecture to fix this.
> If anyone can supply a patch (probably against lfs itself), I'll
> commit it to Textadept's build process.

The following (which effectively undoes one of the changes from 1.6.2 for
LuaJIT) works for me:

--- lfs_new.c 2015-04-13 23:59:13.753907722 +0100
+++ lua/src/lib/lfs.c 2015-04-13 23:57:40.646725316 +0100
@@ -890,9 +890,13 @@
 int luaopen_lfs (lua_State *L) {
         dir_create_meta (L);
         lock_create_meta (L);
+#if LUA_VERSION_NUM < 502
+ luaL_register(L, "lfs", fslib);
         luaL_newlib (L, fslib);
         lua_pushvalue(L, -1);
         lua_setglobal(L, LFS_LIBNAME);
         set_info (L);
         return 1;

It looks like luaL_register() with a non-NULL second argument is what sets
up package.loaded (making require work) on LuaJIT.

I noticed that at least utf8 has the same issue in textadeptjit-curses, but
it's too late for me to look into it right now. :-) I suspect it'll be the
same kind of thing.



You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Mon 13 Apr 2015 - 19:04:47 EDT

This archive was generated by hypermail 2.2.0 : Tue 14 Apr 2015 - 06:33:38 EDT