The keys branch contains work on #1269 
<https://github.com/leo-editor/leo-editor/issues/1269>. The goal of phase 1 
is removing evil kwargs and ivars. This phase is going much better than 
expected. 

I am eating my own dog food as I go along. Please test the keys branch and 
report any problems.

*What I've done*

The git log records various tiny simplifications of the code. These may 
indeed be tiny, but they lead to bigger things, such as removing the 
dynamicMenu kwarg everywhere.

I forgot how I got lead to the dynamicMenu kwarg. Presumably, it showed up 
in one or more cff's. This kwarg was an exemplar of an *evil kwarg*: it 
involved internal details, and it got passed around from method to method.

*Still to do*

At present, k.masterCommand has the following signature:

def masterCommand(self, commandName=None, event=None, func=None, stroke=None
)

Clearly, the "func" and "stroke" kwargs are evil. The signature will 
eventually become:

def masterCommand(self, commandName, event)

I'll add one or two more "k" methods, after analyzing all present calls to 
k.masterCommand. I've already done some cff's, but a full analysis requires 
arbitrarily many more cff's. Each cff can lead down a rabbit hole...

*Summary*

I am eating my own dog food as I go along. Please test the keys branch and 
report any problems.

Phase 1 of #1269 <https://github.com/leo-editor/leo-editor/issues/1269> 
will remove all evil kwargs. I am surprised that so many simplifications 
have already appeared.

Next, I'll replace kwargs to k.masterCommand with other "k" methods, which 
will be called in more specific contexts. I expect substantially better 
code to be the result.

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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/27480294-712f-4b5a-8163-8eba6d3d9e16%40googlegroups.com.

Reply via email to