[Geany-devel] Edit/Save config files anomaly?

Enrico Tröger enrico.troeger at xxxxx
Sat Mar 20 15:45:14 UTC 2010


On Sun, 7 Mar 2010 18:35:10 +0100, Enrico wrote:

>On Wed, 3 Mar 2010 14:08:36 -0800, Tony wrote:
>
>>On Tue, Mar 2, 2010 at 10:59 PM, Tony Rick <tonyr42 at gmail.com> wrote:
>>
>>> At revision 4720.
>>>
>>> I'm trying to understand the Tools->Configuration Files Edit/Save
>>> behavior, so that I can mimic that in a plugin that does the same
>>> thing for template files.  When I select *snippets.conf* from the
>>> *Configuration Files*submenu, and there is no *snippets.conf* in
>>> *~/.config/geany (app->configdir)*,  the default  file from
>>> */usr/share/geany (app->datadir)*  is obviously opened, but a Status
>>> message is issued indicating that the file is opened in
>>> *~/.config/geany (app->configdir)*.  I take this to mean that the
>>> override convention (files in *configdir* overriding files of the
>>> same name in *datadir)* is being enforced in the editor.  However,
>>> when I save the modified file, using either the *Save* icon or *
>>> File->Save*, I am put into a file save dialog, as if I had selected*
>>> File->Save As*.
>>>
>>> Is this the specified behavior?  Having the *File->Save As* dialog
>>> appear when *Save* is specified is confusing and inconsistent. It
>>> seems to me that if the override convention is being enforced,
>>> selecting *Save* should write the modified file to the location
>>> reported in the Status window without question, and the save
>>> location dialog only offered specifically when *Save As* is
>>> selected.  If the override convention is not being enforced in the
>>> editor,  then the Status message is misleading.  The manual does not
>>> refer specifically to this behavior, only to the fact that *.conf
>>> * can be manually copied to *configdir* and modified, and will then
>>> override the default file.   I think it is more consistent to have
>>> the editor enforce the override file location policy by default on
>>> *Save*, allow *File->Save As *to be used as an option at the user's
>>> discretion, and state the override file location policy and the
>>> editor's enforcement of such clearly in the manual.
>>>
>>
>>Here's a simple patch that modifies the Save behavior for config files
>>edited from the Tools->Configuration Files submenu for your
>>consideration. Config files that are read from the geany data
>>directory (because they did not already exist in the local config
>>directory) will be saved to the local config directory by default.
>
>Thanks, committed.
>I just changed the actual real_path to the target file.

Recently I reverted the patch as it actually does it wrong, your way
and mine as well.
Setting the real_path attribute manually does the trick about not
showing the Save As dialog but it also causes misleading 'file not
found' dialogs when Geany checks the file for external on-disk changes.

I discussed this issue a bit with Nick and we came to the conclusion,
at least for now, that it is better to keep the old behaviour. This way
the user is explicitly told that he/she is saving a new file which
might be a good idea.
And for those users who already knew, it's just only one more click.

Thanks for your efforts anyway.

Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100320/52a39dc8/attachment.pgp>


More information about the Devel mailing list