]> git.eshelyaron.com Git - emacs.git/commit
Eglot: abandon track-changes.el
authorJoão Távora <joaotavora@gmail.com>
Wed, 22 Jan 2025 15:44:41 +0000 (15:44 +0000)
committerEshel Yaron <me@eshelyaron.com>
Thu, 23 Jan 2025 10:26:15 +0000 (11:26 +0100)
commit4b34c81d62c4c44cae57f88489a11b3e3cf60386
treea499985decdcf201d9d1040fa60f8811b6b4159b
parent416cb3150a3445ffd8a23801e95fbe475c235537
Eglot: abandon track-changes.el

After a ~10 month period of using track-changes.el as a support library
for tracking buffer changes, I've decided to go back to manually using
after-change-functions and before-change-functions.

track-changes.el showed promise:

- One of the selling points was to turn complicated a-c-functions and
  b-c-functions into something easier, but that objectively didn't pan
  out, with "virtual" positions, one-shot hooks, and tracker
  registrations being abstractions and complications mastered by very
  few.

- The other selling point was the ability to log and detect those parts
  of Emacs that cheat the modification hooks and correct them.  As far
  as I can tell, only one such cheater -- quail.el -- was identified.
  But with little consequence, only an ugly workaround in eglot.el (now
  removed).

- After using Eglot daily for all this time, I didn't notice any
  decrease in desynchronization events.

- I did notice an increase in track-changes.el related bugs, some of
  which still baffle me and and hard to reproduce.  A common occurence
  is the '(cl-assertion-failed (memq id track-changes--trackers))'
  which is hard to track down.

- The library makes it more complicated to run Eglot on older Emacsen.

I might yet revisit this matter for the next version but this
experience has shown that it didn't bring the advantages I thought it
would, so I'm abandoning it until at least 1.19 is out.

* lisp/progmodes/eglot.el (track-changes): No longer require.
(eglot--virtual-pos-to-lsp-position): Delete.
(eglot--managed-mode): Simplify.
(eglot--track-changes): Delete this variable.
(eglot--recent-changes): Reword doc.
(eglot--before-change, eglot--after-change): Bring back.
(eglot--track-changes-fetch): Delete.
(eglot--add-one-shot-hook): Delete.
(eglot--track-changes-signal): Delete.

(cherry picked from commit ac902ddadcd236dfd1d610768569e26ea8fc5b7f)
lisp/progmodes/eglot.el