changeset 38616:3dbecf5d82d8

(delete-selection-pre-hook): Don't set this-command to `ignore' if the region is empty.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 31 Jul 2001 11:36:09 +0000
parents 4c230c64c6df
children a4b551512b8c
files lisp/delsel.el
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/delsel.el	Tue Jul 31 09:50:56 2001 +0000
+++ b/lisp/delsel.el	Tue Jul 31 11:36:09 2001 +0000
@@ -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 <devin@lucid.com>
 ;; Maintainer: FSF
@@ -96,8 +96,10 @@
 	       (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))))))