changeset 64947:803494c7e4b7

(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.
author Juri Linkov <juri@jurta.org>
date Sun, 14 Aug 2005 06:57:21 +0000
parents 4fc385f4c685
children 4d49c0a8741e
files lisp/delsel.el
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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.