unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Position-only undo records
@ 2022-03-27 20:47 Yuan Fu
  0 siblings, 0 replies; only message in thread
From: Yuan Fu @ 2022-03-27 20:47 UTC (permalink / raw)
  To: Emacs developers

I have an undo visualization package that draws the undo history as a tree. Someone found that when their buffer-undo-list contains undo records that consists of only position records, my package doesn’t work right. Their buffer-undo-list looks like this:

(nil 7 nil 6 nil 5 nil 4 nil 3 nil 2 nil 1 nil 0 nil
     (22 . 23)
     nil
     (1 . 22)
     (t . 0))

The problem with this kind of undo record is that, when you undo the record, no redo record is pushed to buffer-undo-list. I think this makes sense since primitive-undo just calls goto-char for this kind of record and goto-char shouldn’t generate undo records anyway. However, undoing a record but not generating redo record breaks my package as it expects new records being pushed to buffer-undo-list.

My question is 1) is this expected behavior? (Undoing position-only records don’t push redo records to buffer-undo-list) and 2) should this kind of buffer-undo-list exist under normal circumstances? (If not, then I won’t handle this case and I’ll simply error out)

Thanks,
Yuan


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-27 20:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-27 20:47 Position-only undo records Yuan Fu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).