[Geany-devel] Per-filetype indentation settings

Lex Trotman elextr at xxxxx
Sun Aug 21 03:22:45 UTC 2011


[...]
> Makes sense.
>
> So if setting the filetype for a file that had no one set [1], apply the
> indent settings hierarchy, otherwise do nothing.  Maybe we should do the
> same as on open, so also do auto-detection?

If the indentation setting is set on open, it is not possible to have
a file open without indentation settings.  After opening the only time
it should change is if the user sets it, and then it should go to what
the user specifies.

>
>
> [1] does assuming None filetype means "no user choice" OK, or should we
> track whether the user chosen None?

There is always some setting, even if its a default coded in Geany.
IIUC thats what happens now if you create a new file.

>
>> I would suggest adding an indentation setting combo box to the open
>> file dialog (like the encoding one) with the options:
>>
>> 1. to set specific indentation settings (and the selectors for those
>> settings of course)
>> 2. to use autodetect
>> 3. to use whichever the hierarchy chooses based on prefs or filetypes
>> (this should of course show what it will be and potentially the
>> source)
>>
>> The default would be 2 or 3 depending on the "use autodetect" preference.
>>
>> The user must always be allowed to change the settings as the user has
>> the menu items to change the content if required, or if autodetect
>> gets it wrong, or its just a file with a different indentation
>> standard, they do exist :-)
>
> I'm not sure a setting in the file open dialogue makes much sense.  I
> doubt this setting would be used often, and the user can easily change
> the setting once the file is actually opened.  Do you really think it's
> worth adding one more option to file opening?

Well in the new scheme its the only time the user can tell Geany to
use detect when its not the usual preference, unless we add it to the
set indent menu, which is probably the better option.

Cheers
Lex



More information about the Devel mailing list