emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/idle-highlight-mode 902df81b5a 18/59: Cleanup: deprecation


From: ELPA Syncer
Subject: [nongnu] elpa/idle-highlight-mode 902df81b5a 18/59: Cleanup: deprecation warning using `in-string-p`
Date: Thu, 7 Jul 2022 12:00:29 -0400 (EDT)

branch: elpa/idle-highlight-mode
commit 902df81b5aa6cf28ed15f03ac3a8acb9359b826c
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Cleanup: deprecation warning using `in-string-p`
---
 idle-highlight-mode.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/idle-highlight-mode.el b/idle-highlight-mode.el
index f4ec224da3..0f4dcd4d5e 100755
--- a/idle-highlight-mode.el
+++ b/idle-highlight-mode.el
@@ -77,6 +77,11 @@
 
 (defvar idle-highlight--global-timer nil "Timer to trigger highlighting.")
 
+(defsubst idle-highlight--ignore-context ()
+  "Return non-nil when in a context that should be ignored."
+  ;; In a string.
+  (nth 3 (syntax-ppss)))
+
 (defun idle-highlight--word-at-point ()
   "Highlight the word under the point."
   (if idle-highlight-mode
@@ -87,7 +92,7 @@
       (idle-highlight--unhighlight)
       (when
         (and
-          target-symbol (not (in-string-p))
+          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) 
"\\>"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]