emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: narrow-to-defun and mark-defun now work properly for CC Mode.


From: Chong Yidong
Subject: Re: narrow-to-defun and mark-defun now work properly for CC Mode.
Date: Wed, 11 Apr 2007 14:04:59 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (gnu/linux)

Alan Mackenzie <address@hidden> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]