Re: [textadept] Modifications to language modules

From: mitchell <>
Date: Wed, 1 Jun 2011 09:19:45 -0400 (EDT)

On Wed, 1 Jun 2011, Robert wrote:

> On Wed, Jun 1, 2011 at 8:44 AM, mitchell <> wrote:
>> Robert,
>> On Tue, 31 May 2011, Robert wrote:
>>> On Fri, May 20, 2011 at 4:45 PM, Robert <> wrote:
>>> 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.

After reading this again and looking at the diffs you sent in a later
email, your suggestion seems like another "level" of loading user changes.
I would claim "an advantage of loading _USERHOME instead of _HOME is that
for modules which are installed in ~/.textadept/modules all modifications
are within the _USERHOME sub-directory." -- identical to your previous
statement but replacing your user/ dir. I certainly see where you are
coming from, juggling two modules in _USERHOME space, but if someone
wanted to juggle 3, then another suggestion would be for loading a
user/user/init.lua or user2/init.lua or usern/init.lua for n > 0. At this
point comes the question of how best to proceed. I stand by my original
suggestion of loading additional user modules via post_init.lua. This
makes the most sense to me:

1. I have my own hypertext module in _USERHOME which is different from the
    one in _HOME. I have modified all _HOME paths to _USERHOME in my
2. Now I want to include some fancy things from Robert's hypertext module.
    Rather than merging his stuff with mine (since presumably both of our
    versions are hg-controlled), I clone his repo into
    ~/.textadept/modules/hypertext/robert/ and modify his _HOME or
    _USERHOME paths to _USERHOME..'/modules/hypertext/robert/'. Then I
    create my post_init.lua file to load his module ("require
3. Some time later Robert fixes a bug in his module and I want to update
    my version. I simply go to robert/ and 'hg pull' his changes, which
    merge with the _HOME or _USERHOME path changes I made earlier, and I
    don't have to modify the same paths again.

There may of course be a fatal flaw in my thinking. Please do point it out
if so.


>> 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
> --
> You received this message because you are subscribed to the Google Groups "textadept" group.
> To post to this group, send email to
> To unsubscribe from this group, send email to
> For more options, visit this group at

Received on Wed 01 Jun 2011 - 09:19:45 EDT

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