Function: eglot--track-changes-signal

eglot--track-changes-signal is a byte-compiled function defined in eglot.el.gz.

Signature

(eglot--track-changes-signal ID &optional DISTANCE)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/eglot.el.gz
(defun eglot--track-changes-signal (id &optional distance)
  (cond
   (distance
    ;; When distance is <100, we may as well coalesce the changes.
    (when (> distance 100) (eglot--track-changes-fetch id)))
   (eglot--recent-changes nil)
   ;; Note that there are pending changes, for the benefit of those
   ;; who check it as a boolean.
   (t (setq eglot--recent-changes :pending)))
  (when eglot--change-idle-timer (cancel-timer eglot--change-idle-timer))
  (setq eglot--change-idle-timer
        (run-with-idle-timer
         eglot-send-changes-idle-time nil
         (lambda (buf)
           (eglot--when-live-buffer buf
             (when eglot--managed-mode
               (if (track-changes-inconsistent-state-p)
                   ;; Not a good time (e.g. in the middle of Quail thingy,
                   ;; bug#70541): reschedule for the next idle period.
                   (eglot--add-one-shot-hook
                    'post-command-hook
                    (lambda ()
                      (eglot--when-live-buffer buf
                        (eglot--track-changes-signal id))))
                 (run-hooks 'eglot--document-changed-hook)
                 (setq eglot--change-idle-timer nil)))))
         (current-buffer))))