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: 30 Dec 2006 21:15:49 +0100 Message-ID: <20061230212715.GA1198@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 1167509774 28021 80.91.229.12 (30 Dec 2006 20:16:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 30 Dec 2006 20:16:14 +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 Dec 30 21:16:12 2006 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 1H0kci-0004pu-VA for ged-emacs-devel@m.gmane.org; Sat, 30 Dec 2006 21:16:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H0kci-0008RX-D1 for ged-emacs-devel@m.gmane.org; Sat, 30 Dec 2006 15:16:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H0kcU-0008QO-At for emacs-devel@gnu.org; Sat, 30 Dec 2006 15:15:54 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H0kcT-0008Q8-Eb for emacs-devel@gnu.org; Sat, 30 Dec 2006 15:15:54 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H0kcT-0008Q5-A4 for emacs-devel@gnu.org; Sat, 30 Dec 2006 15:15:53 -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 1H0kcS-0003GJ-Pt for emacs-devel@gnu.org; Sat, 30 Dec 2006 15:15:53 -0500 Original-Received: (qmail 64330 invoked by uid 3782); 30 Dec 2006 20:15:49 -0000 Original-Received: from acm.muc.de (p54A3E16D.dip.t-dialin.net [84.163.225.109]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sat, 30 Dec 2006 21:15:47 +0100 Original-Received: (qmail 3405 invoked by uid 1000); 30 Dec 2006 21:27:15 -0000 Original-Date: Sat, 30 Dec 2006 21:27:15 +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:64522 Archived-At: Hi, Guanpeng! On Sat, Dec 30, 2006 at 12:09:55PM +0800, Herbert Euler wrote: > Hello Alan, [ .... ] > 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. [ .... ] > Is this a bug or a desired behavior of `c-beginning-of-defun'? The behaviour of c-beginning-of-defun in your `main' function is a bug. c-b-o-d should go to before "int \nmain". As you wrote, the square brackets in "*argv[]" is confusing the function. Thanks for reporting this bug! I'll try and fix it soon. > Please reply to both this mail address (xugp@alibaba-inc.com) and my > orignal mail address (herberteuler@hotmail.com) if possible. > Thanks in advance. > Regards, > Guanpeng Xu > int > main (argc, argv) > int argc; > char *argv[]; > { > if () > ; > } [ .... ] -- Alan Mackenzie (Ittersbach, Germany)