[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/dart-mode 06e2d4b 160/192: Respect font-lock-maximum-decor
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/dart-mode 06e2d4b 160/192: Respect font-lock-maximum-decoration |
Date: |
Sun, 29 Aug 2021 11:02:09 -0400 (EDT) |
branch: elpa/dart-mode
commit 06e2d4b2129b1f4c54e7ba7585b5005e90e5346d
Author: Brady Trainor <mail@bradyt.com>
Commit: Brady Trainor <mail@bradyt.com>
Respect font-lock-maximum-decoration
This is not intended to coincide completely with suggestions at
http://www.gnu.org/software/emacs/manual/html_node/elisp/Levels-of-Font-Lock.html,
but rather to get the refactoring of font-lock-keywords started.
Specifically, we see only function declarations fontified if we set
font-lock-maximum-decoration to 1.
---
dart-mode.el | 46 ++++++++++++++++++++++++++++------------------
1 file changed, 28 insertions(+), 18 deletions(-)
diff --git a/dart-mode.el b/dart-mode.el
index 79eea39..ddda8c6 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -593,24 +593,34 @@ indentation levels from right to left."
(t (throw 'result nil)))))))
(setq dart-font-lock-defaults
- `((,dart--async-keywords-re
- ,(regexp-opt dart--keywords 'words)
- (,(regexp-opt dart--builtins 'words) . font-lock-builtin-face)
- (,(regexp-opt dart--constants 'words) . font-lock-constant-face)
- (,dart--hex-number-re . (1 font-lock-constant-face))
- (,dart--number-re . (1 font-lock-constant-face))
- (,dart--metadata-re . font-lock-constant-face)
- (,(regexp-opt dart--types 'words) . font-lock-type-face)
- (,dart--types-re . font-lock-type-face)
- (dart--function-declaration-func . font-lock-function-name-face)
- (dart--declared-identifier-func . font-lock-variable-name-face)
- (dart--declared-identifier-anchor-func
- . (dart--declared-identifier-next-func
- nil
- nil
- (0 font-lock-variable-name-face)))
- (dart--string-interpolation-id-func (0 font-lock-variable-name-face
t))
- (dart--string-interpolation-exp-func (0 font-lock-variable-name-face
t)))))
+ '((dart-font-lock-keywords-1 dart-font-lock-keywords-1
+ dart-font-lock-keywords-2
+ dart-font-lock-keywords-3)))
+
+(setq dart-font-lock-keywords-1
+ '((dart--function-declaration-func .
font-lock-function-name-face)))
+
+(setq dart-font-lock-keywords-2
+ `(,dart--async-keywords-re
+ ,(regexp-opt dart--keywords 'words)
+ (,(regexp-opt dart--builtins 'words) . font-lock-builtin-face)
+ (,(regexp-opt dart--constants 'words) . font-lock-constant-face)
+ (,dart--hex-number-re . (1 font-lock-constant-face))
+ (,dart--number-re . (1 font-lock-constant-face))
+ (,dart--metadata-re . font-lock-constant-face)
+ (,(regexp-opt dart--types 'words) . font-lock-type-face)
+ (,dart--types-re . font-lock-type-face)
+ (dart--function-declaration-func . font-lock-function-name-face)
+ (dart--declared-identifier-func . font-lock-variable-name-face)
+ (dart--declared-identifier-anchor-func
+ . (dart--declared-identifier-next-func
+ nil
+ nil
+ (0 font-lock-variable-name-face)))
+ (dart--string-interpolation-id-func (0 font-lock-variable-name-face
t))
+ (dart--string-interpolation-exp-func (0 font-lock-variable-name-face
t))))
+
+(setq dart-font-lock-keywords-3 dart-font-lock-keywords-2)
(setq dart-string-delimiter (rx (and
;; Match even number of backslashes.
- [nongnu] elpa/dart-mode 3a73a1f 090/192: Make dart-executable-path resilient to wrappers, (continued)
- [nongnu] elpa/dart-mode 3a73a1f 090/192: Make dart-executable-path resilient to wrappers, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode b4e592f 098/192: Add more search commands, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode c172f19 106/192: Support completing multiple parameters, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 2b085f5 125/192: Do not fail if Flycheck is not available. (#52), ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode c973dea 127/192: Require ‘help-mode’., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 68f7f4f 132/192: Require cl for emacs 24.4, 24.5, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode caa7a19 124/192: Don't error out with revert-buffer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 199709f 148/192: Removes cc-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode da244c6 144/192: Fixes no such file or directory, dartfmt.exe, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 9db2679 143/192: Fixes invalid file path format on Windows, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 06e2d4b 160/192: Respect font-lock-maximum-decoration,
ELPA Syncer <=
- [nongnu] elpa/dart-mode 3082066 185/192: Don't font lock anchor in a string, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode ad93bc1 165/192: Edit headers, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode f6a1c9a79 171/192: Fix byte-compiling errors and warnings, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 1273ccb 191/192: Make changes to list of dart-mode keywords easier to diff, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode a9899a9 182/192: Fontify abstract methods, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode c523992 004/192: Handle map indentation with identifiers., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 30f9326 007/192: Make constants better., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 5ce38b7 009/192: Add a couple known bugs., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 64a573f 010/192: Require 'cl when compiling., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode b42c2ca 014/192: Another known bug., ELPA Syncer, 2021/08/29