(mouse-save-then-kill-delete-region): Take args BEG and END.
Update the undo list properly. (mouse-save-then-kill): Pass those args. When we kill, clear mouse-save-then-kill-posn and mouse-selection-click-count. (mouse-secondary-save-then-kill): Likewise. Delete the overlay after deleting the selection text. (mouse-selection-click-count): Initialize to 0. (mouse-save-then-kill-delete-region): Handle buffers with no undo list. Handle empty regions. Handle end < beg.
Showing with 37 additions and 24 deletions