Variable: cursor-sensor-mode

cursor-sensor-mode is a buffer-local variable defined in cursor-sensor.el.gz.

Documentation

Non-nil if Cursor-Sensor mode is enabled.

Use the command cursor-sensor-mode(var)/cursor-sensor-mode(fun) to change this variable.

View in manual

Probably introduced at or before Emacs version 25.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cursor-sensor.el.gz
;;;###autoload
(define-minor-mode cursor-sensor-mode
  "Handle the `cursor-sensor-functions' text property.
This property should hold a list of functions which react to the motion
of the cursor.  They're called with three arguments (WINDOW OLDPOS DIR)
where WINDOW is the affected window, OLDPOS is the last known position of
the cursor and DIR can be `entered', `left', or `moved' depending on whether
the cursor is entering the area covered by the text-property property,
leaving it, or just moving inside of it."
  :global nil
  (cond
   (cursor-sensor-mode
    ;; Also add ourselves to `post-command-hook' because
    ;; `pre-redisplay-functions' are sometimes called too late (after
    ;; adjust_point_for_property has moved point, which makes it
    ;; "impossible" for cursor-sensor-functions to do things like
    ;; revealing invisible text).
    (add-hook 'post-command-hook #'cursor-sensor--detect nil t)
    (add-hook 'pre-redisplay-functions #'cursor-sensor--detect
              nil t))
   (t
    (remove-hook 'post-command-hook #'cursor-sensor--detect t)
    (remove-hook  'pre-redisplay-functions #'cursor-sensor--detect
                t))))