]> git.eshelyaron.com Git - emacs.git/commit
lisp/emacs-lisp/track-changes.el: New file (bug#70077)
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 5 Apr 2024 21:37:32 +0000 (17:37 -0400)
committerEshel Yaron <me@eshelyaron.com>
Sun, 14 Apr 2024 17:11:04 +0000 (19:11 +0200)
commit47e8af453b0100e8ec1a278ae35393c2003eb9e9
tree4ca62b2ccbfacab56d9c25c1363aa4af8c1f4c4a
parentb2f3ad39486494fdeb0ed2df770f67fcfdcce292
lisp/emacs-lisp/track-changes.el: New file (bug#70077)

This new package provides an API that is easier to use right than
our `*-change-functions` hooks.

The patch includes changes to `diff-mode.el` and `eglot.el` to
make use of this new package.

* lisp/emacs-lisp/track-changes.el: New file.
* test/lisp/emacs-lisp/track-changes-tests.el: New file.
* doc/lispref/text.texi (Tracking changes): New subsection.

* lisp/progmodes/eglot.el: Require `track-changes`.
(eglot--virtual-pos-to-lsp-position): New function.
(eglot--track-changes): New var.
(eglot--managed-mode): Use `track-changes-register` i.s.o
`after/before-change-functions` when available.
(eglot--track-changes-signal): New function, partly extracted from
`eglot--after-change`.
(eglot--after-change): Use it.
(eglot--track-changes-fetch): New function.
(eglot--signal-textDocument/didChange): Use it.

* lisp/vc/diff-mode.el: Require `track-changes`.
Also require `easy-mmode` before the `eval-when-compile`s.
(diff-unhandled-changes): Delete variable.
(diff-after-change-function): Delete function.
(diff--track-changes-function): Rename from `diff-post-command-hook`
and adjust to new calling convention.
(diff--track-changes): New variable.
(diff--track-changes-signal): New function.
(diff-mode, diff-minor-mode): Use it with `track-changes-register`.

(cherry picked from commit d7a83e23d47ca9e3e6ca70078e956e31301e5e6d)
doc/lispref/text.texi
etc/NEWS
lisp/emacs-lisp/track-changes.el [new file with mode: 0644]
lisp/progmodes/eglot.el
lisp/vc/diff-mode.el
test/lisp/emacs-lisp/track-changes-tests.el [new file with mode: 0644]