parkouss / webmacs

webmacs - keyboard driven (emacs key bindings) browser, https://webmacs.readthedocs.io/en/latest/
GNU General Public License v3.0
156 stars 21 forks source link

Save session every time a buffer gets opened/closed #128

Open jbmestelan opened 5 years ago

jbmestelan commented 5 years ago

As mentioned in #119, it happens that a webmacs instance ends unexpectedly. It is then a minor annoyance to also lose the state of the session (which is reset to the start of the last session). With this commit, webmacs saves the session every time a buffer gets opened or closed.

It might not be the right way of doing things; in which case, I will gladly to listen to suggestions.

jbmestelan commented 5 years ago

I realize that the part which saves on 'load' fails, and have disabled it. I am looking into it now. Sorry, this is a patch I had had aside for some time; it deserves better testing.

parkouss commented 5 years ago

I like the idea, but maybe it should be an option to automatically save session on each load?

jbmestelan commented 5 years ago

Commit 72e9c53 adds a condition on the variable save_session_on_buffer_event. Also updates session on buffer close. The part which updates on 'load' looks correct to me, after commit e38af03.

jbmestelan commented 4 years ago

Does the change correspond to what you had in mind? I have been using this modified version since then, and find it to behave OK.