Re: Command line args (was: API Changes)

From: mitchell <mforal.n....at.gmail.com>
Date: Fri, 18 Jun 2010 09:48:35 -0400

Hi Robert,

> From: Robert <ro....at.web.de>
> Date: Fri, Jun 18, 2010 at 7:25 AM
> Subject: Re: Command line args (was: API Changes)
> To: textadept.at.googlegroups.com
>
>
> On Thu, Jun 17, 2010 at 11:40 PM, mitchell <mforal.n....at.gmail.com> wrote:
>> Hi,
>>
>> I have just committed changes for dynamic command line argument
>> handling. Modules can implement and handle their own switches.
>> Documentation is here: http://caladbolg.net/luadoc/textadept3/modules/args.html
>>
>> See core/args.lua and modules/textadept/session.lua for examples.
>
> Awesome. I had wondered whether it would be possible to have dynamic
> commands like this.
>
>>
>> There is now support for changing _USERHOME from the command line
>> thanks to Robert.
>>
>
> Unfortunately, the _USERHOME is not saved in a reset. That's why I was
> processing the arguments again (I couldn't find another way).
> Not removing seems to work for userhome:
> Line 82 in core/args.lua
>  if (arg[i] == '-u' or arg[i] == '--userhome') and arg[i + 1] then
> --    userhome = table.remove(arg, i + 1)
> --    table.remove(arg, i)
>    userhome = arg[i+1]
>    break
>
> However, I think the reset problem would be the same for (potential)
> switches in user modules.
> Maybe the "process" function should be called every time and filenames
> be removed from the args list?
> Is it possible to use reset_before/reset_after events for passing
> information around?

The Lua state is destroyed and re-initialized inbetween reset_before
and reset_after events so no data can persist. I've attached a patch
that fixes the issue. I'll commit it later tonight. Thanks.

Mitchell

>
> Robert
>
> --
> You received this message because you are subscribed to the Google
> Groups "textadept" group.
> To post to this group, send email to textadept.at.googlegroups.com.
> To unsubscribe from this group, send email to
> textadept+unsubscribe.at.googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/textadept?hl=en.
>

Received on Fri 18 Jun 2010 - 09:48:35 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:48:19 EST