From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Another small problem of CC Mode Date: 12 Jan 2007 10:03:51 +0100 Message-ID: <20070112101615.GA1659@muc.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1168592807 10673 80.91.229.12 (12 Jan 2007 09:06:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 12 Jan 2007 09:06:47 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 12 10:06:44 2007 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.50) id 1H5IN1-00085Q-WE for ged-emacs-devel@m.gmane.org; Fri, 12 Jan 2007 10:06:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H5IN1-0001Hm-EE for ged-emacs-devel@m.gmane.org; Fri, 12 Jan 2007 04:06:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H5IKP-0008Ez-Q5 for emacs-devel@gnu.org; Fri, 12 Jan 2007 04:04:01 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H5IKN-0008Cz-7h for emacs-devel@gnu.org; Fri, 12 Jan 2007 04:04:00 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H5IKM-0008CV-V2 for emacs-devel@gnu.org; Fri, 12 Jan 2007 04:03:59 -0500 Original-Received: from [193.149.48.1] (helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H5IKI-0001hT-72 for emacs-devel@gnu.org; Fri, 12 Jan 2007 04:03:54 -0500 Original-Received: (qmail 61125 invoked by uid 3782); 12 Jan 2007 09:03:51 -0000 Original-Received: from acm.muc.de (p54A3DB1E.dip.t-dialin.net [84.163.219.30]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Fri, 12 Jan 2007 10:03:49 +0100 Original-Received: (qmail 3099 invoked by uid 1000); 12 Jan 2007 10:16:15 -0000 Original-Date: Fri, 12 Jan 2007 10:16:15 +0000 Original-To: Herbert Euler Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de 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:65162 Archived-At: Hi, Guanpeng! On Fri, Jan 12, 2007 at 09:58:31AM +0800, Herbert Euler wrote: > Hi, > > In a file that contains C program like this: > > extern void g(void); > extern void h(void); > > int > f(void) > { > do { > #ifdef M1 > } while (g()); > #else > } while (h()); > #endif /* M1 */ > } > Many functions in CC mode will behave incorrectly: > `c-beginning-of-defun' and `c-end-of-defun' cannot go to the right > place; `c-indent-command' cannot indent to the right column; > `c-electric-brace' tells an error, which is not, when typing the `}' > that finishes the function `f'; and so on. Yes. C is a ghastly language. ;-) > Of course, this is rare. But will making CC Mode detect this > situation and behave in a right way need much effort? It's difficult to make Emacs's syntax stuff only see one of the "}"s. Not impossible, just difficult. I've been thinking about it, off and on, for about two years now. Fixing it would probably take more effort than it's worth - but a mention in the "Limitation and Known Bugs" section of the manual might be sensible. > Thanks in advance. > Regards, > Guanpeng Xu -- Alan Mackenzie (Ittersbach, Germany)