branch: elpa/rainbow-delimiters
commit 93cd2dc873e7fedca7abc599cd97d46db4376ac7
Author: Fanael Linithien <[email protected]>
Commit: Fanael Linithien <[email protected]>
syntax-begin-function is obsolete, so test for its existence
---
rainbow-delimiters.el | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/rainbow-delimiters.el b/rainbow-delimiters.el
index f53923c126..5f30e7cc2f 100644
--- a/rainbow-delimiters.el
+++ b/rainbow-delimiters.el
@@ -7,7 +7,7 @@
;; Fanael Linithien <[email protected]>
;; Maintainer: Fanael Linithien <[email protected]>
;; Created: 2010-09-02
-;; Version: 2.1.2
+;; Version: 2.1.3
;; Keywords: faces, convenience, lisp, tools
;; Homepage: https://github.com/Fanael/rainbow-delimiters
@@ -260,7 +260,7 @@ 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)
- (when (or syntax-begin-function
+ (when (or (bound-and-true-p 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.
@@ -268,7 +268,8 @@ Used by font-lock for dynamic highlighting."
;; `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)
+ (when (boundp 'syntax-begin-function)
+ (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)))