# HG changeset patch # User Juri Linkov # Date 1124002641 0 # Node ID 803494c7e4b72d80777f4b3545d6b67ba87de9d5 # Parent 4fc385f4c685876fcc4fdfd83a1aef1a26b79367 (delete-selection-pre-hook): If overwrite-mode is enabled and the current command is self-insert-command, call it explicitly with overwrite-mode bound to nil, to not allow it to delete the character after the selected region. diff -r 4fc385f4c685 -r 803494c7e4b7 lisp/delsel.el --- a/lisp/delsel.el Sun Aug 14 06:56:23 2005 +0000 +++ b/lisp/delsel.el Sun Aug 14 06:57:21 2005 +0000 @@ -101,7 +101,11 @@ (unless empty-region (setq this-command 'ignore)))) (type - (delete-active-region))) + (delete-active-region) + (if (and overwrite-mode (eq this-command 'self-insert-command)) + (let ((overwrite-mode nil)) + (self-insert-command (prefix-numeric-value current-prefix-arg)) + (setq this-command 'ignore))))) (file-supersession ;; If ask-user-about-supersession-threat signals an error, ;; stop safe_run_hooks from clearing out pre-command-hook.