[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rainbow-delimiters 9d23157002 160/188: Simplify the way we
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rainbow-delimiters 9d23157002 160/188: Simplify the way we determine whether to flush syntax-ppss cache. |
Date: |
Sat, 1 Jan 2022 00:59:01 -0500 (EST) |
branch: elpa/rainbow-delimiters
commit 9d231570024592fd21eb7c00bc17c8d3dd6952ec
Author: Fanael Linithien <fanael4@gmail.com>
Commit: Fanael Linithien <fanael4@gmail.com>
Simplify the way we determine whether to flush syntax-ppss cache.
---
rainbow-delimiters.el | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/rainbow-delimiters.el b/rainbow-delimiters.el
index 854449a2c0..c48cffbaa5 100644
--- a/rainbow-delimiters.el
+++ b/rainbow-delimiters.el
@@ -255,22 +255,18 @@ 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)
- (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)
- (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 (or syntax-begin-function
+ (bound-and-true-p font-lock-beginning-of-syntax-function))
+ ;; We're going to modify `syntax-begin-function', so flush the cache to
+ ;; avoid getting cached values that used the old value.
+ (syntax-ppss-flush-cache 0))
+ ;; `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)
+ (set (make-local-variable 'font-lock-beginning-of-syntax-function) nil)))
(when font-lock-mode
(if (fboundp 'font-lock-flush)
(font-lock-flush)
- [nongnu] elpa/rainbow-delimiters 039e9345c5 136/188: Document why there's no Emacs 24 requirement., (continued)
- [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, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 9d23157002 160/188: Simplify the way we determine whether to flush syntax-ppss cache.,
ELPA Syncer <=
- [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
- [nongnu] elpa/rainbow-delimiters 0823d0c67f 176/188: Release version 2.1.1, ELPA Syncer, 2022/01/01