[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/idle-highlight-mode 93a498516e 19/59: Cleanup: slightly mo
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/idle-highlight-mode 93a498516e 19/59: Cleanup: slightly more efficient checks, postpone calling symbol-name |
Date: |
Thu, 7 Jul 2022 12:00:29 -0400 (EDT) |
branch: elpa/idle-highlight-mode
commit 93a498516e5abc7f10060319a231199df47845e6
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Cleanup: slightly more efficient checks, postpone calling symbol-name
---
idle-highlight-mode.el | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/idle-highlight-mode.el b/idle-highlight-mode.el
index 0f4dcd4d5e..98d633753c 100755
--- a/idle-highlight-mode.el
+++ b/idle-highlight-mode.el
@@ -84,19 +84,18 @@
(defun idle-highlight--word-at-point ()
"Highlight the word under the point."
- (if idle-highlight-mode
- (let*
- (
- (target-symbol (symbol-at-point))
- (target (symbol-name target-symbol)))
- (idle-highlight--unhighlight)
+ (when idle-highlight-mode
+ (idle-highlight--unhighlight)
+ (let ((target-symbol (symbol-at-point)))
(when
(and
target-symbol (not (idle-highlight--ignore-context))
- (looking-at-p "\\s_\\|\\sw") ;; Symbol characters
- (not (member target idle-highlight-exceptions)))
- (setq idle-highlight--regexp (concat "\\<" (regexp-quote target)
"\\>"))
- (highlight-regexp idle-highlight--regexp 'idle-highlight)))))
+ ;; Symbol characters.
+ (looking-at-p "\\s_\\|\\sw"))
+ (let ((target (symbol-name target-symbol)))
+ (when (not (member target idle-highlight-exceptions))
+ (setq idle-highlight--regexp (concat "\\<" (regexp-quote target)
"\\>"))
+ (highlight-regexp idle-highlight--regexp 'idle-highlight)))))))
(defsubst idle-highlight--unhighlight ()
"Clear current highlight."
- [nongnu] elpa/idle-highlight-mode 0423fc2b38 55/59: Fix #2 Substrings of identifiers are highlighted, (continued)
- [nongnu] elpa/idle-highlight-mode 0423fc2b38 55/59: Fix #2 Substrings of identifiers are highlighted, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 7401286a4b 01/59: Version 1.0. Initial Commit., ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode df7f6a84f5 07/59: Highlight only when point is on a symbol character., ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 834d03af77 08/59: Update version to 1.1.2, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode f360d4e7fe 12/59: [Formatting] Place defcustoms before defvars., ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 10eda41c22 15/59: Cleanup: use '--' separator for private functions and variables, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode fa7a82993e 16/59: Cleanup: use defvar-local, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 14150dde6b 17/59: Cleanup: quiet checkdoc warnings, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 59f5c6ce37 23/59: Add readme, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 2bc509cc28 20/59: Cleanup: byte code compiler warnings, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 93a498516e 19/59: Cleanup: slightly more efficient checks, postpone calling symbol-name,
ELPA Syncer <=
- [nongnu] elpa/idle-highlight-mode 8be1b197d6 39/59: Add changelog, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 94790ca395 47/59: Cleanup: variable names, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode bdc6cb06e0 37/59: Reduce the default idle time to 0.35 seconds, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode f47a2cc796 50/59: Cleanup: replace 'if' with 'cond', ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 7d6eba737d 52/59: Cleanup: remove redundant groups, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 05db87d2a5 32/59: Cleanup: replace defsubst with defun, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 21b63d0502 25/59: Cleanup: simplify coding hook example, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 4f41607fa1 31/59: Add idle-highlight-exceptions-face, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 0a24f8e402 58/59: Cleanup: use brief SPDX license, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 03b5de12a6 56/59: changelog: correct syntax, ELPA Syncer, 2022/07/07