Re: Lua Rocks

From: Robert <>
Date: Tue, 15 Jun 2010 18:19:47 +0200

On Tue, Jun 15, 2010 at 12:45 AM, mitchell <> wrote:
> Now that I committed a change that creates a user init.lua
> automatically, what else extension-wise needs to be addressed?
> Mitchell

I think it would be very good to rely as little as possible on people
putting things in the correct order and not to autoload anything.
I would suggest to remove the autoloading of key_commands.lua and
snippets.lua and leaving
require 'textadept' on top of the init.lua.
Then, all simplifying of loading extensions could be left to the user.
Everything in init.lua, user_dofiles, automatic loading of modules...
Extension authors could add key commands directly in their module (and
only advanced users would have to change them) or give the
instructions to put some lines with the key commands at the end of
init.lua and it will just work.
Now it really takes great consideration to implement user-based
auto-loading (see my attached init.lua example earlier, load default
modules but not key_commands, load common modules, load key_commands,
load user_files but not key_commands or snippets again.) - with my
above suggestions, that would be

require 'textadept'
require 'common' -- with autoloading in modules/common/init.lua

user_dofile('snippets.lua') -- or as a loop

If one of the the common modules tried to override default key
bindings there would be no problem.

If extension authors included (default) key commands in their modules
extending Textadept would then be as simple as telling them to
download init.lua (with autoloading of other common submodules) to
modules/common/ once and add
require 'common'
to init.lua
Then further submodules could just be dropped into modules/common, no
further steps necessary. Advanced users could of course remove the key

Received on Tue 15 Jun 2010 - 12:19:47 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:46:00 EST