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

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

[nongnu] elpa/symbol-overlay 213629dc13 120/152: Add a "hook" which is c


From: ELPA Syncer
Subject: [nongnu] elpa/symbol-overlay 213629dc13 120/152: Add a "hook" which is called when overlays are created
Date: Thu, 7 Jul 2022 12:04:20 -0400 (EDT)

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

    Add a "hook" which is called when overlays are created
---
 symbol-overlay.el | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/symbol-overlay.el b/symbol-overlay.el
index be11a8841b..77da5c5208 100644
--- a/symbol-overlay.el
+++ b/symbol-overlay.el
@@ -156,9 +156,8 @@
   :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."
+(defcustom symbol-overlay-overlay-created-functions '()
+  "Functions called after overlay creation that may modify the overlay."
   :group 'symbol-overlay
   :type 'hook)
 
@@ -342,12 +341,11 @@ 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
-                                 'cursor-sensor-functions
-                                 `(,symbol-overlay-cursor-hook)))
+                    (overlay-put ov 'symbol symbol))
       (overlay-put ov 'face 'symbol-overlay-default-face)
-      (overlay-put ov 'symbol ""))))
+      (overlay-put ov 'symbol ""))
+    (dolist (fun symbol-overlay-overlay-created-functions)
+      (funcall fun ov))))
 
 (defun symbol-overlay-put-all (symbol scope &optional keyword)
   "Put overlays on all occurrences of SYMBOL in the buffer.



reply via email to

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