On Mon, 1 Aug 2011 08:24:14 -0500
"Edward K. Ream" <[email protected]> wrote:

> On Sun, Jul 31, 2011 at 4:27 PM, SegundoBob <[email protected]> wrote:
> > I'm writing a plugin and I want to allow the user to select one set of
> > preferences for the current .leo file and another set of preferences
> > to be the current defaults for all .leo files.  
> 
> I strongly encourage you to use the standard @settings mechanisms.
> They are simple and flexible.
> http://webpages.charter.net/edreamleo/customizing.html

I should have made it clearer that those are the first choice in my
response too.  It depends on the nature of the data being stored and
how it's going to be written to the storage place.  I don't think there
are mechanisms for writing to the @settings trees other than hand
editing by the user?

Maybe a useful command would find the active location of a specified
@setting and bring up that .leo file with the cursor at that position.
So a plugin could include in its Plugins menu submenu an "Edit Prefs."
command which the plugin would write as a simple
c.edit_config('myplugin_option_a').

Leo would then  open the @settings file containing the active instance
of the myplugin_option_a option selected.  The plugin could put all its
settings in an organizer node so that 'myplugin_option_a' was the first
of them, ensuring that all the plugin's options are presented.

Get's confusing if the user had split the plugins options between
leoSettings and myLeoSettings, maybe
c.edit_config(['myplugin_option_a', 'myplugin_option_b', ...]) could help.

Core Leo could also use this mechanism for context dependent pref.
editing.

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to