[Geany-devel] Per-filetype indentation settings

Colomban Wendling lists.ban at xxxxx
Mon Aug 22 12:57:10 UTC 2011


Le 22/08/2011 03:28, Lex Trotman a écrit :
> [...]
>>> 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.
>>
>> Well, if the user haven't chosen auto-detection in the setting it's
>> probably she don't want it.
> 
> Well if uses autodetect which is in preferences only, it isn't
> convenient to change it for an occasional document (and then go back
> to preferences and change it back), thats what I meant for opening a
> document that wasn't the "usual" setting.

This means that *before* opening a document, the user knows she doesn't
want her default settings nor knows what she wants exactly?

> But I agree that we probably should have a
>> "reset indentation settings" or something in the document menu, which
>> would basically call document_apply_indent_settings().
> 
> No because that still depends on the preference, so the user still has
> to go change the preference menu->reset it then go change the
> preference back.  IMHO the menu should offer the user explicit
> control, set spaces, set tabs, detect, set width, not depend on a
> preference that the user has probably forgotten about :-)

That makes sense, but I also think that if the user *changes* the
indentation settings she probably don't need auto-detect since she
probably knows what she wants.
However it'd be easy to add "auto-detect" to indentation type and width
selection menus -- though indentation width detection doesn't work for
tabs-based indentation for now.


So, to summarize a little:

1) Add per-filetype indentation width and type;

2) When setting the filetype for the first time (file open and unpon
initial manual filetype selection), use, in order:
  a) auto-detect (if preferred)
  b) filetype setting
  c) user global settings
  d) system global settings

3) when changing the filetype for the second (or more) time, don't touch
indentation settings.

Sounds good?


Cheers,
Colomban



More information about the Devel mailing list