From ec08e2f4da08c2d53ba10442ba3a9b58ba914d8c Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sun, 14 Aug 2005 06:59:39 +0000 Subject: (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. --- lisp/delsel.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lisp/delsel.el') diff --git a/lisp/delsel.el b/lisp/delsel.el index 74ef011d47..d7a3d90e96 100644 --- a/lisp/delsel.el +++ b/lisp/delsel.el @@ -101,7 +101,11 @@ any selection." (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. -- cgit v1.2.3