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: On the behavior of `c-beginning-of-defun' Date: 20 Jan 2007 20:37:53 +0100 Message-ID: <20070120205053.GA2078@muc.de> References: <200612301209.55371.xugp@alibaba-inc.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1169321897 5870 80.91.229.12 (20 Jan 2007 19:38:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 20 Jan 2007 19:38:17 +0000 (UTC) Cc: bug-cc-mode@gnu.org, herberteuler@hotmail.com, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 20 20:38:14 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 1H8M2W-0003Cq-Jv for ged-emacs-devel@m.gmane.org; Sat, 20 Jan 2007 20:38:12 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H8M2X-0002lA-3U for ged-emacs-devel@m.gmane.org; Sat, 20 Jan 2007 14:38:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H8M2I-0002fk-Kw for emacs-devel@gnu.org; Sat, 20 Jan 2007 14:37:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H8M2F-0002XT-Kv for emacs-devel@gnu.org; Sat, 20 Jan 2007 14:37:58 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H8M2F-0002X8-Cu for emacs-devel@gnu.org; Sat, 20 Jan 2007 14:37:55 -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 1H8M2E-00061F-Qk for emacs-devel@gnu.org; Sat, 20 Jan 2007 14:37:55 -0500 Original-Received: (qmail 8567 invoked by uid 3782); 20 Jan 2007 19:37:53 -0000 Original-Received: from acm.muc.de (p54A3F67E.dip.t-dialin.net [84.163.246.126]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sat, 20 Jan 2007 20:37:51 +0100 Original-Received: (qmail 2196 invoked by uid 1000); 20 Jan 2007 20:50:53 -0000 Original-Date: Sat, 20 Jan 2007 20:50:53 +0000 Original-To: Herbert Euler Content-Disposition: inline In-Reply-To: <200612301209.55371.xugp@alibaba-inc.com> 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:65326 Archived-At: Hi, Guanpeng! On Sat, Dec 30, 2006 at 12:09:55PM +0800, Herbert Euler wrote: [ .... ] > I planned to use `c-beginning-of-defun' and `c-end-of-defun'. But I > found a strange behavior of `c-beginning-of-defun'. In the attatched > `x.c' file, `c-beginning-of-defun' moves point differently for the > function `main' and others. For the `main' function, it moves point to > the open of the function body, i.e. before the { at line 6; for other > functions, it moves point to the beginning of the definition of the > function, i.e. before the type specification of the return value of the > function. [ .... ] I've fixed this bug, basically by analysing K&R regions much more rigorously. I've just committed cc-defs.el and cc-engine.el to savannah.gnu.org. Please try out the amended version and let me know if anything's not right. > Thanks in advance. Thank you for the bug report! > int > main (argc, argv) > int argc; > char *argv[]; > { > if () > ; > } -- Alan Mackenzie (Ittersbach, Germany).