aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emulation
diff options
context:
space:
mode:
authorKim F. Storm <[email protected]>2002-05-01 14:22:06 +0000
committerKim F. Storm <[email protected]>2002-05-01 14:22:06 +0000
commite75d337c0a34a0ac57e3f565f322c9b313d20985 (patch)
tree8023ce2bcf315b6bc1a24e3d01d97f62b40c331e /lisp/emulation
parent958e3d8a97c3f3201a559c664249c12b009f634d (diff)
(cua--pre-command-handler): Only interpret delete-selection property if mark-active.
Diffstat (limited to 'lisp/emulation')
-rw-r--r--lisp/emulation/cua-base.el43
1 files changed, 22 insertions, 21 deletions
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index 71b124e805..b8188b7eb1 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -875,27 +875,28 @@ Extra commands should be added to `cua-user-movement-commands'")
(setq deactivate-mark t)))
;; Handle delete-selection property on other commands
- (let* ((ds (or (get this-command 'delete-selection)
- (get this-command 'pending-delete)))
- (nc (cond
- ((eq ds 'yank)
- 'cua-paste)
- ((eq ds 'kill)
- (if cua--rectangle
- 'cua-copy-rectangle
- 'cua-copy-region))
- ((eq ds 'supersede)
- (if cua--rectangle
- 'cua-delete-rectangle ;; replace?
- 'cua-replace-region))
- (ds
- (if cua--rectangle
- 'cua-delete-rectangle
- 'cua-delete-region))
- (t nil))))
- (if nc
- (setq this-original-command this-command
- this-command nc))))
+ (if (and mark-active (not deactivate-mark))
+ (let* ((ds (or (get this-command 'delete-selection)
+ (get this-command 'pending-delete)))
+ (nc (cond
+ ((not ds) nil)
+ ((eq ds 'yank)
+ 'cua-paste)
+ ((eq ds 'kill)
+ (if cua--rectangle
+ 'cua-copy-rectangle
+ 'cua-copy-region))
+ ((eq ds 'supersede)
+ (if cua--rectangle
+ 'cua-delete-rectangle ;; replace?
+ 'cua-replace-region))
+ (t
+ (if cua--rectangle
+ 'cua-delete-rectangle
+ 'cua-delete-region)))))
+ (if nc
+ (setq this-original-command this-command
+ this-command nc)))))
;; Detect extension of rectangles by mouse or other movement
(setq cua--buffer-and-point-before-command