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

From: Russell Dickenson <russelldickenson.att.gmail.com>
Date: Wed, 8 May 2013 06:23:01 +1000

Mitchell,

Ah, thankyou for explaining the role of "init.lua". I should have pointed
out at the start that I had started from a clean, fresh installation of
Textadept and so had no customisation alrready in place. I *do* intend
making use of an XML tag auto-closure script/module but I am taking baby
steps at the moment. The aim of enabling XML-specific has been to
understand a little better how Textadept works, rather than my previous
"cut-and-paste" approach.

Can you give me a sample use case for a "post_init.lua" file? In the wiki
an example is given of language-specific snippets, the task I took as my
"Textadept 101" test. I can't understand why anyone would create an
init.lua and post_init.lua file.

On 7 May 2013 23:02, Mitchell <m.att.foicica.com> wrote:

> Russell,
>
>
> On Tue, 7 May 2013, Russell Dickenson wrote:
>
> Mitchell,
>>
>> [snip]
>>
>>
>> Before advancing too far I need to have one point clarified: the use of
>> "post_init.lua". When I was first trying to enable the XML-specific
>> snippet, I thought that I should be using "post_init.lua" but that wasn't
>> working so instead I switched to "init.lua". Can you please clarify if I
>> have the right configuration according to my goals? In future I intend
>> enabling buffer-specific properties, such as word-wrap etc, so I want to be
>> sure I am defining these in the right place.
>>
>
> Sure. When you want to customize the behavior for specific languages, you
> would normally create a language specific module in your
> *~/.textadept/modules/[lang]/* folder. Such a module needs to have an
> *init.lua* file (this is standard Lua practice) that is run when Textadept
> loads the module. Even if that directory exists, Textadept will not
> recognize it as a module unless it has an *init.lua* in it. Only when such
> a module is detected does Textadept then run a *post_init.lua* file. In
> your case, no XML module was detected so your *post_init.lua* file was
> never run.
>
> That said, I saw you were interested in someone's XML module. If you were
> to download it and put it in your *~/.textadept/modules/xml/* folder, and
> if you had a *post_init.lua* file with that snippet, then it would load
> properly. However, it seems that you did not download the module and your
> xml/ directory was empty, hence why you needed *init.lua* instead of
> *post_init.lua*.
>
> I hope this helps.
>
>
> Cheers,
> Mitchell
> --
> 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.
>
>

-- 
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 - 16:23:01 EDT

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