Re: To do: enabling/disabling plugins separately from loading plugins

2015-05-05 Thread 'Terry Brown' via leo-editor
On Tue, 05 May 2015 09:24:59 -0400
Jacob Peck  wrote:

> On 5/5/2015 9:17 AM, 'Terry Brown' via leo-editor wrote:
> > Seems to me replacing the whole plugins list loses the current
> > capability of saying "in this outline I want my regular list of
> > plugins plus this one" - after the change you'd have to copy your
> > regular list of plugins, which would then not change when the list
> > in myLeoSettings changes.
> This use case is covered by mod_scripting.py's @plugin nodes.  So,
> you could add an '@plugin nodetags' node to load nodetags.py when the 
> outline loads, for example.

Ha, didn't know there was such a thing :-)

Thanks,
Cheers -Terry

> Currently, all loaded plugins affect all outlines, though, as far as
> I can tell...
> 
> -->Jake
> 

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: To do: enabling/disabling plugins separately from loading plugins

2015-05-05 Thread Edward K. Ream
On Tue, May 5, 2015 at 8:17 AM, 'Terry Brown' via leo-editor <
leo-editor@googlegroups.com> wrote:

Seems to me replacing the whole plugins list loses the current
> capability of saying "in this outline I want my regular list of plugins
> plus this one"


​Correct.​

Would it work to add a @bool clear_enabled_plugins


​One can imagine it, but it's not going to happen.  There is *no way* I'm
going to complicate settings further.

Thanks for all your comments. Clearly, I was mistaken about the idea's
appeal.  It will be filed under "Won't do".  Not a problem for me :-)

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: To do: enabling/disabling plugins separately from loading plugins

2015-05-05 Thread Edward K. Ream
On Tue, May 5, 2015 at 6:38 AM, john lunzer  wrote:

Here is the real bummer about this approach. Lets say I find a new plugin I
> really like. Now I have to go into every Leo file that has a custom
> @enabled-plugins node and add a new line to each
> ​.
>

​A valid point, but why have custom @enabled-plugins nodes at all?


> I again would say that an @disabled-plugins node is a more elegant
> solution to creating this functionality.
>

​Reasonable.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: To do: enabling/disabling plugins separately from loading plugins

2015-05-05 Thread Jacob Peck

On 5/5/2015 9:17 AM, 'Terry Brown' via leo-editor wrote:

Seems to me replacing the whole plugins list loses the current
capability of saying "in this outline I want my regular list of plugins
plus this one" - after the change you'd have to copy your regular list
of plugins, which would then not change when the list in myLeoSettings
changes.
This use case is covered by mod_scripting.py's @plugin nodes.  So, you 
could add an '@plugin nodetags' node to load nodetags.py when the 
outline loads, for example.


Currently, all loaded plugins affect all outlines, though, as far as I 
can tell...


-->Jake

--
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: To do: enabling/disabling plugins separately from loading plugins

2015-05-05 Thread 'Terry Brown' via leo-editor
On Tue, 5 May 2015 06:20:12 -0500
"Edward K. Ream"  wrote:

> On Tue, May 5, 2015 at 4:32 AM, Kent Tenney  wrote:
> 
> > -1 as I understand it, but maybe I don't understand.
> >
> > Other settings are active if applied in myLeoSettings.leo, you're
> > saying plugins would need to be mentioned in every .leo file which
> > uses them?
> 
> ​No.  If x.leo contains no @enabled-plugins node, the
> @enabled-plugins node in myLeoSettings.leo is used.
> 
> But if x.leo *does* contain an @enabled-plugins node, then only those
> plugins in that particular @enabled-plugins node become active for
> x.leo, regardless of how many plugins may have been loaded in other
> commanders.
> 
> This would make @enabled-plugins work more like all other settings
> nodes, including @data nodes.

Seems to me replacing the whole plugins list loses the current
capability of saying "in this outline I want my regular list of plugins
plus this one" - after the change you'd have to copy your regular list
of plugins, which would then not change when the list in myLeoSettings
changes.

Would it work to add a @bool clear_enabled_plugins which
indicates that the list of enabled plugins should be cleared before
applying the current outline's list.  That would normally be False, but
when True would only apply to the outline that set it True in its
@settings - the existing @settings scoping rules, which already apply
to @bool settings, would work in our favor here?

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: To do: enabling/disabling plugins separately from loading plugins

2015-05-05 Thread john lunzer
This still seems like it's creating a lot of repetition and potentially 
violating DRY. @enabled-plugins nodes usually contain a ton of plugins. 

What the proposed change would involve is me copying my @enabled-plugins 
node from myLeoSettings.leo and commenting out a few lines. I'm not sure 
what typical usage is be it seems more likely that people would be wanting 
to selectively disable only a few plugins.

Here is the real bummer about this approach. Lets say I find a new plugin I 
really like. Now I have to go into every Leo file that has a custom 
@enabled-plugins node and add a new line to each. This could potentially 
cause a lot of frustration.

I again would say that an @disabled-plugins node is a more elegant solution 
to creating this functionality.

On Tuesday, May 5, 2015 at 7:20:13 AM UTC-4, Edward K. Ream wrote:
>
> On Tue, May 5, 2015 at 4:32 AM, Kent Tenney  > wrote:
>
>> -1 as I understand it, but maybe I don't understand.
>>
>> Other settings are active if applied in myLeoSettings.leo, you're
>> saying plugins would need to be mentioned in every .leo file which
>> uses them?
>>
>
> ​No.  If x.leo contains no @enabled-plugins node, the @enabled-plugins 
> node in myLeoSettings.leo is used.
>
> But if x.leo *does* contain an @enabled-plugins node, then only those 
> plugins in that particular @enabled-plugins node become active for x.leo, 
> regardless of how many plugins may have been loaded in other commanders.
>
> This would make @enabled-plugins work more like all other settings nodes, 
> including @data nodes.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: To do: enabling/disabling plugins separately from loading plugins

2015-05-05 Thread Edward K. Ream
On Tue, May 5, 2015 at 4:32 AM, Kent Tenney  wrote:

> -1 as I understand it, but maybe I don't understand.
>
> Other settings are active if applied in myLeoSettings.leo, you're
> saying plugins would need to be mentioned in every .leo file which
> uses them?
>

​No.  If x.leo contains no @enabled-plugins node, the @enabled-plugins node
in myLeoSettings.leo is used.

But if x.leo *does* contain an @enabled-plugins node, then only those
plugins in that particular @enabled-plugins node become active for x.leo,
regardless of how many plugins may have been loaded in other commanders.

This would make @enabled-plugins work more like all other settings nodes,
including @data nodes.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: To do: enabling/disabling plugins separately from loading plugins

2015-05-05 Thread john lunzer
Maybe I am also misunderstanding but It seems cumbersome to expect any 
users but especially new users to enable plugins per outline.

If you want to do a per outline enable-disable then plugins should be 
enabled globally (in myLeoSettings.leo or leoSettings.leo) but *disabled* 
locally with a @disabled-plugins node. 

This puts the least amount of strain on the user, does not break current 
usage, and provides the control you're looking for.

On Tuesday, May 5, 2015 at 5:33:19 AM UTC-4, Kent Tenney wrote:
>
> -1 as I understand it, but maybe I don't understand. 
>
> Other settings are active if applied in myLeoSettings.leo, you're 
> saying plugins would need to be mentioned in every .leo file which 
> uses them? 
>
>
>
> On Tue, May 5, 2015 at 12:14 AM, Edward K. Ream  > wrote: 
> > Leo's plugins manager can and imo should dispatch events registered to a 
> > plugin only to commanders for which the plugin is enabled in an 
> > @enabled-plugins node. 
> > 
> > This would make @enabled-plugins nodes work like all other settings. 
>  Not 
> > enabling a plugin in a local (per .leo file) @enabled-plugin node would 
> > disable that plugin for that outline even if the plugin is enabled in 
> > myLeoSettings.leo or leoSettings.leo. 
> > 
> > In practice, the plugins manager would dispatch an event registered by a 
> > plugin to a commander only if the plugin is actually enabled in the 
> > commander.  Events would be dispatched as always.  For example: 
> > 
> > def onCreate (tag, keys): 
> > 
> > c = keys.get('c') 
> > if c: << do something >> 
> > 
> > The only difference is that this event handler would be called only for 
> > outlines in which the plugin was enabled. 
> > 
> > There might be unforeseen difficulties, but I plan to experiment with 
> this 
> > soon. 
> > 
> > Your comments, please, Amigos. 
> > 
> > Edward 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "leo-editor" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to leo-editor+...@googlegroups.com . 
> > To post to this group, send email to leo-e...@googlegroups.com 
> . 
> > Visit this group at http://groups.google.com/group/leo-editor. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: To do: enabling/disabling plugins separately from loading plugins

2015-05-05 Thread Kent Tenney
-1 as I understand it, but maybe I don't understand.

Other settings are active if applied in myLeoSettings.leo, you're
saying plugins would need to be mentioned in every .leo file which
uses them?



On Tue, May 5, 2015 at 12:14 AM, Edward K. Ream  wrote:
> Leo's plugins manager can and imo should dispatch events registered to a
> plugin only to commanders for which the plugin is enabled in an
> @enabled-plugins node.
>
> This would make @enabled-plugins nodes work like all other settings.  Not
> enabling a plugin in a local (per .leo file) @enabled-plugin node would
> disable that plugin for that outline even if the plugin is enabled in
> myLeoSettings.leo or leoSettings.leo.
>
> In practice, the plugins manager would dispatch an event registered by a
> plugin to a commander only if the plugin is actually enabled in the
> commander.  Events would be dispatched as always.  For example:
>
> def onCreate (tag, keys):
>
> c = keys.get('c')
> if c: << do something >>
>
> The only difference is that this event handler would be called only for
> outlines in which the plugin was enabled.
>
> There might be unforeseen difficulties, but I plan to experiment with this
> soon.
>
> Your comments, please, Amigos.
>
> Edward
>
> --
> You received this message because you are subscribed to the Google Groups
> "leo-editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to leo-editor+unsubscr...@googlegroups.com.
> To post to this group, send email to leo-editor@googlegroups.com.
> Visit this group at http://groups.google.com/group/leo-editor.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.