From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: GNU coding standard highlighting rules Date: Mon, 28 Mar 2011 14:28:09 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87y63zjb92.fsf@lifelogs.com> References: <87ipvwl1nx.wl%claudio.bley@gmail.com> <83oc5ogp89.fsf@gnu.org> <87ipvuwslp.wl%claudio.bley@gmail.com> <87hbbc0zi6.wl%claudio.bley@gmail.com> <83oc5gsdwc.fsf@gnu.org> <87ei6bunxz.wl%claudio.bley@gmail.com> <83tyf6rhgn.fsf@gnu.org> <84zkoy6tah.wl%claudio.bley@gmail.com> <87hbb5a4xq.fsf@lifelogs.com> <84ipvkx1da.wl%claudio.bley@gmail.com> <87d3ls7n3b.fsf@lifelogs.com> <87vczdwjuk.wl%claudio.bley@gmail.com> <87k4fr3koi.fsf@lifelogs.com> <87d3lhimrw.wl%claudio.bley@gmail.com> <87aagk7c34.fsf_-_@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1301340520 4924 80.91.229.12 (28 Mar 2011 19:28:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Mar 2011 19:28:40 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 28 21:28:36 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4I79-0000fE-QY for ged-emacs-devel@m.gmane.org; Mon, 28 Mar 2011 21:28:36 +0200 Original-Received: from localhost ([127.0.0.1]:47023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4I78-0000zp-BE for ged-emacs-devel@m.gmane.org; Mon, 28 Mar 2011 15:28:34 -0400 Original-Received: from [140.186.70.92] (port=48456 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4I70-0000yx-5A for emacs-devel@gnu.org; Mon, 28 Mar 2011 15:28:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4I6y-0006Vb-Sg for emacs-devel@gnu.org; Mon, 28 Mar 2011 15:28:25 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:58717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4I6y-0006VE-J8 for emacs-devel@gnu.org; Mon, 28 Mar 2011 15:28:24 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q4I6w-0000We-Qm for emacs-devel@gnu.org; Mon, 28 Mar 2011 21:28:22 +0200 Original-Received: from 38.98.147.130 ([38.98.147.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Mar 2011 21:28:22 +0200 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Mar 2011 21:28:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 38.98.147.130 X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:csEnjPIN1qO4G47wO1DJaTUNC04= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:137796 Archived-At: On Sun, 27 Mar 2011 17:47:40 -0400 Stefan Monnier 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