Closed langston-barrett closed 5 years ago
Thanks for the quick review! I implemented your more general overlay-creation hook, and was able to recover my special case:
(defun my/cursor-function (window oldpos entered-or-left)
(when (equal entered-or-left 'entered)
(message "entered")))
(defun my/symbol-overlay-overlay-created-function (ov)
(overlay-put ov 'cursor-sensor-functions '(my/cursor-function)))
(add-to-list 'symbol-overlay-overlay-created-functions
'my/symbol-overlay-overlay-created-function)
Your detailed feedback was educational, I'm obviously a novice elisp programmer!
NB: The list is called "functions" because that's what the emacs manual section on hooks describes as the proper terminology for hooks that take arguments.
@purcell This is ready for a second round of review
I'm going to use this to enter what Spacemacs calls a "transient state", rather than using the keymap (which is confusing when combined with Spacemacs/Evil modal keybindings).
I don't think we actually need to require
cursor-sensor
for this to work? Can we just add the property anyway?