emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU coding standard highlighting rules


From: Ted Zlatanov
Subject: Re: GNU coding standard highlighting rules
Date: Mon, 28 Mar 2011 14:28:09 -0500
User-agent: Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux)

On Sun, 27 Mar 2011 17:47:40 -0400 Stefan Monnier <address@hidden> wrote: 

>> I would love to see highlighting rules for C and ELisp that at least
>> catch the comment problems: starting with lowercase and a period without
>> two spaces, etc.  I don't know the Emacs highlighting at all so I can't
>> write these myself, plus I would probably miss many of the rules through
>> inexperience.

SM> That would be good, indeed.

I looked through www.gnu.org/prep/standards/ and here are my suggestions
for such a helper mode, by section.  Some will require actual C parsing,
of course.

2.1: highlight "Unix" in any case

2.3: highlight "trade\s*mark" and "(tm)".  Also perhaps the common funny
misspellings of "Windows" like "Winblows" and "Windoze"

3.2 and 3.3: highlight non-POSIX language use and compiler extension use?

3.4: highlight incorrect C function definitions (with special code for
ELisp functions maybe?)

3.5: highlight #ifdef constructs

4.2: `system', `malloc', `realloc' return code should be captured.  USC
`signal' calls should be caught.  Check the exit code is not typecast
from a larger value.  Highlight "/tmp" anywhere in code.

4.7: highlight usage of argv and argc (`getopt' is suggested)

5.1, 5.2, 5.3: almost everything applies I think, plus for 5.2 we can
add the rules about ending sentences with a period and two spaces and
starting with an uppercase character.

5.4: highlight CamelCase functions and variables

5.9, 5.10: highlight non-ASCII text





reply via email to

[Prev in Thread] Current Thread [Next in Thread]