On Feb 12, 1:51 pm, "Edward K. Ream" <[email protected]> wrote:

> A new strategy has just come to mind.  The question is, what kind of 
> "infrastructure" is required to load a .leo file?  If I can make this process 
> self-contained, I may be able to avoid the immense difficulties that would be 
> entailed by changing Leo's ctors.

This strategy does indeed appear feasible.

I studied all the calls to config.getX in the classes that become part
of the Commands class. Most of these calls are irrelevant to the
question at hand.  In particular, the ctors for the atFile,
shadowController, and tangleCommands classes do contain calls to
config.getX, but such calls don't matter, because we don't have to
read external files to read a .leo file!

The fileCommands class *does* use two config settings, but happily
neither is used when *reading* a .leo file.

So it should indeed be possible to refactor leoFileCommands.getLeoFile
in so that it reads (only) the .leo file *without* relying on any
settings. Such a refactoring isn't trivial, but it is a local project
that will not have wide repercussions.

This is the way forward that I have been seeking.

The next step will be to discover what kind of data
leoFileCommands.getLeoFile presently sets in the commander.  We can
probably create a "fake" commander that contains only those data.  We
pass that fake to getLeoFile which sets the ivars.  We can then set
the ivars in the "real" commander when we are ready to create it.

This is far from a straightforward plan, but let's keep the prize in
view:  it allows us to load a .leo file in a single pass, as follows,
*without* greatly changing how Leo's many objects get inited.  Here is
the overview of the process...

1. Load the .leo file without using any settings, and without loading
any external files.
2. Discover the settings by scanning the loaded .leo files.
3. Complete the loading using the settings::
  A. Init all sub-objects of the commander, by calling the ctors and
the various finishCreate methods.
  B. Read the external files.
  C. Create the gui's frames, thereby generating events to be handled
by plugins.

Edward

-- 
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