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

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

[nongnu] elpa/symbol-overlay eff8230ffe 119/152: Add a hook for when the


From: ELPA Syncer
Subject: [nongnu] elpa/symbol-overlay eff8230ffe 119/152: Add a hook for when the cursor enters or leaves the symbol overlay
Date: Thu, 7 Jul 2022 12:04:20 -0400 (EDT)

branch: elpa/symbol-overlay
commit eff8230ffe18553bde9f195263b2415c38acbe6b
Author: Langston Barrett <langston.barrett@gmail.com>
Commit: Langston Barrett <langston.barrett@gmail.com>

    Add a hook for when the cursor enters or leaves the symbol overlay
---
 symbol-overlay.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/symbol-overlay.el b/symbol-overlay.el
index ca39e28333..be11a8841b 100644
--- a/symbol-overlay.el
+++ b/symbol-overlay.el
@@ -156,6 +156,12 @@
   :group 'symbol-overlay
   :type 'float)
 
+(defcustom symbol-overlay-cursor-hook
+  '(lambda (window oldpos entered-or-left) '())
+  "A function that is put in the cursor-sensor-functions on every overlay."
+  :group 'symbol-overlay
+  :type 'hook)
+
 (defcustom symbol-overlay-ignore-functions
   '((c-mode . symbol-overlay-ignore-function-c)
     (c++-mode . symbol-overlay-ignore-function-c++)
@@ -336,7 +342,10 @@ Otherwise apply `symbol-overlay-default-face'."
     (if face (progn (overlay-put ov 'face face)
                     (overlay-put ov 'keymap symbol-overlay-map)
                     (overlay-put ov 'evaporate t)
-                    (overlay-put ov 'symbol symbol))
+                    (overlay-put ov 'symbol symbol)
+                    (overlay-put ov
+                                 'cursor-sensor-functions
+                                 `(,symbol-overlay-cursor-hook)))
       (overlay-put ov 'face 'symbol-overlay-default-face)
       (overlay-put ov 'symbol ""))))
 



reply via email to

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