[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rainbow-delimiters 50551159a7 124/188: Move rainbow-delimi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rainbow-delimiters 50551159a7 124/188: Move rainbow-delimiters--mode-turn-{on, off} back into rainbow-delimiters-mode. |
Date: |
Sat, 1 Jan 2022 00:58:58 -0500 (EST) |
branch: elpa/rainbow-delimiters
commit 50551159a7ab570543e05446b96e1f37adc8b7ed
Author: Fanael Linithien <fanael4@gmail.com>
Commit: Fanael Linithien <fanael4@gmail.com>
Move rainbow-delimiters--mode-turn-{on,off} back into
rainbow-delimiters-mode.
They're not necessary anymore, as neither function is registered in a hook.
---
rainbow-delimiters.el | 38 +++++++++++++++-----------------------
1 file changed, 15 insertions(+), 23 deletions(-)
diff --git a/rainbow-delimiters.el b/rainbow-delimiters.el
index 432a33d488..4b7c525f6b 100644
--- a/rainbow-delimiters.el
+++ b/rainbow-delimiters.el
@@ -347,33 +347,25 @@ Used by font-lock for dynamic highlighting."
(defconst rainbow-delimiters--font-lock-keywords
'(rainbow-delimiters--propertize))
-(defun rainbow-delimiters--mode-turn-on ()
- "Set up `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))
-
-(defun rainbow-delimiters--mode-turn-off ()
- "Tear down `rainbow-delimiters-mode'."
- (font-lock-remove-keywords nil rainbow-delimiters--font-lock-keywords))
-
;;;###autoload
(define-minor-mode rainbow-delimiters-mode
"Highlight nested parentheses, brackets, and braces according to their
depth."
nil "" nil ; No modeline lighter - it's already obvious when the mode is on.
- (if rainbow-delimiters-mode
- (rainbow-delimiters--mode-turn-on)
- (rainbow-delimiters--mode-turn-off))
+ (font-lock-remove-keywords nil rainbow-delimiters--font-lock-keywords)
+ (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))
(when font-lock-mode
(if (fboundp 'font-lock-flush)
(font-lock-flush)
- [nongnu] elpa/rainbow-delimiters f2404ef0bf 108/188: Remove dead code., (continued)
- [nongnu] elpa/rainbow-delimiters f2404ef0bf 108/188: Remove dead code., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters cf61a3aee6 109/188: Use double hyphen to indicate internal symbols., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 2cde18809f 112/188: Use the syntax table to determine if a delimiters starts a comment., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 513bb785eb 114/188: Update authorship, package metadata, and URLs., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 4699fd94c8 115/188: Release version 1.3.13., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters ed5dd72f79 119/188: Restore the ability to disable the highlighting of selected delimiters., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters f5679e9040 120/188: Simplify two ifs by using max in their stead., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters b32fedb455 121/188: Remove an unneeded condition., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters d8de0c6954 122/188: Kill rainbow-delimiters--parse-partial-sexp-cache when turning off., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters f50a4ae177 123/188: Use `syntax-ppss` instead of our own implementation., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 50551159a7 124/188: Move rainbow-delimiters--mode-turn-{on, off} back into rainbow-delimiters-mode.,
ELPA Syncer <=
- [nongnu] elpa/rainbow-delimiters 44bd65920e 127/188: Remove the TODO list from rainbow-delimiters.el., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 25ceded842 128/188: Add MELPA and build status badges to the readme., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters df63c842a3 131/188: Update the customization instructions., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 845e681fae 135/188: Use lexical-binding., ELPA Syncer, 2022/01/01
- [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