Re: OMG: It's easy to copy outlines!

2022-05-19 Thread Edward K. Ream
On Thursday, May 19, 2022 at 4:35:52 PM UTC-5 Edward K. Ream wrote: Happily, LM.openEmptyWorkBook can avoid copying trees entirely. Doh! Just > open CheatSheet.leo, then do save-as. > Done in devel at rev dd9d1

Re: OMG: It's easy to copy outlines!

2022-05-19 Thread Edward K. Ream
On Thursday, May 19, 2022 at 10:17:59 AM UTC-5 Edward K. Ream wrote: PR #2655 shows how to > copy an outline iteratively. Just use p.moveToThreadNext as a template! > Alas not. The pattern doesn't handle clones properly! One fix: the

Re: OMG: It's easy to copy outlines!

2022-05-19 Thread Edward K. Ream
On Thu, May 19, 2022 at 12:24 PM tbp1...@gmail.com wrote: > wouldn't a deep copy of the root position do it? > A deep copy of the root *vnode* would copy only that subtree. Worse, vnodes have state that depends on the entire outline. There are, I think, valid vnode-based solutions already.

Re: ENB: Public undoer methods *never* need a "p" arg!

2022-05-19 Thread Edward K. Ream
On Thu, May 19, 2022 at 11:21 AM tbp1...@gmail.com wrote: > For backward compatibility do not change the apis. they are working for > most of us already. I agree. On second thought, it would be too odious to break existing scripts. > Instead name the modified apis with a new name, deprecate

Re: OMG: It's easy to copy outlines!

2022-05-19 Thread tbp1...@gmail.com
wouldn't a deep copy of the root position do it? On Thursday, May 19, 2022 at 12:07:33 PM UTC-4 Edward K. Ream wrote: > On Thursday, May 19, 2022 at 10:17:59 AM UTC-5 Edward K. Ream wrote: > > PR #2655 shows how >> to copy an outline

Re: ENB: Public undoer methods *never* need a "p" arg!

2022-05-19 Thread tbp1...@gmail.com
For backward compatibility do not change the apis. they are working for most of us already. Instead name the modified apis with a new name, deprecate the old ones, and start using the new ones going forward. e.g., *u.before*_1*. the existing apis may not need one or more of the old

Re: OMG: It's easy to copy outlines!

2022-05-19 Thread Edward K. Ream
On Thursday, May 19, 2022 at 10:17:59 AM UTC-5 Edward K. Ream wrote: PR #2655 shows how to > copy an outline iteratively. Just use p.moveToThreadNext as a template! > Some notes: FĂ©lix, the upcoming PR will also rewrite server.copy_node.

ENB: Public undoer methods *never* need a "p" arg!

2022-05-19 Thread Edward K. Ream
PR #2652 fixes ancient bugs in u.undoGroup and u.redoGroup. While working on this issue, I realized that none of the u.before* and u.after* methods need a "p" argument! Indeed, p must *always* be c.p *at the time of the call.* The question

OMG: It's easy to copy outlines!

2022-05-19 Thread Edward K. Ream
PR #2655 shows how to copy an outline iteratively. Just use p.moveToThreadNext as a template! Like this: p = c.rootPosition() for p2 in c2.all_positions(): p.h = p2.h p.b = p2.b p.u = p2.u if not p2.hasThreadNext():

Re: GF4, A Waveform Calculator

2022-05-19 Thread Edward K. Ream
On Wed, May 18, 2022 at 8:56 AM tbp1...@gmail.com wrote: > I have created a minimal version that does almost nothing except plot a > hard-coded data set and allow you to change the axis settings. It does > however use the actual gf4 code to handle the data and plotting, just with > everything