[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rainbow-delimiters 4bac5ce118 158/188: Don't flush the syn
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rainbow-delimiters 4bac5ce118 158/188: Don't flush the syntax-ppss cache unless necessary. |
Date: |
Sat, 1 Jan 2022 00:59:01 -0500 (EST) |
branch: elpa/rainbow-delimiters
commit 4bac5ce11823ac8b69cbfc34a83be82f017f5ab3
Author: Fanael Linithien <fanael4@gmail.com>
Commit: Fanael Linithien <fanael4@gmail.com>
Don't flush the syntax-ppss cache unless necessary.
---
rainbow-delimiters.el | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/rainbow-delimiters.el b/rainbow-delimiters.el
index 548516ca96..00988c64b0 100644
--- a/rainbow-delimiters.el
+++ b/rainbow-delimiters.el
@@ -255,17 +255,23 @@ Used by font-lock for dynamic highlighting."
(when rainbow-delimiters-mode
(font-lock-add-keywords nil rainbow-delimiters--font-lock-keywords 'append)
(set (make-local-variable 'jit-lock-contextually) t)
- ;; `syntax-begin-function' may break the assumption we rely on that
- ;; `syntax-ppss' is exactly equivalent to `parse-partial-sexp' from
- ;; `point-min'. Just don't use it, the performance hit should be
negligible.
- (set (make-local-variable 'syntax-begin-function) nil)
- ;; Obsolete equivalent of `syntax-begin-function'.
- (when (boundp 'font-lock-beginning-of-syntax-function)
- (with-no-warnings
- (set (make-local-variable 'font-lock-beginning-of-syntax-function)
nil)))
- ;; We modified `syntax-begin-function', so flush the cache to avoid getting
- ;; cached values that used the old value.
- (syntax-ppss-flush-cache 0))
+ (let ((flush-needed nil))
+ (when syntax-begin-function
+ ;; `syntax-begin-function' may break the assumption we rely on that
+ ;; `syntax-ppss' is exactly equivalent to `parse-partial-sexp' from
+ ;; `point-min'. Just don't use it, the performance hit should be
+ ;; negligible.
+ (setq flush-needed t)
+ (set (make-local-variable 'syntax-begin-function) nil))
+ ;; Obsolete equivalent of `syntax-begin-function'.
+ (when (bound-and-true-p font-lock-beginning-of-syntax-function)
+ (setq flush-needed t)
+ (with-no-warnings
+ (set (make-local-variable 'font-lock-beginning-of-syntax-function)
nil)))
+ (when flush-needed
+ ;; We modified `syntax-begin-function', so flush the cache to avoid
+ ;; getting cached values that used the old value.
+ (syntax-ppss-flush-cache 0))))
(when font-lock-mode
(if (fboundp 'font-lock-flush)
(font-lock-flush)
- [nongnu] elpa/rainbow-delimiters d723eb0a8c 134/188: In the C++ template syntax test, remove some text properties., (continued)
- [nongnu] elpa/rainbow-delimiters d723eb0a8c 134/188: In the C++ template syntax test, remove some text properties., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 039e9345c5 136/188: Document why there's no Emacs 24 requirement., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 115173b2eb 142/188: Rename README.markdown to README.md., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters e50e4787b4 144/188: Turn rainbow-delimiters-max-face-count into a defcustom., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 8b94fc0100 146/188: Make rainbow-delimiters-faces reachable from (customize-group 'faces)., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 82952aa34a 148/188: Test for blacklisting right before highlighting the delimiter., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters ef33129a0a 150/188: Treat byte compilation warnings as test suite failures., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters ab79aec8f8 153/188: Simplify the handling of escaped delimiters., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 402a9e8e04 152/188: Treat the ? as a quote character only when it starts a symbol., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters a802a6c823 156/188: Refactor the code, no functional changes., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 4bac5ce118 158/188: Don't flush the syntax-ppss cache unless necessary.,
ELPA Syncer <=
- [nongnu] elpa/rainbow-delimiters 9d23157002 160/188: Simplify the way we determine whether to flush syntax-ppss cache., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters cc829473be 170/188: Deprecate rainbow-delimiters-delimiter-blacklist., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters a4005ac963 162/188: Remove more useless comments., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters e75a4b18e9 159/188: Remove unneeded with-no-warnings., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 153284f304 168/188: Fix a typo., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 27d21f278b 167/188: Rephrase the header line description., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters a695c0f3b9 183/188: Use GitHub workflows for CI, ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 9a644d9e42 178/188: Pass -y to apt-get install, ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters f43d48a246 186/188: Widen before propertizing if under mmm-mode, ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 5125f4e476 185/188: Update the CI badge in the readme to point to GH Actions, ELPA Syncer, 2022/01/01