Discuss: Remove all session commands?

47 views
Skip to first unread message

Edward K. Ream

unread,
Jul 2, 2023, 10:09:56 AM7/2/23
to leo-editor

Leo's now requires only two methods from leoSessions.py: SM.save_snapshot and SM.load_snapshot. These two methods read and write json data to ~/.leo/session.leo. Issue #3409 suggests writing session data to Leo's global cache instead.


I am wondering: is there any reason to retain any of the commands defined in leoSessions.py? I think not.


Imo, leoSessions.py should contain only load_snapshot and save_snapshot. What do you say?


Edward

Thomas Passin

unread,
Jul 2, 2023, 10:36:34 AM7/2/23
to leo-editor
I agree that going forward, probably only those two are needed.  But if the existing commands still work, why remove them?  Someone may be using them, someone who isn't following this discussion.

Edward K. Ream

unread,
Jul 2, 2023, 1:22:57 PM7/2/23
to leo-e...@googlegroups.com
On Sun, Jul 2, 2023 at 9:36 AM Thomas Passin <tbp1...@gmail.com> wrote:

But if the existing commands still work, why remove them?

Leo will be better off without them. Less to learn, less to document, less to maintain.

Someone may be using them, someone who isn't following this discussion.

That's always a danger. The compromise: encourage Félix not to transliterate them :-) It's an advantage of a dual code base, hehe.

Edward

Edward K. Ream

unread,
Jul 2, 2023, 4:43:19 PM7/2/23
to leo-editor
On Sunday, July 2, 2023 at 12:22:57 PM UTC-5 Edward K. Ream wrote:

>>Someone may be using [the session commands], someone who isn't following this discussion.

> That's always a danger. The compromise: encourage Félix not to transliterate them :-)

Imagine that the session commands disappear and someone is all hot and bothered about that. Won't they be happy enough to learn that Leo's sessions no work? I see no real reason not to reduce featuritis in this case.

Edward

Thomas Passin

unread,
Jul 2, 2023, 5:24:50 PM7/2/23
to leo-editor
I'm not sure we are disagreeing here, and maybe I don't understand the state of the code.  I'm saying that if the other commands are in there and working, might as well leave them in.  That wouldn't be featuritis since no features would be added.   I suppose you could call it "conservation of features".

Edward K. Ream

unread,
Jul 2, 2023, 6:37:28 PM7/2/23
to leo-e...@googlegroups.com
On Sun, Jul 2, 2023 at 4:24 PM Thomas Passin wrote:

...if the other commands are in there and working, might as well leave them in.

Except for the cost of maintaining and explaining those features.

But I agree with you that the cost is small and it might prevent howls.
That wouldn't be featuritis since no features would be added.   I suppose you could call it "conservation of features".

Or conservation of featuritis :-)

Anyway, leoJS needs only SM.load_session and SM.save_session.

Edward

Edward K. Ream

unread,
Jul 2, 2023, 8:59:02 PM7/2/23
to leo-editor
On Sunday, July 2, 2023 at 5:37:28 PM UTC-5 Edward K. Ream wrote:

#3417 now has the title: Discourage all session commands.

I'll create a PR that adds discouraging comments to docstrings and Leo's documentation.

All the sessions commands will remain in Leo, but I hope not in leoJS.

Edward

Robert-Felix

unread,
Jul 3, 2023, 1:28:33 AM7/3/23
to leo-e...@googlegroups.com
I have not done the sessions related code yet, (i didnt even know what they were 5 minutes ago) and I do not intend if i dont have to ! haha! In fact, I intended to use the same system as in leointeg: It reopens the last Leo files you had opened when last closing vscode for a given workspace, and kept in vscode's user-data storage "object" for that workspace. 

( So that it feels natural to see the last Leo files you had worked on when opening a given folder (workspace) to work with in vscode.  )

Félix

--
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, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/bf675a27-7a58-42cb-8950-d8535eb38219n%40googlegroups.com.

Edward K. Ream

unread,
Jul 3, 2023, 4:44:53 AM7/3/23
to leo-e...@googlegroups.com
On Mon, Jul 3, 2023 at 12:28 AM Robert-Felix <felix...@gmail.com> wrote:
I have not done the sessions related code yet, (i didnt even know what they were 5 minutes ago) and I do not intend if i dont have to ! haha! In fact, I intended to use the same system as in leointeg: It reopens the last Leo files you had opened when last closing vscode for a given workspace, and kept in vscode's user-data storage "object" for that workspace. 

( So that it feels natural to see the last Leo files you had worked on when opening a given folder (workspace) to work with in vscode.  )

Thanks for your comments. I'm glad to hear Leo's session follies will have no impact on leoJS or leoInteg.

Edward
Reply all
Reply to author
Forward
0 new messages