Re: [textadept] Modifications to language modules

From: Robert <ro....at.web.de>
Date: Wed, 1 Jun 2011 13:17:40 +0200

On Wed, Jun 1, 2011 at 8:44 AM, mitchell <c....at.caladbolg.net> wrote:
> Robert,
>
> On Tue, 31 May 2011, Robert wrote:
>
>> On Fri, May 20, 2011 at 4:45 PM, Robert <ro....at.web.de> wrote:
>>>>
>>>> On Fri, May 20, 2011 at 10:32 AM, Robert <ro....at.web.de> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> since it took me a moment to remember that I already had a javascript
>>>>> module in my
>>>>> userhome and Brian's new release wants to be installed in TA's home
>>>>> directory I wondered
>>>>> whether there might be a way to make it easier to enhance language
>>>>> modules.
>>>>> How about having a "user/init.lua" file instead of post_init.lua?
>>>>> Additional user api and tags
>>>>> files could be put there as well. That way all modules could be
>>>>> installed in userhome.
>>>>> I have different versions of TA installed, built from hg, the latest
>>>>> stable, so I right now I have to
>>>>> copy around the latest modules.
>>>>> Likely, in the future the language modules will not see as many
>>>>> updates as TA, so they could
>>>>> be updated independently.
>>>>>
>>>>> Robert
>>>
>>>
>>
>> Here's another point why it might be worth relocating the official
>> modules. On Mac OS X
>> TA comes in a deeply nested app bundle, technically it's just a
>> folder, but I think users don't typically like to hack around in
>> these.
>> So how about having a structure like:
>> ~/.textadept/modules
>>  hypertext
>>   init.lua
>>   api
>>   tags
>>   /user
>>     init.lua -- loaded instead of post_init.lua
>>     api
>>     tags
>
> I haven't completely thought this out, but why not have a
> ~/.textadept/modules/hypertext/user/ folder and in post_init.lua have
> "require 'hypertext/user/init.lua'" ?

That's of course possible, but an advantage of loading
~/.textadept/modules/hypertext/user/init.lua instead of hypertext/post_init.lua
is, that for modules which are installed in ~/.textadept/modules all
modifications are within
the 'user' sub-directory.

>
> I don't want modules to have to be installed in _USERHOME. In the future I
> might want to bundle modules with the official packages instead of
> separately and they would have to go in _HOME. I also don't like the idea of
> "autoloading" a user/ directory in a modules/ directory;
That's not what I meant, sorry If I described it badly. I only would replace
post_init.lua with user/init.lua for each module.

>I'd rather have it
> explicitly loaded to minimize confusion. Plus, what if user3 liked your
> hypertext module, placed it in user/, but had their own additions? Where
> would it be kept? In user/user/? With explicit loading you can have
> ~/.textadept/modules/hypertext/{user2,user3}/ and load them both from a
> post_init.lua.
>
> mitchell

At the moment some modules need to be installed in _HOME, some in
_USERHOME. This could be confusing for people new to TA. Having these
'user' (or some other name) sub-directories for each module would make
it possible to install your modules in _USERHOME and have additional
api info in 'user'. If you decide to distribute a module with TA
nothing would have to change.

Robert
Received on Wed 01 Jun 2011 - 07:17:40 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:08:13 EST