[Top][All Lists]

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

Re: Mysterious fontification/C++ context issue - Patch for beginning-of-

From: Stefan Monnier
Subject: Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw.
Date: Fri, 15 Dec 2006 18:33:29 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

> That makes me wonder whether find_defun_start should use
> syntax-begin-function.

Yes, that's what should happen.

> Does that work right?

I don't think we should try that at this stage.  It's post-22 AFAIC.

> If so, we could eliminate open-paren-in-column-0-is-defun-start.
> Stefan suggested something similar: making back_comment use syntax-ppss.

Actually what I intended to suggest is to use it in find_defun_start (which
is used by back_comment).

> How hard is that to implement?

I doubt it'll be a small local change.

> As for fixing the misfontifications of C mode, David Kastrup wrote:

>     The large slowdown most likely would not be necessary if information
>     was reused intelligently and not scanned repeatedly.  That requires a
>     good analysis and careful implementation/reimplementation.

I suspect that the patch I sent a minute ago which sets
font-lock-beginning-of-syntax-function to nil in cc-mode buffers will remove
a large part of the slowdown.

> Should C mode do (setq beginning-of-defun-function 'c-beginning-of-defun)
> Is there any reason that would be bad?

The only reason I could think of is if they want to use the default
beginning-of-defun in font-lock-beginning-of-syntax-function (and they don't
want to do that in cc-mode buffers) or when beginning-of-defun is misused.


reply via email to

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