From 10e922bdd215aeb206ddbba8d9a625640baaedb0 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Tue, 31 Jul 2001 11:36:30 +0000 Subject: [PATCH] (delete-selection-pre-hook): Don't set this-command to `ignore' if the region is empty. --- lisp/ChangeLog | 3 +++ lisp/delsel.el | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a80a5a00f90..6b3a7796363 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2001-07-31 Gerd Moellmann + * delsel.el (delete-selection-pre-hook): Don't set this-command + to `ignore' if the region is empty. + * international/mule.el (set-keyboard-coding-system): Set keyboard-coding-system. diff --git a/lisp/delsel.el b/lisp/delsel.el index 52819206810..4301e69b61d 100644 --- a/lisp/delsel.el +++ b/lisp/delsel.el @@ -1,6 +1,6 @@ ;;; delsel.el --- delete selection if you insert -;; Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc. +;; Copyright (C) 1992, 1997, 1998, 2001 Free Software Foundation, Inc. ;; Author: Matthieu Devin ;; Maintainer: FSF @@ -96,8 +96,10 @@ any selection." (current-kill 1)) (delete-active-region)) ((eq type 'supersede) - (delete-active-region) - (setq this-command 'ignore)) + (let ((empty-region (= (point) (mark)))) + (delete-active-region) + (unless empty-region + (setq this-command 'ignore)))) (type (delete-active-region)))))) -- 2.39.2