Commit graph

16 commits

Author SHA1 Message Date
Michael Albinus
cf01f8776a Merge from origin/emacs-30
7dbbd58d6c Locate password icon in global-mode-string
19049efd30 ; Fix last documentation change
2c640e63a8 Explain tty-color-mode frame parameter more.
e5d600006e ; * src/doc.c (Ftext_quoting_style): Make doc string agre...
90c6880a92 (track-changes--after): Fix problem found in bug#73041
2024-10-18 17:56:15 +02:00
Stefan Monnier
f994154d08 * lisp/emacs-lisp/track-changes.el (track-changes--backtrace): Fix prefix 2024-10-17 12:54:04 -04:00
Stefan Monnier
90c6880a92 (track-changes--after): Fix problem found in bug#73041
When calling `track-changes--before` (e.g. because of a missing
b-f-c or for some other reason), it sets `track-changes--before-end`
to the right value so we shouldn't increment it right after.
Also, we should update `track-changes--buffer-size` before
calling `track-changes--before` so it doesn't risk signaling
a spurious inconsistency.

* lisp/emacs-lisp/track-changes.el (track-changes--after):
Update `track-changes--buffer-size` earlier, and don't increment
`track-changes--before-end` when we call `track-changes--before`.
2024-10-17 11:39:19 -04:00
Stefan Monnier
ef587bf6b4 track-changes.el: Improve error tracing to help debugging
Add a new `trace` setting for `track-changes-record-errors` to
record more information in order to try and help find the root
cause of errors.

* lisp/emacs-lisp/track-changes.el (track-changes--trace): New var.
(track-changes-record-errors): Document new `trace` setting.
(track-change--backtrace, track-changes--trace): New functions.
(track-changes--recover-from-error): Use them.
(track-changes--error-log): Document new format.
(track-changes-register, track-changes-unregister)
(track-changes-fetch, track-changes--before, track-changes--after):
Call `track-changes--trace`.
2024-10-03 14:32:09 -04:00
Paul Eggert
3dcac22dd4 Spelling fixes 2024-06-04 22:16:28 -07:00
Stefan Monnier
436b344be3 track-changes.el: Keep a bit more info when logging an error
* lisp/emacs-lisp/track-changes.el (track-changes--recover-from-error):
Add arg `info`.
(track-changes-fetch, track-changes--after): Use it to preserve a bit
more information about errors.
2024-05-30 19:00:23 -04:00
Stefan Monnier
44036b32ba eglot.el: Require track-changes unconditionally
* lisp/emacs-lisp/track-changes.el: Bump version.

* lisp/progmodes/eglot.el: Require `track-changes` unconditionally.
(Package-Requires:): Add `track-changes`.
(eglot--track-changes-signal, eglot--signal-textDocument/didChange)
(eglot--managed-mode): Remove non-track-changes alternative code.
(eglot--before-change, eglot--after-change): Delete functions.
2024-05-05 17:23:29 -04:00
Stefan Monnier
c9b0e2bd8e * lisp/emacs-lisp/track-changes.el (track-changes-inconsistent-state-p): Typo 2024-05-03 16:39:29 -04:00
Stefan Monnier
b6d4e81a48 track-changes.el: Add a workaround for bug#70541
* lisp/emacs-lisp/track-changes.el (track-changes-inconsistent-state-p):
 New function.
* lisp/progmodes/eglot.el (eglot--track-changes-signal): Use it.
2024-05-03 13:23:00 -04:00
Stefan Monnier
71d2ec7aba (track-changes--call-signal): Silence late signals
* lisp/emacs-lisp/track-changes.el (track-changes--call-signal):
Skip the call if the tracker was unregistered.
2024-04-19 22:19:00 -04:00
Stefan Monnier
523aca13a4 * lisp/emacs-lisp/track-changes.el: Fix trailer 2024-04-17 10:57:11 -04:00
Stefan Monnier
3660c51736 track-changes.el: Fix last change for early use
* lisp/emacs-lisp/track-changes.el (track-changes--recover-from-error):
Don't burp if there have been fewer than 20 keystrokes since Emacs start.
2024-04-17 09:04:12 -04:00
Stefan Monnier
a33ab7565e track-changes.el: Minor changes for version 1.0
Arrange for the library to be usable on older Emacsen, which
includes reducing the noise when `before/after-change-functions`
are badly paired or missing.
Also, since the signal function receives the distance (for `:disjoint`),
we don't need `track-changes--disjoint-threshold`: the signal
function can simply do nothing when the distance is smaller than
the threshold it wants to use.

* lisp/emacs-lisp/track-changes.el: Prepare header for ELPA.
(track-changes--tracker, track-changes--state): Don't use `:noinline`,
so as to be compatible with Emacs<27.
(track-changes-record-errors): New variable.
(track-changes--recover-from-error): Use it.  Record only the last 20
keys and the last 50 stack frames in the error log.
(track-changes--disjoint-threshold): Delete variable.
(track-changes--before): Don't use it any more.

* lisp/progmodes/eglot.el (eglot--track-changes-signal):
Coalesce disjoint changes nearer than what used to be coalesced because of
`track-changes--disjoint-threshold`.
2024-04-16 21:57:05 -04:00
Stefan Monnier
3ac1a7b6fe (track-changes-fetch): Fix nested use case
* lisp/emacs-lisp/track-changes.el (track-changes-fetch):
Don't presume that if there's nothing to do we're on
`track-changes--clean-trackers`.
2024-04-15 16:06:54 -04:00
Stefan Monnier
5fda398fb3 (track-changes--before): Fix bug#70396
* lisp/emacs-lisp/track-changes.el (track-changes--before):
Widen the buffer before accessing it with positions
potentially outside the beg..end region.
2024-04-15 15:53:48 -04:00
Stefan Monnier
d7a83e23d4 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`.
2024-04-13 09:43:11 -04:00