> On Nov 15, 2022, at 10:38 AM, Eli Zaretskii <eliz@gnu.org> wrote: > >> From: Yuan Fu <casouri@gmail.com> >> Date: Tue, 15 Nov 2022 10:18:21 -0800 >> Cc: Stefan Monnier <monnier@iro.umontreal.ca>, >> theo@thornhill.no, >> emacs-devel@gnu.org >> >>> Maybe we should grow some augmentations for tree-sitter, at least >>> given enough time. Or maybe it's possible to identify the parts where >>> this happens by some tree-sitter indications, and tweak the faces in >>> those regions in some way. >> >> I donât know how could you improve this in tree-sitter since macros are >> literally âdefine you own syntaxâ. We can reasonably fix the highlighting >> for some of our macros like DEFUN. As a demonstration I added some >> emacs-devel-specific rules (that are disabled by default). Run this: >> >> (add-hook 'c-ts-mode-hook >> (lambda () >> (treesit-font-lock-recompute-features '(emacs-devel)))) >> >> And restart c-ts-mode, and DEFUNâs should look normal now. > > I will try that when I have time, thanks. But if this indeed works > well, why not do something similar to fix more warnings? Truth to be told, I donât know how to fix errors around preprocessor directive (#ifdefâs). Our macros shouldnât be hard to fix. We can fix them as we encounter them. > And why not > make this the default, instead of asking users to write mode hooks? Because this is Emacs-specific? It specifically fixes highlight for the DEFUN macro, nothing else. We can add some dir-local config that automatically enables this. Yuan
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4