From: Gerd Moellmann Date: Tue, 31 Jul 2001 11:36:30 +0000 (+0000) Subject: (delete-selection-pre-hook): Don't set this-command X-Git-Tag: emacs-pretest-21.0.105~345 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=10e922bdd215aeb206ddbba8d9a625640baaedb0;p=emacs.git (delete-selection-pre-hook): Don't set this-command to `ignore' if the region is empty. --- 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))))))