-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve co-existence with keyword font-lock
TL;DR Although we don't want any syntactic font-lock (which instead is should be driven solely by tokens) we do want to peacefully co-exist with keyword search-based fontification. - Limit other font-lock to keywords (not syntactic); fixes #679. In fixing #669 we allowed things like highlight-indent-guides-mode to contribute font-lock-add-keywords (even though we don't use that mechanism). But we didn't sufficiently limit that: We didn't explicitly limit font-lock to keywords-only, and also we called the general purpose font-lock-default-fontify-region. As a result, font-lock based on char syntax could occur, with bad results. - Furthermore, defer calling font-lock-fontify-keywords-region until we handle our command response, and do so after we use tokens to add properties like face and char-syntax. This ensures keyword fontification does not happen inside strings or comments. - Update documentation wrt two choices for richer fontification: 1. Using some of racket-mode's search-based fontification keyword lists. In the example we skip the first two levels which concern syntax things better handled by tokenization. (Note this same approach can work if someone wants to define their own keyword patterns for other langs.) 2. Using binding faces from racket-xp-mode, as before, but change that to be enabled via a simple boolean variable, so can setq-local per buffer.
- Loading branch information
1 parent
6b832a3
commit 0160fca
Showing
7 changed files
with
453 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.