Am 10.09.2012 06:36, schrieb Lex Trotman:
Hi All,
Its about that time of year when we have our annual discussion on separating session data from config/project data :)
By session data I mean the list of currently open files and MRU list.
The advantages (that I can see):
- Save config/project as its changed and not rushed at quit time (and
the quit save doesn't happen in the absence of a working, portable, session management capability)
- Save session data periodically, or as it changes, or whenever,
without touching the config/project files. So the config isn't at risk if the session save goes wrong.
The only disadvantage for user config (that I can see) is that it adds one file, say geany.session.conf alongside geany.conf
For project sessions just using another file in the same place as the project file is more of a problem since project files can be in the project tree and some people like to save them in VCS. So users would have to make sure that their git.ignore (or whatever the other VCSes use) is edited each time so that the session file isn't saved in the VCS.
A better option, especially since sessions are inherently user related, is to store them in the user config location (or subdirectory thereof). But how to link these files to the project files?
The proposal is that each project gets a UUID generated when it is created (or when its opened without one) which is saved in the project file. This uuid is the name of the session file in the ${GEANY_CONFIG}/sessions directory. That way, when a project is opened, it is easy to uniquely find the session file if it exists. Using things like filenames, project names etc will always have clashes. Libuuid is used by GTK so it will always be available on all platforms we use and so making the UUID is one call. (Pity GTK doesn't expose it though)
The number of session files can be left to grow like weeds, or can be trimmed to a (configurable) maximum number deleting the oldest when needed.
This proposal isn't about a proper session management capability, there isn't one that works on enough platforms to be worth including.
Any thoughts welcome.
Reviving this old thread because the annual discussion naturally came up again this year.
Your proposal lists issues that are rather orthogonal to separating the session file list, thus I think these should be dealt with later. As a first step I would propose we split out the session file lists to separate files (normal session: in the same folder as geany.conf, for projects in the same folder as $project.geany). This should solve the problem checking project files in as well as enabling to sync geany.conf across machines without affecting opened files.
If one made such a patch, would it be accepted? It should be relatively trivial, only complicated by backward compat code to read session informations from the old location.
Best regards.