emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs rendering comparisson between emacs23 and emacs26.3


From: Clément Pit-Claudel
Subject: Re: emacs rendering comparisson between emacs23 and emacs26.3
Date: Sat, 28 Mar 2020 10:43:00 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 28/03/2020 05.58, Eli Zaretskii wrote:
> I think the way to increase performance of C/C++ fontification,
> indentation, etc. is to use syntactic analysis in C (or another
> similarly fast compiled language).  Several programs/libraries are
> available out there for this purpose, and we should encourage
> interested individuals to work on making these used by our major modes
> that support programming languages.  The time we could do that with
> ad-hoc regexps and the likes of syntax-ppss has gone, IMO.

I've looked, but I don't really know of any such libraries.  The problem that 
cc-mode has to solve most of the time is fontifying an invalid C program 
(since, unless the programmer is using a structural editing mode), code that is 
being typed is invalid most of the time.  Most language parsing facilities out 
there do not have great error recovery, so they are not very good at giving 
semantic annotations useful for syntax highlighting broken code.

The only great example I know is the OCaml parser written in Menhir, which is 
incredibly robust.  The most extreme one I know in the other direction is 
agda-mode, which only displays syntax highlighting when the buffer contains 
syntactically valid, type-correct code.

I wonder if Stefan's smie could be used to do syntax highlighting.

Clément.



reply via email to

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