Leo no longer supports --session-restore and --session-save. LM.scanOptions lists them as obsolete.
But the SessionManager class still exists. SM.load_session is the culprit behind #3404. It would be straightforward to fix this method, but I shall retire the entire class instead.
The SessionManager supports six session-* commands. The commands allow you to specify a set of files to open at startup. But listing the desired files (in a shell script or .cmd file) is simple and good.
Summary
The session-* commands are absurd solutions to a non-existent problem. This class significantly complicates Leo's startup logic. The entire SessionManager class must go. Félix take note :-)
As a side effect, Leo will no longer write ~/.leo/leo.session.
Your comments are welcome. Good luck arguing for this class :-)
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, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/5480a75d-ada7-4bb0-8a4b-b27c8fe5486an%40googlegroups.com.
On Jun 29, 2023, at 8:22 PM, Mike Hodson <mys...@gmail.com> wrote:
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAN%2B%2B4hFrZhEmhKD14q7hXufSTjJ95Q9QH-uESxcJgD0TmnPUeg%40mail.gmail.com.
The session-* commands are absurd solutions to a non-existent problem. This class significantly complicates Leo's startup logic. The entire SessionManager class must go. Félix take note :-)
The session-* commands are absurd solutions to a non-existent problem. This class significantly complicates Leo's startup logic. The entire SessionManager class must go. Félix take note :-)
Thanks to all who have commented.
Yes, Leo could have "real" sessions. When no files appear on the command line, Leo could reload the open outlines when Leo last closed. Issue #3408 tells how. It's easy! It's on the list for Leo 6.7.4.
But nothing in leoSessions.py gives Leo such sessions. The SessionManager class and the session-* commands must go.
Edward
I routinely start Leo with a set of files (four or five), previously saved via session-snapshot-load and session-snapshot-save. Unless I'm misunderstanding you, loss of this feature would be a serious blow to my leo productivity.
But nothing in leoSessions.py gives Leo such [real] sessions. The SessionManager class and the session-* commands must go.
starting Leo via different sets of (for me) .sh files, for different 'session sets of files' seems pretty cheesy in this day & age - sorry.
FWIW I can't really tell what #3408 will actually *do*. "Real Sessions" sounds great, but what is written there is more about the coding. I would like to better understand when the user experience will be at the end of this.
1. On exit, Leo always saves a list of open outlines (automatic session-snapshot-save).2. When you open Leo without specifying any files Leo opens the saved list of outlines (automatic session-snapshot-load).
I think this is exactly what is wanted most of the time, especially if each of the session-loaded outlines gets navigated to the focus when Leo was last closed.The trouble with having the user build and specify the contents of specially named sessions is that it's not only a nuisance to do, one quickly forgets what each session contains.
titles like 'The SessionManager will go away' probably cause people to go "what?! Why?! When?!", which might not be what you want...
I actually do use the equivalent of custom temporary sessions sometimes, but the way I do it is to use the command line. I usually keep a Leo window open all the time with maybe 5 or 6 outlines open (at a minimum, the workbook, my bookmarks manager, and whatever outline I want to work with). Sometimes I launch another copy with one or two outlines specified on the command line. Those command lines, in a second console, serve as de facto sessions. They are easy to bring back via the command line history, and I can have several. As long as the first instance of Leo stays open until after those other ones are closed, then the session having the first Leo instance's outlines will get reloaded the next time I start Leo.
On Fri, Jun 30, 2023 at 5:04 AM jkn <jkn...@nicorp.f9.co.uk> wrote:FWIW I can't really tell what #3408 will actually *do*. "Real Sessions" sounds great, but what is written there is more about the coding. I would like to better understand when the user experience will be at the end of this.The idea, now fully realized in PR #3215, is this:1. On exit, Leo always saves a list of open outlines (automatic session-snapshot-save).2. When you open Leo without specifying any files Leo opens the saved list of outlines (automatic session-snapshot-load).
The idea, now fully realized in PR #3215, is this:1. On exit, Leo always saves a list of open outlines (automatic session-snapshot-save).2. When you open Leo without specifying any files Leo opens the saved list of outlines (automatic session-snapshot-load).That sounds reasonable enough. Might it be worth making (1) alterable via an @setting variable?
I can just see some scenario where you have a usual set of sessions saved, but want to have a 'scratch' session with a different set, or just one file or something.
FWIW I rarely use session-snapshot-load, just when I change my 'default' session setup. So I would no longer need to do this.
I'll attempt to give this a try soon.
The idea, now fully realized in PR #3215, is this:1. On exit, Leo always saves a list of open outlines (automatic session-snapshot-save).2. When you open Leo without specifying any files Leo opens the saved list of outlines (automatic session-snapshot-load).
I just cycled Leo several time with this morning's update to PR3215. My workbook remains intact, and the other session outlines re-opened. (Not at the first launch: only the workbook opened, not a surprise, I suppose).
I suppose when I switch back to devel I'll be at risk of losing the workbook, but I do have a backup if that happens.
FWIW I usually run Leo from a direct desktop shortcut - having different command files to run with different command-line parameters is something ... unusual. I only ever do it if I have had a crash and am trying to see what is going on. Having a series of batch/sh files seems very ... 1990s to me...