[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rainbow-delimiters bb38452706 155/188: Remove the Emacs Li
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rainbow-delimiters bb38452706 155/188: Remove the Emacs Lisp specific escaping test. |
Date: |
Sat, 1 Jan 2022 00:59:01 -0500 (EST) |
branch: elpa/rainbow-delimiters
commit bb384527069ad72d67d879999b2e7d62ae5180c8
Author: Fanael Linithien <fanael4@gmail.com>
Commit: Fanael Linithien <fanael4@gmail.com>
Remove the Emacs Lisp specific escaping test.
In fact, nuke the infrastructure altogether.
Parens as characters without a backslash are nasty and they really should
never be used:
- This syntax is discouraged by the GNU Emacs Lisp Reference Manual.
- They confuse many a minor mode, such as show-paren-mode.
- The way we currently handle them partially solves the problem, but
is a hack made of eldritch magic, implemented by gluing special cases
together hoping they'll work...
- ...but it doesn't really work, and it's pretty easy to get
mishighlighted delimiters anyway.
- They confuse the Emacs Lisp indentation engine. Really.
- It's the major mode's job to set the syntax-table properties on
individual characters.
Because of these reasons, it's just easier to drop this misfeature
and rely on people to start using ?\( instead.
And because the whole point of
rainbow-delimiters-escaped-char-predicate-list is to allow for this,
nuke it too. It was never *really* a documented part of the API.
---
rainbow-delimiters-test.el | 10 +++++-----
rainbow-delimiters.el | 27 +--------------------------
2 files changed, 6 insertions(+), 31 deletions(-)
diff --git a/rainbow-delimiters-test.el b/rainbow-delimiters-test.el
index 27c9ec56c7..9fb40a4879 100644
--- a/rainbow-delimiters-test.el
+++ b/rainbow-delimiters-test.el
@@ -194,17 +194,17 @@
(ert-deftest doesnt-highlight-escaped-delimiters ()
(with-temp-buffer-in-mode 'emacs-lisp-mode
- (with-string (str "(bar ?\\( ?( (foo?))")
+ (with-string (str "(bar ?\\( (foo?))")
(should (ert-equal-including-properties
(buffer-string)
- #("(bar ?\\( ?( (foo?))"
+ #("(bar ?\\( (foo?))"
0 1
(face (rainbow-delimiters-depth-1-face))
- 12 13
+ 9 10
(face (rainbow-delimiters-depth-2-face))
- 17 18
+ 14 15
(face (rainbow-delimiters-depth-2-face))
- 18 19
+ 15 16
(face (rainbow-delimiters-depth-1-face))))))))
(ert-deftest cycles-faces ()
diff --git a/rainbow-delimiters.el b/rainbow-delimiters.el
index 0320ce3dee..6be845f1e1 100644
--- a/rainbow-delimiters.el
+++ b/rainbow-delimiters.el
@@ -184,27 +184,6 @@ The delimiter is not highlighted if it's a blacklisted
delimiter."
(rainbow-delimiters--depth-face depth)))))
(font-lock-prepend-text-property loc (1+ loc) 'face delim-face))))
-(defvar rainbow-delimiters-escaped-char-predicate nil)
-(make-variable-buffer-local 'rainbow-delimiters-escaped-char-predicate)
-
-(defvar rainbow-delimiters-escaped-char-predicate-list
- '((emacs-lisp-mode . rainbow-delimiters--escaped-char-predicate-emacs-lisp)
- (lisp-interaction-mode .
rainbow-delimiters--escaped-char-predicate-emacs-lisp)
- (inferior-emacs-lisp-mode .
rainbow-delimiters--escaped-char-predicate-emacs-lisp)
- ))
-
-(defun rainbow-delimiters--escaped-char-predicate-emacs-lisp (loc)
- "Non-nil iff the character at LOC is escaped as per Emacs Lisp rules."
- (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)) ?\?)))
- ;; Treat the ? as a quote character only when it starts a symbol, so
- ;; we're not confused by (foo?), which is a valid function call.
- (let ((inhibit-changing-match-data t))
- (save-excursion
- (goto-char (1- loc))
- (looking-at "\\_<")))))
-
(defun rainbow-delimiters--char-ineligible-p (loc ppss delim-syntax-code)
"Return t if char at LOC should not be highlighted.
PPSS is the `parse-partial-sexp' state at LOC.
@@ -228,9 +207,7 @@ Returns t if char at loc meets one of the following
conditions:
((/= 0 (logand #x20000 delim-syntax-code))
(/= 0 (logand #x10000 (or (car (syntax-after (1- loc))) 0))))
(t
- nil))
- (when rainbow-delimiters-escaped-char-predicate
- (funcall rainbow-delimiters-escaped-char-predicate loc))))
+ nil))))
(defconst rainbow-delimiters--delim-regex "\\s(\\|\\s)"
"Regex matching all opening and closing delimiters the mode highlights.")
@@ -240,8 +217,6 @@ Returns t if char at loc meets one of the following
conditions:
"Highlight delimiters in region between point and END.
Used by font-lock for dynamic highlighting."
- (setq rainbow-delimiters-escaped-char-predicate
- (cdr (assoc major-mode
rainbow-delimiters-escaped-char-predicate-list)))
(let* ((inhibit-point-motion-hooks t)
;; Point can be anywhere in buffer; determine the nesting depth at
point.
(last-ppss-pos (point))
- [nongnu] elpa/rainbow-delimiters 153284f304 168/188: Fix a typo., (continued)
- [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
- [nongnu] elpa/rainbow-delimiters d576e6694a 188/188: Add Emacs 27.2 to CI, ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 8911d984e6 004/188: Use markdown syntax in the README file., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 8dded7ba49 010/188: Bugfix: Removing text properties using re-search-forward can now go to point-max instead of (1- (point-max)), apparently thanks to a change in Emacs CVS., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters bb38452706 155/188: Remove the Emacs Lisp specific escaping test.,
ELPA Syncer <=
- [nongnu] elpa/rainbow-delimiters c37b61c4b5 163/188: Release version 2.0.1., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 3d1e204f04 169/188: Allow the user to customize the way faces are picked., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 7919681b0d 187/188: Use keyword arguments in define-minor-mode, ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters eb7b957adc 001/188: Initial commit., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 55d098bc39 013/188: Add changelog entry noting addition of global-rainbow-delimiters-mode., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 3482ea5ced 002/188: Update README to link to the appropriate locations at EmacsWiki., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 25ad3c3def 016/188: Update README.markdown; include instructions re: global-rainbow-delimiters-mode., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 779b40f39d 021/188: Update README.markdown; include instructions re: global-rainbow-delimiters-mode., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters a44624fa05 018/188: Update README.markdown; include instructions re: global-rainbow-delimiters-mode., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 56faa7bd86 019/188: Update README.markdown; include instructions re: global-rainbow-delimiters-mode., ELPA Syncer, 2022/01/01