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: 21 Jan 2007 20:33:56 +0100 Message-ID: <20070121204700.GA6901@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 1169408056 9423 80.91.229.12 (21 Jan 2007 19:34:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 21 Jan 2007 19:34:16 +0000 (UTC) Cc: bug-cc-mode@gnu.org, xugp@alibaba-inc.com, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 21 20:34:13 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 1H8iSC-00068B-Rc for ged-emacs-devel@m.gmane.org; Sun, 21 Jan 2007 20:34:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H8iSC-00046x-Cy for ged-emacs-devel@m.gmane.org; Sun, 21 Jan 2007 14:34:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H8iS0-00046a-OH for emacs-devel@gnu.org; Sun, 21 Jan 2007 14:34:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H8iRy-00045t-HV for emacs-devel@gnu.org; Sun, 21 Jan 2007 14:33:59 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H8iRy-00045m-Bz for emacs-devel@gnu.org; Sun, 21 Jan 2007 14:33:58 -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 1H8iRx-0001dR-L9 for emacs-devel@gnu.org; Sun, 21 Jan 2007 14:33:58 -0500 Original-Received: (qmail 55000 invoked by uid 3782); 21 Jan 2007 19:33:56 -0000 Original-Received: from acm.muc.de (p54A3E0EA.dip.t-dialin.net [84.163.224.234]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sun, 21 Jan 2007 20:33:52 +0100 Original-Received: (qmail 7346 invoked by uid 1000); 21 Jan 2007 20:47:01 -0000 Original-Date: Sun, 21 Jan 2007 20:47:01 +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:65348 Archived-At: Hi, Guanpeng! On Sun, Jan 21, 2007 at 09:19:44AM +0800, Herbert Euler wrote: > >Please try out the amended version and let me know if anything's not > >right. > I did not test all cases but only the case that function > `c-beginning-of-defun' fails. I think it is almost Ok. However, > please try the following case, it might be a bug. Yes. It's a bug. > Suppose `-!-' indicates the position of point. [ .... ] > But if point is just after ``[]'': > > /* 1. K&R C. */ > > /* This will not get correct result until the bug in CC mode is fixed. > See > http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg01341.html > */ > int > main1 (argc, argv) > int argc; > char *argv[]-!-; > { > /* ... */ > } > > `c-beginning-of-defun' moves point to the start of the file, rather > than the desired position. I've patched cc-cmds.el, which should fix the bug, and committed this to savannah. Please try it out again! > This is the only problem I can see until now. Thank you very much. > Regards, > Guanpeng Xu -- Alan Mackenzie (Ittersbach, Germany).