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: narrow-to-defun and mark-defun now work properly for CC Mode. Date: Wed, 11 Apr 2007 14:04:59 -0400 Message-ID: <87lkgypz1w.fsf@stupidchicken.com> References: <20070409123730.GD1065@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1176314584 10713 80.91.229.12 (11 Apr 2007 18:03:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 11 Apr 2007 18:03:04 +0000 (UTC) Cc: Sean O'Rourke , David Hansen , Dave Love , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 11 20:03:00 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 1Hbh9n-0001kE-VF for ged-emacs-devel@m.gmane.org; Wed, 11 Apr 2007 20:03:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HbhDs-0003T2-1P for ged-emacs-devel@m.gmane.org; Wed, 11 Apr 2007 14:07:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HbhDn-0003S4-IH for emacs-devel@gnu.org; Wed, 11 Apr 2007 14:07:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HbhDm-0003RQ-KH for emacs-devel@gnu.org; Wed, 11 Apr 2007 14:07:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HbhDm-0003R7-5n for emacs-devel@gnu.org; Wed, 11 Apr 2007 14:07:06 -0400 Original-Received: from cyd.mit.edu ([18.19.1.138]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hbh9g-0006jH-8O; Wed, 11 Apr 2007 14:02:52 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 727574E45B; Wed, 11 Apr 2007 14:04:59 -0400 (EDT) In-Reply-To: <20070409123730.GD1065@muc.de> (Alan Mackenzie's message of "9 Apr 2007 13\:18\:04 +0200\, Mon\, 9 Apr 2007 13\:37\:30 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (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:69296 Archived-At: Alan Mackenzie writes: > I've patched .../lisp/progmodes/cc-{defs,langs,cmds,awk}.el in savannah > (but not yet at SourceForge) so that these two commands work properly - > up till now, they've enclosed the region between the braces; now they > enclose the entire function, including the function header. > > The basic idea is to set \(beginning\|end\)-of-defun-function to the > corresponding CC Mode functions. However, C-M-[ae] remain bound > directly to these CC Mode functions to allow optimisation for large > argument (factor ~10 in speed). The trouble is that font-lock uses {beginning/end}-of-defun-function. Because c-{beginning/end}-of-defun-function is slow (which is apparently unavoidable due to syntactic complications), it makes font-lock unacceptably slow (> 20 seconds for M-> in xdisp.c). Having narrow-to-defun including the function header would be nice, but if no solution to the slowness problem arises quickly, I think this change should be postphoned to post-22.