diff options
author | Gerd Moellmann <gerd@gnu.org> | 2001-07-31 11:36:30 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2001-07-31 11:36:30 +0000 |
commit | 10e922bdd215aeb206ddbba8d9a625640baaedb0 (patch) | |
tree | 52c867a464bbfce540e178eef9f6278c0e5bb682 /lisp/delsel.el | |
parent | b23bad0b77191825b150ab7e35de74c21485546c (diff) |
(delete-selection-pre-hook): Don't set this-command
to `ignore' if the region is empty.
Diffstat (limited to 'lisp/delsel.el')
-rw-r--r-- | lisp/delsel.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/delsel.el b/lisp/delsel.el index 5281920681..4301e69b61 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 <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)))))) |