emacs-devel
[Top][All Lists]
Advanced

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

Re: The current state of the comment-cache branch


From: Elias Mårtenson
Subject: Re: The current state of the comment-cache branch
Date: Sat, 24 Dec 2016 20:21:32 +0800

On 24 Dec 2016 7:36 pm, "Alan Mackenzie" <address@hidden> wrote:

> Could you or someone else explain why an open paren in column 0 can affect
> the parsing of syntax in cc-mode at all? After all, such parens have no
> special syntactic nor semantic meaning in C nor C++.

It is a convention established in Emacs around ?40 years ago, that such
an open paren signalled the start of a defun.  This sped Emacs up
enormously, since the alternative was searching back to the beginning of
the buffer to check whether the paren was at the top level.

Thank you and Eli for clarifying this. It makes much more sense to me now. 

I'm still wondering how useful this could be for C code though. There are many coding conventions where the opening { of a function does not go in the left-most column. As far as I understand, such coding conventions would lead to slower parsing? 

I'm specifically asking this since I have sometimes used such style and at least I don't think I've felt any slowness. 

reply via email to

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