emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Position-only undo records


From: Yuan Fu
Subject: Position-only undo records
Date: Sun, 27 Mar 2022 13:47:04 -0700

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]