Re: Lua Rocks

From: Robert <>
Date: Fri, 14 May 2010 12:34:47 +0200

On Fri, May 14, 2010 at 10:37 AM, Jay <> wrote:
> Yeah, you're probably right this should work as well, and it's
> easier :)
> Using lfs to get all the files makes things makes things easier than
> having to add requires each time. And modules/common does seem like a
> good candidate for this

The snippets I posted are basically the ones used for generating the
lexer list in mime_types.lua.So there it works very well.

I'm not sure if it would be good (as I proposed) to mix modules and
files that basically add to tables like "keys" or "snippets", maybe
having a place for them would be better. "userfiles", "dofiles"...?
Alternatively, maybe any .lua file in ./textadept could be run trough
user_dofile. Currently there is init.lua, "session"and, if you have
one of those, mime_types.conf, "theme", snippets.lua and
Then, you would only need an init.lua if you don't want to load a
module (like menu) and this would not change the current behaviour
with the loading of ~/.textadept/snippets.lua and
So in ta's init.lua after loading the core extension modules

local lfs = require 'lfs'
for f in lfs.dir(_USERHOME..'/modules/common/') do
  if f:find('%.lua$') then

for f in lfs.dir(_USERHOME) do
  if f:find('%.lua$') and f ~= 'init.lua' then

That way user key_commands would get loaded after the functions have
been defined in modules/common. I attached a patch file, if anyone
would like to try this out. I don't know maybe there are unwanted side
effects. The ~/.textadept directory is on the package path as well,
I'm not sure if that could be a problem, probably only if you put a
file called textadept.lua there.


You received this message because you are subscribed to the Google Groups "textadept" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Received on Fri 14 May 2010 - 06:34:47 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:45:48 EST