bug#81286: [PATCH] Support undo-in-region for 'apply entries
Helmut Eller <[email protected]>
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Aug 06 2026, Stefan Monnier wrote: >> One issue that came up is: If the undo-list looks like >> >> ((apply 0 (1 . 10) foo) >> (5 . 6)) >> >> and the active region is (2 . 8). Then the apply entry is ignored >> (because it's outside of the active region) but the second entry is >> applied (because it's inside the active region). > > That's a bug, indeed. The apply entry is not "outside of the active > region" but instead covers it. So we can either include the apply entry > in the filtered list (i.e. implicitly extend the > bounds) or not, but if we don't include it, it should be the end of the > filtered list, like when we bump into an insertion `(1 . 10)`. Hm, this is a bit tricky. I tried the other two approaches but both break existing test cases: undo-test-region-example and simple-tests--undo-apply. To allow experimentation, I made this customizable in commit 1273c1759e1 and adjusted the tests accordingly. At least for those tests, the current behavior, i.e. ignore partially selected items, seems to be the most useful. Maybe we should just keep the current behavior even if it looks like a bug?