GNU bug report logs -
#74523
31.0.50; `apply` elements screw up undo in region
Previous Next
Full log
View this message in rfc822 format
Package: Emacs
Version: 31.0.50
We currently don't support `apply` undo-elements very well (if at all)
in the undo-in-region feature.
Those elements used to be rare, but now that `comment-region` and other
users of `combine-change-calls` generate them, it's not as rare.
The following test fails because of that:
(ert-deftest simple-tests--undo-apply ()
(with-temp-buffer
(modula-2-mode) ;; A simple mode with non-LF terminated comments.
(buffer-enable-undo)
(insert "foo\n\n")
(let ((midbeg (point-marker))
(_ (insert "midmid"))
(midend (point-marker)))
(insert "\n\nbar")
(undo-boundary)
(goto-char (+ midbeg 3))
(insert "\n")
(undo-boundary)
(comment-region (point-min) midbeg)
(undo-boundary)
(comment-region midend (point-max))
(undo-boundary)
(progn
(goto-char midbeg)
(set-mark midend)
(setq last-command 'something-else) ;Not `undo', so we start a new run.
(undo '(4))
(should (equal (buffer-substring midbeg midend) "midmid")))
)))
- Stefan
This bug report was last modified 203 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.