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: end-of-defun acts weirdly in c-mode; also, mark-defun in c-mode Date: Mon, 2 Feb 2009 20:27:03 +0000 Message-ID: <20090202202703.GB11077@muc.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1233605283 519 80.91.229.12 (2 Feb 2009 20:08:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Feb 2009 20:08:03 +0000 (UTC) Cc: bug-cc-mode@gnu.org, emacs-devel@gnu.org To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 02 21:09:16 2009 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 1LU56N-000401-4u for ged-emacs-devel@m.gmane.org; Mon, 02 Feb 2009 21:09:03 +0100 Original-Received: from localhost ([127.0.0.1]:46367 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LU554-00086w-73 for ged-emacs-devel@m.gmane.org; Mon, 02 Feb 2009 15:07:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LU550-000867-Cf for emacs-devel@gnu.org; Mon, 02 Feb 2009 15:07:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LU54w-00083Y-Ur for emacs-devel@gnu.org; Mon, 02 Feb 2009 15:07:37 -0500 Original-Received: from [199.232.76.173] (port=56802 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LU54w-00083V-PS for emacs-devel@gnu.org; Mon, 02 Feb 2009 15:07:34 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:2179 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LU54w-0000Cq-5i for emacs-devel@gnu.org; Mon, 02 Feb 2009 15:07:34 -0500 Original-Received: (qmail 50052 invoked by uid 3782); 2 Feb 2009 20:07:29 -0000 Original-Received: from acm.muc.de (pD9E53D6C.dip.t-dialin.net [217.229.61.108]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 02 Feb 2009 21:07:27 +0100 Original-Received: (qmail 11460 invoked by uid 1000); 2 Feb 2009 20:27:03 -0000 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-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:108630 Archived-At: Hi, Miles! On Mon, Feb 02, 2009 at 05:13:39PM +0900, Miles Bader wrote: > Instead of moving to the end of the current function, it actually seems > to move one line further if there's whitespace there. This is > inconsistent with the behavior of end-of-defun elsewhere in emacs. In 1 2 3 (defun foo () 4 (bar)) 5 6 , C-M-e moves point to BOL 5. In 1 2 3 int foo () 4 { 5 return bar () ; 6 } 7 8 , C-M-e moves pointo to BOL 7. Honest, I've just tried it, with CVS from a few days ago, with -Q. That looks consistent to me. I must have missed something, somewhere. Could you put some elisp and C source up with a precise description of how they're different, please. > Also, since "mark-defun" basically does the right thing in c-mode > (except for slightly funny handling of whitespace due to c-mode's wacky > end-of-defun behavior), the current c-mode specific binding of C-M-h > (c-mark-function) should probably be removed. `c-mark-function' will mark a construct which lacks a brace block, such as int foo (int bar) ; , whereas C-M-a and C-M-e search for outermost brace blocks ("soon" to be enhanced to find objects inside C++ namespaces and the like). I have no idea how useful this marking of a braceless construct is. _Somebody_ probably uses it. (Hi, Barry Warsaw, are you listening?) > Thanks, > -Miles -- Alan Mackenzie (Nuremberg, Germany).