branch: elpa/rainbow-delimiters
commit b9991fb222a6b1b2622a58725c1de8cd3cc6900b
Author: Fanael Linithien <[email protected]>
Commit: Fanael Linithien <[email protected]>
Handle unescaped parentheses characters, e.g. ?(
It's deprecated, but people seem to still use them instead of recommended
?\(
Fixes #11 and #15.
---
rainbow-delimiters.el | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/rainbow-delimiters.el b/rainbow-delimiters.el
index 0201f8b113..c1514ee1ef 100644
--- a/rainbow-delimiters.el
+++ b/rainbow-delimiters.el
@@ -415,11 +415,11 @@ Sets text properties:
))
(defun rainbow-delimiters-escaped-char-predicate-emacs-lisp (loc)
- (and (eq (char-before loc) ?\\) ; escaped char, e.g. ?\) - not counted
- (and (not (eq (char-before (1- loc)) ?\\)) ; special-case: ignore ?\\
- (eq (char-before (1- loc)) ?\?))))
-;; NOTE: standard char read syntax '?)' is not tested for because emacs manual
-;; states punctuation such as delimiters should _always_ use escaped '?\)'
form.
+ (or (and (eq (char-before loc) ?\?) ; e.g. ?) - deprecated, but people use it
+ (not (and (eq (char-before (1- loc)) ?\\) ; special case: ignore ?\?
+ (eq (char-before (- loc 2)) ?\?))))
+ (and (eq (char-before loc) ?\\) ; escaped char, e.g. ?\) - not counted
+ (eq (char-before (1- loc)) ?\?))))
(defun rainbow-delimiters-escaped-char-predicate-lisp (loc)
(eq (char-before loc) ?\\))