From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: CC Mode 5.31.4 (C/l); c-end-of-defun broken Date: Wed, 18 Apr 2007 14:10:05 -0400 Message-ID: <87zm55sgea.fsf@stupidchicken.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1176919694 17052 80.91.229.12 (18 Apr 2007 18:08:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 18 Apr 2007 18:08:14 +0000 (UTC) Cc: Andreas Schwab , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 18 20:08:07 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 1HeEZZ-0000wc-T9 for ged-emacs-devel@m.gmane.org; Wed, 18 Apr 2007 20:08:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HeEeQ-0006JW-Sn for ged-emacs-devel@m.gmane.org; Wed, 18 Apr 2007 14:13:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HeEeN-0006JH-O0 for emacs-devel@gnu.org; Wed, 18 Apr 2007 14:13:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HeEeL-0006IC-EA for emacs-devel@gnu.org; Wed, 18 Apr 2007 14:13:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HeEeL-0006I5-8p for emacs-devel@gnu.org; Wed, 18 Apr 2007 14:13:01 -0400 Original-Received: from cyd.mit.edu ([18.19.1.138]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HeEZT-0005AB-FW for emacs-devel@gnu.org; Wed, 18 Apr 2007 14:07:59 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 832F04E45F; Wed, 18 Apr 2007 14:10:05 -0400 (EDT) In-Reply-To: (Andreas Schwab's message of "Wed\, 18 Apr 2007 17\:28\:40 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.98 (gnu/linux) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:69573 Archived-At: Andreas Schwab writes: > c-end-of-defun no longer always goes to the end of the function. This > breaks add-log-current-defun, for example. It doesn't always happen, but > you can reproduce it with > . > Just load the file and type M-C-e. You end up in the middle of > lookup_partial_symtab instead of at the end of lookup_symtab. The trouble is the following code in c-end-of-defun (cc-cmds.el:1645): ;; Move forward to the } of a function (if (> arg 0) (setq arg (c-forward-to-nth-EOF-} arg where)))) ;; Do we need to move forward from the brace to the semicolon? (when (eq arg 0) (if (c-in-function-trailer-p) ; after "}" of struct/enum, etc. (c-syntactic-re-search-forward ";")) The function c-in-function-trailer-p thinks we are between the closing brace and the semicolon of struct construct, because this function returns a struct *: struct symtab * lookup_symtab (const char *name) { Alan, can you come up with a quick fix?