On 22 August 2011 22:57, Colomban Wendling lists.ban@herbesfolles.org wrote:
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?
Which is why I suggested that putting it in the menu would be better.
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.
The autodetect entry is to provide a way to return it to autodected values after I mucked it up by fiddling and can't remember where I started :-)
So, to summarize a little:
Add per-filetype indentation width and type;
When setting the filetype for the first time (file open and unpon
initial manual filetype selection), use, in order: a) auto-detect (if preferred)
or not new file (can't detect a non-existent file :-)
b) filetype setting c) user global settings d) system global settings
- when changing the filetype for the second (or more) time, don't touch
indentation settings.
Sounds good?
Yep.
Cheers Lex