ENB: Why I think keyword args are benign

2018-04-23 Thread Edward K. Ream
Vitalije and I are having a discussion about programming style as part of #862 . Here, I'd like to explain the programming style that I use throughout Leo. It's possible that this style will change significantly as the result of our

Re: keys2 branch merged into devel

2018-04-23 Thread Edward K. Ream
On Sun, Apr 22, 2018 at 6:10 PM, lewis wrote: > Create a new node, press Caps Lock key. The text 'CapsLock' appears as the > name of the new node. > ​Fixed at 56b83585b in devel. Edward -- You received this message because you are subscribed to the Google Groups

Re: ENB: Why I think keyword args are benign

2018-04-23 Thread Edward K. Ream
On Monday, April 23, 2018 at 3:58:08 AM UTC-5, Edward K. Ream wrote: > I admit, the tempOutline flag is a bit mysterious. Indeed it is. It was added to fix #427 , but I can find no calls with tempOutline set. Edward -- You received this

Re: ENB: Why I think keyword args are benign

2018-04-23 Thread Edward K. Ream
On Monday, April 23, 2018 at 3:58:08 AM UTC-5, Edward K. Ream wrote: I admit, the tempOutline flag is a bit mysterious. > Searching leo-editor for "tempOutline" yields this discussion

Re: ENB: Why I think keyword args are benign

2018-04-23 Thread Edward K. Ream
On Mon, Apr 23, 2018 at 6:50 AM, vitalije wrote: ​> ​ In order to avoid code duplication some other duplication have been made. And it is not easy to spot the duplication and unnecessary code unless you really dive into this code. ​...​ ​> ​ Proposing three different methods

Re: ENB: Why I think keyword args are benign

2018-04-23 Thread vitalije
> > s = g.app.gui.getTextFromClipboard() > undoType = 'Paste As Clone' > c.endEditing() > if not s or not c.canPasteOutline(s): > return # This should never happen. > isLeo = g.match(s, 0, g.app.prolog_prefix_string) > vnodeInfoDict = computeVnodeInfoDict(c) >

Re: ENB: Why I think keyword args are benign

2018-04-23 Thread vitalije
> > Maybe, but this would make fc.getOutlineFromClipboard less self contained. > This matters, because it can be called from several places, including the > read logic. > > I can't see why that would be the case? Can you explain why would getOutlineFromClipboard become less self contained

Re: ENB: Why I think keyword args are benign

2018-04-23 Thread Edward K. Ream
On Mon, Apr 23, 2018 at 10:49 AM, vitalije wrote: > > Can you explain why would >> ​​ >> getOutlineFromClipboard become less self contained if it returns vnode >> instance instead of position? >> > ​Positions are more useful. p.v is a position's vnode, but in general there

The keys3 branch contains latest work on vim keys

2018-04-23 Thread Edward K. Ream
"keys3" is a new branch off of "devel". I corrects several vim-related problems. Please let me know how it works for you. 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,

Re: ENB: Why I think keyword args are benign

2018-04-23 Thread vitalije
> > ​All interesting comments. I would like to see the complete new code in a > new branch. > ATM I can't update my Leo and create new branch but here is a complete code in experimental outline. I hope google will accept Leo document as attachment to this message. Whole code has 150LOC,

Re: ENB: Why I think keyword args are benign

2018-04-23 Thread vitalije
The pasteFromString variant is missing, but it would be trivial to add. Just skip everything undo/redo related. Basically if the call to c.undoer.pushBead is commented out, and txt accepted as input argument instead of retrieving it from clipboard, you get pasteFromString. Vitalije -- You