[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/idle-highlight-mode 305e9d4aa0 26/59: Cleanup: remove inte
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/idle-highlight-mode 305e9d4aa0 26/59: Cleanup: remove intermediate symbol type variable |
Date: |
Thu, 7 Jul 2022 12:00:30 -0400 (EDT) |
branch: elpa/idle-highlight-mode
commit 305e9d4aa0a18e8cec708fe78cb9cad1fdbecc2d
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Cleanup: remove intermediate symbol type variable
Use bounds-of-thing-at-point to get the bounds instead.
Allows for greater flexibility in the future too.
(such as removing highlighting for the current symbol).
---
idle-highlight-mode.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/idle-highlight-mode.el b/idle-highlight-mode.el
index b78ece1a88..cada2c62d7 100755
--- a/idle-highlight-mode.el
+++ b/idle-highlight-mode.el
@@ -105,16 +105,17 @@
"Highlight the word under the point."
(when (bound-and-true-p idle-highlight-mode)
(idle-highlight--unhighlight)
- (let ((target-symbol (symbol-at-point)))
+ (let ((target-range (bounds-of-thing-at-point 'symbol)))
(when
(and
- target-symbol (not (idle-highlight--ignore-context))
+ target-range (not (idle-highlight--ignore-context))
;; 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)))))))
+ (pcase-let* ((`(,beg . ,end) target-range))
+ (let ((target (buffer-substring-no-properties beg end)))
+ (when (not (member target idle-highlight-exceptions))
+ (setq idle-highlight--regexp (concat "\\<" (regexp-quote target)
"\\>"))
+ (highlight-regexp idle-highlight--regexp 'idle-highlight))))))))
;; ---------------------------------------------------------------------------
- [nongnu] elpa/idle-highlight-mode 0916be7075 53/59: Cleanup: docstrings, (continued)
- [nongnu] elpa/idle-highlight-mode 0916be7075 53/59: Cleanup: docstrings, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 5881f796ad 57/59: Minor tweaks to code-comments, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode e6239e06fd 22/59: Add license file., ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode ac31f75fd0 28/59: Remove local variable when the mode is disabled, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode c7af42119a 38/59: Cleanup: remove unnecessary variable, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 5418252a11 59/59: Change URL to codeberg, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 53b4e3c855 45/59: Add option idle-highlight-exceptions-syntax, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 459720cd2e 29/59: Add `global-idle-highlight-mode` (globalized minor mode), ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode defcfe2756 54/59: Fix #1 face exceptions interact badly with hl-line-mode, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 1f40f80921 30/59: Remove "end" from idle-highlight-exceptions, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 305e9d4aa0 26/59: Cleanup: remove intermediate symbol type variable,
ELPA Syncer <=
- [nongnu] elpa/idle-highlight-mode eaac86a1a2 49/59: Add idle-highlight-visible-buffers to apply to all buffers, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 7f81263388 11/59: Add configurations for excepted words and what idle time to use., ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 7c43cc3d7a 09/59: [Refactor] Lose some weight., ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 3d785f0f1d 44/59: Support *-exceptions & *-exceptions-face to be callback functions, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode e8f724fec2 35/59: Use a local list of overlays for highlighting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode a801e7113f 43/59: Remove 'idle-highlight-use-hi-lock-mode', ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 97047f2574 33/59: Add Campbell Barton as an author, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode 98d20252d6 42/59: readme: add "Motivation" & "Other Packages" section, ELPA Syncer, 2022/07/07
- [nongnu] elpa/idle-highlight-mode d0fcf29c7d 46/59: Cleanup: unnecessary pcase-let* use, ELPA Syncer, 2022/07/07