Re: ENB: Aha: use @c.command to split leoCommands.py

2017-11-25 Thread Edward K. Ream
On Sat, Nov 25, 2017 at 10:12 AM, Terry Brown wrote: I didn't mean to imply that you had started afresh. I meant that if one > were to start afresh, one might arrange things as I went on to > describe, but constrained by the need for backwards compatibility, you > were trying to move in that dire

Re: ENB: Aha: use @c.command to split leoCommands.py

2017-11-25 Thread Terry Brown
On Fri, 24 Nov 2017 17:06:30 -0600 "Edward K. Ream" wrote: > ​> Starting afresh, > > No, the project does not start afresh in any sense. There are no new > classes, no new subcommanders. I didn't mean to imply that you had started afresh. I meant that if one were to start afresh, one might a

Re: ENB: Aha: use @c.command to split leoCommands.py

2017-11-24 Thread Edward K. Ream
​​ On Fri, Nov 24, 2017 at 12:29 PM, Terry Brown wrote: Just want to check I understand this project. > ​I've been playing with the project all day, trying to understand every little nuance. I believe the latest revs are just about perfect. ​> Starting afresh, No, the project does not start af

Re: ENB: Aha: use @c.command to split leoCommands.py

2017-11-24 Thread Terry Brown
On Fri, 24 Nov 2017 00:50:21 -0800 (PST) "Edward K. Ream" wrote: > Recent revs in the cmds branch have successfully migrated all of the > edit commands to leo/commands/commanderEditCommands.py. I now have a > much better idea of what is needed. Considerable "routine" code > changes have been req

Re: ENB: Aha: use @c.command to split leoCommands.py

2017-11-24 Thread Edward K. Ream
On Thursday, November 23, 2017 at 10:09:06 AM UTC-6, Edward K. Ream wrote: > > On Thursday, November 23, 2017 at 8:50:57 AM UTC-6, Edward K. Ream wrote: > > #589 Now tracks > this project, and documents the cmds branch >

Re: ENB: Aha: use @c.command to split leoCommands.py

2017-11-23 Thread Edward K. Ream
On Thursday, November 23, 2017 at 8:50:57 AM UTC-6, Edward K. Ream wrote: #589 Now tracks this project, and documents the cmds branch . Preliminary tests are successful. As expected, neith

Re: ENB: Aha: use @c.command to split leoCommands.py

2017-11-23 Thread Edward K. Ream
On Thursday, November 23, 2017 at 8:41:57 AM UTC-6, Edward K. Ream wrote: Here is a slight variant of g.command that looks like it will suffice to > define commands as "bare" functions using @g.commander_command: > Here is a test (in a Leo script, not a file): @others # Define commander_command

Re: ENB: Aha: use @c.command to split leoCommands.py

2017-11-23 Thread Edward K. Ream
On Thursday, November 23, 2017 at 1:57:15 AM UTC-6, Edward K. Ream wrote: > @c.command will likely morph into @g.commander_command. Here is a slight variant of g.command that looks like it will suffice to define commands as "bare" functions using g.@commander_command: class CommanderCommand(obj

Re: ENB: Aha: use @c.command to split leoCommands.py

2017-11-22 Thread Edward K. Ream
On Thursday, November 23, 2017 at 1:40:25 AM UTC-6, Edward K. Ream wrote: So we have a dilemma. One the one hand, it's *always* better to use > classes to encapsulate related functions. Otoh, it would be intolerable > for text transformations to introduce subtle bugs in commander commands. >

Re: ENB: Aha: use @c.command to split leoCommands.py

2017-11-22 Thread Edward K. Ream
On Thursday, November 23, 2017 at 1:27:38 AM UTC-6, Edward K. Ream wrote: > *The Aha* > The @c.command decorator, defined in leoCommands.py, will define a > command, just like g.command. And (Aha!) the decorator will *also *inject > the function (as a method) into the Commands class. > It *mig

ENB: Aha: use @c.command to split leoCommands.py

2017-11-22 Thread Edward K. Ream
This Aha is a direct result of our discussions in #581: Define all commands using a LeoCommand class? *The problem* The present Commands class (in leoCommands.py) is *way* too large. Besides providing essential services, the Commands class