[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is there a mode that helps enforce coding guidelines?
From: |
Phillip Lord |
Subject: |
Re: Is there a mode that helps enforce coding guidelines? |
Date: |
28 May 2003 18:03:08 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.93 |
>>>>> "Kai" == Kai Großjohann <kai.grossjohann@gmx.net> writes:
Kai> petter_wintzell@yahoo.com (Petter Wintzell) writes:
>> Is there an Emacs mode that can help a programmer follow a set of
>> coding guidelines and style rules? I am thinking of the simple
>> rules that exist in many companies and projects regarding line
>> length, comment style, indent style, hanging braces, variable
>> names and what not.
>>
>> I would like a mode that highlighted the text when I broke a
>> guideline. It would also be nice if the mode could help me
>> correct the error.
Kai> For the line length, you could set the Emacs window to have the
Kai> right width. But I've also seen mention of vvb.el which draws
Kai> a vertical bar. Not sure if that is applicable.
There is also my own wide-column.el. It changes the colour of the
cursor when the line gets too long. Cheesy eh?
Kai> Regarding indentation style, maybe C-x h C-M-\ is good enough?
Kai> You can configure the indentation engine quite a bit in most
Kai> modes. For C and similar, see the CC mode info file.
Kai> Alas, the Emacs indentation styles do not add or remove
Kai> newlines, so the hanging braces thing cannot be checked (if I
Kai> assume correctly what you mean). You can configure CC mode to
Kai> auto-insert newlines when you hit `{', I think.
`c-toggle-auto-state'.
I love it, although I am sad that it doesn't fix code that has already
been done "wrong".
Kai> The GNU indent program can add or remove newlines. -- This
Kai> line is not blank.
There are alternatives for other languages (the original poster didn't
say which language he wanted). I'm sure someone wrote a launcher for
"checkstyle" which works on java.
Cheers
Phil