[Geany-devel] Per-filetype indentation settings

Lex Trotman elextr at xxxxx
Sun Aug 14 04:54:27 UTC 2011

Hi Colomban,

On 14 August 2011 06:17, Colomban Wendling <lists.ban at herbesfolles.org> wrote:
> Hi,
> Recent bug report #3390435 [1] remembered me about per-filetype
> indentation settings.  This would remove hard-coded settings we have for
> Makefile and Fortran 77, moving the setting to the filetype definitions,
> as well as allowing further per-filetype tweaking -- e.g. we could
> imagine that somebody would like to have Python set to "4 spaces" to
> follow PEP8.

Good idea.

> I have come with an initial implementation and would like your wise
> criticism and design opinions.

I havn't had the chance to try it, but by my (questionable) inspection
it looks ok.

> A few trivial questions:
>  * should the settings be "indent_type" and "indent_width" under
> [settings] rather than adding a new section?

I don't see much difference, so keep your existing implementation.

>  * do you think it's sensible to reset the indentation settings when
> switch from a filetype that had specific settings?

Settings should take the value of the most specific setting present,
ie individual file specific, user filetype specific, system filetype
specific, user general preference, system general setting/default
value.  If something changes in that sequence like changing the
filetype then yes it should change.

>  * do you think the filetype-specific settings should override the
> auto-detection? (the second patch makes auto-detection prevail)

Well if they do and there is a filetype setting for every filetype,
how do the detected settings get used?  Would need a menu option and
possibly an option on the file open dialog to say use detected
settings.  And a preference of course.

> So, what do you think of the feature, the implementation, the missing
> parts, the universe and everything?

42 :-)


PS minor English correction for the documentation, "allows to define"
S/B "allows definition of"

More information about the Devel mailing list