Progress report: the "keys" branch

22 views
Skip to first unread message

Edward K. Ream

unread,
May 23, 2020, 6:52:57 AM5/23/20
to leo-editor
The keys branch contains work on #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 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
Reply all
Reply to author
Forward
0 new messages