Re: What's required in a personal init.lua?

From: phayz <russelldicken....at.gmail.com>
Date: Wed, 31 Mar 2010 16:57:19 -0700 (PDT)

On Mar 31, 10:48 am, mitchell <mforal.n....at.gmail.com> wrote:
> Russell,
>
>
>
> > I'm utterly confused about what's required in a personal init.lua. The
> > manual states -
>
> > "After loading the core modules, Textadept begins loading additional
> > modules. It first checks for a ~/.textadept/init.lua user module. If
> > the module is found, it is run and skips loading the default modules
> > specified in init.lua. Otherwise a mixture of core extension and
> > generic modules are loaded.
>
> > After loading the additional modules, Textadept parses command line
> > arguments, or if none are specified, reloads the last saved session."
>
> > I simply don't understand this. It first seems to say that if a
> > personal init.lua is found, it doesn't load the init.lua which is
> > distributed with Textadept. However it goes on to say "Otherwise a
> > mixture of core extension and generic modules are loaded." I have
> > looked over some of Textadept's code and it appears that does a
> > regular expression search for modules, loading those it finds.
>
> > To put my question in concrete terms, I will give an example. I want
> > to use the Bufferutils module, so I download the file bufferutils.lua
> > from the Textadept wiki and save it to ~/.textadept/modules (albeit
> > under Windows). I then create an EMPTY init.lua - ~/.textadept/
> > init.lua and add the line "require 'bufferutils' ". When I run
> > Textadept I get the following text appear in a GTK (?) error dialog
> > box: "C:\z\downloads\textadept/init.lua:19: C:\z\downloads\textadept/
> > modules/bufferutils.lua:91: attempt to index local 'keys' (a nil
> > value)". However if I add this line to the init.lua file distributed
> > with Textadept I don't get any error message and the expected
> > functionality works as expected.
>
> > Where am I going wrong?
>
> init.lua has been confusing for a while. I have added additional
> documentation here:
>
> http://caladbolg.net/luadoc/textadept2/manual/6_Startup.html
>
> I hope that clears things up. If you have more questions, please ask.
>
> Mitchell

Mitchell,

THANK YOU! That added information does answer my questions. Having
read it I have successfully created a personal init.lua which no
longer has Textadept producing error messages. I am slowly coming to
understand, appreciate and admire Textadept. This translates as
"Thanks, but be prepared for more noob questions."

Regards,

Russell Dickenson
Received on Wed 31 Mar 2010 - 19:57:19 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:41:44 EST