Re: [code] I need help adding a language-specific snippet

From: Russell Dickenson <russelldickenson.att.gmail.com>
Date: Wed, 8 May 2013 12:44:09 +1000

Mitchell,

On 8 May 2013 12:12, Mitchell <m.att.foicica.com> wrote:

> Russell,
>
> On Wed, 8 May 2013, Russell Dickenson wrote:
>
> Mitchell,
>>
>> You state "Note: under normal circumstances, nobody should be creating an
>> *init.lua* and a *post_init.lua*. The latter is to take advantage of
>> existing functionality. The former is for creating non-existant
>> functionality."
>>
>> So....
>> init.lua is used to *replace* an existing Textadept module's
>> post_init.lua is used to *supplement* an existing Textadept module
>>
>> In my case, where I want to define additional snippets which apply only to
>> files of type "XML", I create a module post_init.lua, with the code we
>> agreed on earlier in this thread, and name it "post_init.lua", stored in
>> <home>/.textadept/modules/xml (on Linux). This module is run *after*
>> existing Textadept module.
>>
>
> This is incorrect. Textadept does NOT have an existing XML
> language-specific module. Therefore, if you want XML-specific
> functionality, you have to create a module, even if it's as simple as
> adding an XML-specific snippet. Creating that module means creating
> *init.lua*, not *post_init.lua*.
>

OK, now I understand. Since Textadept has *no* XML-specific module and I
want to create one, I need to name it "init.lua", otherwise Lua won't
recognise it. If I was wanting to tweak an existing Textadept module,
perhaps adding a feature, then I would name the file "post_init.lua".

>
> This must be very frustrating for you. It's unfortunate that in this case
> Textadept adheres to the Lua concept of modules, the knowledge of which
> would aid in more easily understanding the inner workings of Textadept.

Not nearly as frustrating as it must be for you! :( Thankyou so much for
your patience in explaining all this. It's evident I need to do "Lua 101"
via self-study.

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Tue 07 May 2013 - 22:44:09 EDT

This archive was generated by hypermail 2.2.0 : Wed 08 May 2013 - 06:53:28 EDT