The command delete-region
records the point position at the time when the text was deleted in buffer-undo-list
(see help for buffer-undo-list
).
In my-test-1
the construct (save-excursion (forward-sentence 1) (point))
just returns the end of sentence position but does not move point in the scope of the delete-region
command.
In my-test-2
the point is moved to the end of sentence when deletion takes place. So, the end of sentence position is saved in buffer-undo-list
. Only after that the old point position is restored.