]> git.eshelyaron.com Git - emacs.git/commitdiff
(delete-selection-pre-hook): Don't set this-command
authorGerd Moellmann <gerd@gnu.org>
Tue, 31 Jul 2001 11:36:30 +0000 (11:36 +0000)
committerGerd Moellmann <gerd@gnu.org>
Tue, 31 Jul 2001 11:36:30 +0000 (11:36 +0000)
to `ignore' if the region is empty.

lisp/ChangeLog
lisp/delsel.el

index a80a5a00f90195ab24bac0c52f494b9b7686507e..6b3a7796363e62535e9d5e1275e8be5a1159b6dc 100644 (file)
@@ -1,5 +1,8 @@
 2001-07-31  Gerd Moellmann  <gerd@gnu.org>
 
+       * 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.
 
index 52819206810fb86e7d3c65d26c5ca63847a0a288..4301e69b61dcb0958d82180ffb945f0906df8d97 100644 (file)
@@ -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 @@ 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))))))