[Geany-devel] Race condition when saving geany.conf

Eugene Arshinov earshinov at xxxxx
Tue Mar 2 19:40:48 UTC 2010


On Tue, 2 Mar 2010 20:25:50 +0300%
Dimitar Zhekov <hamster at mbox.contact.bg> wrote:

> On Tue, 2 Mar 2010 16:02:48 +0300
> Eugene Arshinov <earshinov at gmail.com> wrote:
> 
> > I'm not sure I understand you message correctly, but the problem I
> > described is about saving the global Geany settings, not about the
> > way how to pass instances' settings "across restarts".
> 
> In short, save <smclientid>.conf files instead of "geany.conf". That
> will not save any global options, so if you restart the session
> and then launch a new geany, it will not use such saved options.
> However, if you launch a geany instance _without_ restarting the
> session, exactly the same thing will happen.
>

And who saves the global options then? We need them written, for being
read by new instances of geany.

>
> The question seems, then,
> is save session considered to be "quit and save my settings for
> future use", or "next time, restore the things exactly as they were".
> 

Of course, the second option is the right answer, but settings are a
special case. To make things simple (both for developers and users),
the settings will be saved by the main instance only, and users won't
be supposed to change preferences in "new instances". It will make it
legitimate to store the only version of settings (i.e., the version
controlled by the main instance) in the only place for all instances,
and this place is geany.conf. Reloading the global settings in "new
instances" after restart, as it will happen, is not surprising and, I
think, even desirable by users. So, I like the solution accepted
elsewhere (in another thread) as it almost satisfies the criteria "next
time, restore the things exactly as they were", being easy and simple
and not requiring temporary files to be created and handled.

> > [...]
> 
> > [An example insignificant problem] If you change something in an
> > instance run with "-i" and restart, you'll loose your changes as
> > they won't be saved anywhere.
> 
> Another insignificant problem is that if the same project is open in
> two or more instances, that may cause a project file race.
> 
> More important than that, however, the --config option (if any) passed
> to geany should be replicated in the session arguments. First, the
> geany socket is in the configuration directory, which means one
> primary instance per directory. Second, if you restart the instances
> without --config, they will all grab the default geany.conf,
> forgetting their's saved <directory>/geany.conf files.
> 

The --config option is added to the restart command, if it was
specified when the instance was run. This is already implemented.

Best regards,
Eugene.



More information about the Devel mailing list