emacs-devel
[Top][All Lists]
Advanced

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

Re: cc-mode fontification feels random


From: Stefan Monnier
Subject: Re: cc-mode fontification feels random
Date: Sat, 12 Jun 2021 11:46:56 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> I've seen that, but it's full of FIXMEs that basically tell me this is
> incomplete and perhaps even kludgey?

I haven't looked in detail at how it works, but w.r.t its interaction
with font-lock and jit-lock it seems sane.

> I don't really understand why the workarounds are needed (nor why
> font-lock-keywords would need to still be supported with TS).

`font-lock-keywords` is (ab)used by several other packages, like
hi-lock, so a major mode that uses font-lock but sets it up in a way
that ignores `font-lock-keywords` introduces problems.

Maybe instead of overriding `font-lock-fontify-region-function` it would
be better to use a single entry in `font-lock-keywords` which calls something
like `tree-sitter-hl--highlight-region`, but these are minor details
that don't affect the general approach.

> And I cannot say I'm happy with the uses of buffer-substring and the
> many conversions between character positions and byte positions.
> Maybe these could be cleaned up?

I'm pretty sure the code (and the authors) would welcome help making it
cleaner, yes.


        Stefan




reply via email to

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