Sorry, forgot to answer this in the afternoon.
On Thu, 3 Jun 2010 16:11:03 +1000% Lex Trotman elextr@gmail.com wrote:
On 3 June 2010 01:08, Eugene Arshinov earshinov@gmail.com wrote:
On Wed, 2 Jun 2010 18:10:26 +1000% Lex Trotman elextr@gmail.com wrote:
On 2 June 2010 17:19, Eugene Arshinov earshinov@gmail.com wrote:
The second half of 6 ("last main instance opening project wins") seems somewhat strange to me:
- Shouldn't it also hold for secondary instances? I think we
shouldn't differentiate the behaviour of main and secondary instances in respect to handling of project files.
- I'd prefer "last closing wins", not "last opening wins" (the
way we usually implement things, isn't it?).
Sorry if I wasn't clear enough, I was talking about Geany saving the current file list in the *config* file when a project is opened, not about the project file, when another instance closes its project, it restores the file list saved in the config by the instance that last *opened* a project.
Thanks, now it's more clear, but I'm still confused. Could you further explain the last phrase "when another instance closes its project, it restores the file list saved in the config by the instance that last *opened* a project"? Why do we need such complexity (we must know whether the instance which was the last to write the file list to the config opened the project before or after us…)? Why can't we let the last instance overwrite the file list completely?
This isn't added complexity, its just how it works now, if sm changes that then I didn't notice, sorry.
Let me give example sequences:
How it works with a single instance:
open Geany, open several files, open project, Geany saves the list of several files in Geany.conf and opens the project file list, close project (which can be after several opens and closes of Geany) saves list of open files in project file and close them and then open the files listed in Geany.conf Perfect!!
How it works with several instances (numbered):
open Geany1, open several files1, open project1 Geany1 saves list of files1 in Geany.conf and opens the project1 file list, open --new-instance Geany2, open some files2, open project2, Geany2 saves the file list2 in Geany.conf overwriting file list1, close project1, Geany 1 saves project1 file list and opens file list2!!! it reads from Geany.conf, confused grumpy user :(
Thanks for explanation.
or if --new-instance versions are not allowed to save file list, how do they restore the open files when the project is closed?
By limiting save it to the main instances I was hoping to reduce the surprise somewhat, but a better answer would be welcome.
Well, in SM the file list and the recent project in the config are indeed saved only by main instances. Secondary instances are not allowed to touch them (being more concrete, in SM --new-instance implies --no-session).
Which raises the second problem noted above.
I don't claim to have a good solution for this one, I just want to get the solution with most user utility and least user surprise.
We may store files that were opened before the project internally and properly restore them after the project is closed. It's a simple idea, but it may be difficult to implement because practically we'll have to maintain internally two projects: "default project" and opened "real project" (if any).
Also, this will introduce a new challenge for Geany's session management and SM: whether we need to save also "default project" if "real project" was opened when Geany exited?
Best regards, Eugene.