Geany has a preference called “Use project-based session files”. When it’s enabled, a project’s open files are saved on project close and reopened on project open.
I would like a per-project setting to change this behavior such that open files are **opened, but not saved**. In other words, I want to “freeze” a specific set of files to be opened with the project.
My use case: a blunt way to preload a project’s local tags. I have several projects consisting of a few dozen source files each, and I find that simply opening them all at startup is a good way to have all the tags handy. I don’t want heavyweight approaches like Project Organizer.
But I can think of other use cases as well.
Right now I have a blunt patch that relies on the user manually writing `readonly_session=1` in the `.geany` file. I guess that wouldn’t be acceptable for Geany core? What do you think the UI for this feature should look like? Or is it appropriate for Geany core at all?
What wrong with setting the files you have open for "tags only" purposes readonly (Menu->Document->Read Only), then you can't change them and they won't get saved.
I’m sorry, I wasn’t clear. It’s not the files themselves that I want to make read-only — it’s the *set* of open files, i.e. the project session. So if I open some other files while working on the project, Geany shouldn’t remember that.
Geany projects are basically named sessions, so it seems kind of an anti-use-case to not save the session, it is likely to only be accepted if it has an option and the default is current behaviour.
You could do this fairly trivially in a plugin.
@elextr
if it has an option and the default is current behaviour
Of course! I just haven’t yet figured out what this option should look like in the UI to be understandable.
@codebrainz Do you mean by connecting to `project-open` and then opening my own set of files? I think that would conflict with Geany’s own session persistence, because the `project-open` callback seems to be invoked before the project’s session is loaded.
github-comments@lists.geany.org