[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rainbow-delimiters 5a56248229 101/188: Pass the variable s
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rainbow-delimiters 5a56248229 101/188: Pass the variable symbol to rainbow-delimiters-apply-color directly. |
Date: |
Sat, 1 Jan 2022 00:58:56 -0500 (EST) |
branch: elpa/rainbow-delimiters
commit 5a5624822934db3b4dde910b1aff358e6bb695cd
Author: Fanael Linithien <fanael4@gmail.com>
Commit: Fanael Linithien <fanael4@gmail.com>
Pass the variable symbol to rainbow-delimiters-apply-color directly.
This means we do one concat and intern-soft less on every highlighted
delimiter, yielding an easy ~10% speed gain and less GC traffic.
---
rainbow-delimiters.el | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/rainbow-delimiters.el b/rainbow-delimiters.el
index 6d9ed3be9b..eb59142ce2 100644
--- a/rainbow-delimiters.el
+++ b/rainbow-delimiters.el
@@ -452,13 +452,13 @@ Returns t if char at loc meets one of the following
conditions:
(defun rainbow-delimiters-apply-color (delim depth loc match)
"Apply color for DEPTH to DELIM at LOC following user settings.
-DELIM is a string specifying delimiter type.
+DELIM is a symbol of the variable specifying whether to highlight this
delimiter
+type.
DEPTH is the delimiter depth, or corresponding face # if colors are repeating.
LOC is location of character (delimiter) to be colorized.
MATCH is nil iff it's a mismatched closing delimiter."
;; Ensure user has enabled highlighting of this delimiter type.
- (when (symbol-value (intern-soft
- (concat "rainbow-delimiters-highlight-" delim "s-p")))
+ (when (symbol-value delim)
(rainbow-delimiters-propertize-delimiter loc
depth
match)))
@@ -469,19 +469,23 @@ MATCH is nil iff it's a mismatched closing delimiter."
"Regex matching all opening and closing delimiters the mode highlights.")
(defconst rainbow-delimiters-opening-delim-info
- '((?\( . "paren") (?\{ . "brace") (?\[ . "bracket"))
+ '((?\( . rainbow-delimiters-highlight-parens-p)
+ (?\{ . rainbow-delimiters-highlight-braces-p)
+ (?\[ . rainbow-delimiters-highlight-brackets-p))
"Open delimiter information: list of (DELIMITER . TYPE).
DELIMITER is the opening delimiter.
-TYPE is the delimiter type string for `rainbow-delimiters-apply-color'.")
+TYPE is the delimiter type for `rainbow-delimiters-apply-color'.")
(defconst rainbow-delimiters-closing-delim-info
- '((?\) ?\( . "paren") (?\} ?\{ . "brace") (?\] ?\[ . "bracket"))
+ '((?\) ?\( . rainbow-delimiters-highlight-parens-p)
+ (?\} ?\{ . rainbow-delimiters-highlight-braces-p)
+ (?\] ?\[ . rainbow-delimiters-highlight-brackets-p))
"Closing delimiter information: list of (DELIMITER OPENING . TYPE).
DELIMITER is the closing delimiter.
OPENING is the corresponding opening delimiter.
-TYPE is the delimiter type string for `rainbow-delimiters-apply-color'.")
+TYPE is the delimiter type for `rainbow-delimiters-apply-color'.")
;; Main function called by font-lock.
(defun rainbow-delimiters-propertize (end)
- [nongnu] elpa/rainbow-delimiters b78dd93407 048/188: Silence the byte compiler warnings., (continued)
- [nongnu] elpa/rainbow-delimiters b78dd93407 048/188: Silence the byte compiler warnings., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 40c2aa5ce3 028/188: Update description and commentary at top of file., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 9c4950a283 060/188: Properly tear down the mode when changing major mode., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 75acc28109 063/188: Release version 1.3.7., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters a1cd80ee8d 073/188: Remove the changelog., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 0fa4723a9d 080/188: Add rainbow-delimiters-ignore-modes, ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters df4976a965 086/188: Release version 1.3.9., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters b85b86c0b4 088/188: Release version 1.3.10., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 49fb05303a 090/188: Use when/if instead of and/or+and., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 3a18183db3 092/188: Remove cider-repl-mode from rainbow-delimiters-ignore-modes., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 5a56248229 101/188: Pass the variable symbol to rainbow-delimiters-apply-color directly.,
ELPA Syncer <=
- [nongnu] elpa/rainbow-delimiters e05dd60c12 100/188: Don't propertize if the syntax table is unset, ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters d4d8f74158 110/188: Use #' to quote function names., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 575620510f 111/188: Reindent after cf61a3aee6., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 0a4e4958ed 113/188: Add a missing or in rainbow-delimiters--char-ineligible-p., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 1473fbddce 116/188: Add a test suite., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 89574443f0 117/188: Fix the Emacs 24.3-specific test failure., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 30c6a4c1bc 118/188: Use the major mode's syntax table directly., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 406ee45e7c 126/188: Rewrite the installation and usage instructions., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters 7b882c9489 138/188: Merge (let … (let* …)) => (let* …)., ELPA Syncer, 2022/01/01
- [nongnu] elpa/rainbow-delimiters f57067cda5 140/188: Make Emacs 23 tests less verbose., ELPA Syncer, 2022/01/01