diff options
author | Juri Linkov <juri@jurta.org> | 2005-08-14 06:57:21 +0000 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2005-08-14 06:57:21 +0000 |
commit | ec354200bd7234ea45627a87edda27a5ca068fcb (patch) | |
tree | 57d8195e9809a1580a21f07ad2e7aa9079191016 /lisp/delsel.el | |
parent | 73b3bca5dfab60980e600714c26fb274bcb30c03 (diff) | |
download | emacs-ec354200bd7234ea45627a87edda27a5ca068fcb.tar.gz |
(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.
Diffstat (limited to 'lisp/delsel.el')
-rw-r--r-- | lisp/delsel.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/delsel.el b/lisp/delsel.el index 74ef011d477..d7a3d90e969 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. |