Heads up: PR #3597 rewrites Leos save, save-as and save-to commands!

31 views
Skip to first unread message

Edward K. Ream

unread,
Oct 9, 2023, 3:10:24 AM10/9/23
to leo-editor

PR #3597 rewrites c.save, c.saveAs, and c.saveTo. This project started out with a report about a quirp. I quickly realized that the existing code was intolerably complex.


Removing an Easter Egg


c.saveTo contains the following Easter Egg (bizarre code):


if not fileName:  

    fileName = ''.join(c.k.givenArgs)


Neither Leo's core nor official plugins use this egg. Furthermore, the existing "fileName" kwarg to all three methods renders the hack unnecessary.


Summary


The PR fixes hard-to-see inconsistencies in c.save, c.saveAs, and c.saveTo. This PR should be the basis of leoJS's save command.

This work is potentially dangerous! I'll wait at least several days before merging this PR.

Imo, removing the Easter Egg does not constitute a significant breaking change to Leo's API. But we'll see who howls :-)

Please review the PR and report any problems.


Edward

Félix

unread,
Oct 9, 2023, 2:40:07 PM10/9/23
to leo-editor
Thanks, I'll have leojs mimic those changes.

Félix

Edward K. Ream

unread,
Oct 9, 2023, 2:50:56 PM10/9/23
to leo-e...@googlegroups.com
On Mon, Oct 9, 2023 at 1:40 PM Félix <felix...@gmail.com> wrote:
Thanks, I'll have leojs mimic those changes.

You're welcome. Thomas has many interesting comments on the PR. I'll work on them next.

Edward

Edward K. Ream

unread,
Oct 12, 2023, 4:17:05 AM10/12/23
to leo-editor
On Monday, October 9, 2023 at 2:10:24 AM UTC-5 Edward K. Ream wrote:

> PR #3597 rewrites c.save, c.saveAs, and c.saveTo.

This PR has been merged into devel. Please report any problems immediately.

I have just rescheduled Leo 6.7.5 for Friday, October 27. This will give us all more time for testing, and will give Félix more time to report any last quirps before he releases leoJS.

Edward
Reply all
Reply to author
Forward
0 new messages