aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2002-05-01 14:22:06 +0000
committerKim F. Storm2002-05-01 14:22:06 +0000
commite75d337c0a34a0ac57e3f565f322c9b313d20985 (patch)
tree8023ce2bcf315b6bc1a24e3d01d97f62b40c331e
parent958e3d8a97c3f3201a559c664249c12b009f634d (diff)
downloademacs-e75d337c0a34a0ac57e3f565f322c9b313d20985.tar.gz
emacs-e75d337c0a34a0ac57e3f565f322c9b313d20985.zip
(cua--pre-command-handler): Only interpret delete-selection property if mark-active.
-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 71b124e805c..b8188b7eb18 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'")
875 (setq deactivate-mark t))) 875 (setq deactivate-mark t)))
876 876
877 ;; Handle delete-selection property on other commands 877 ;; Handle delete-selection property on other commands
878 (let* ((ds (or (get this-command 'delete-selection) 878 (if (and mark-active (not deactivate-mark))
879 (get this-command 'pending-delete))) 879 (let* ((ds (or (get this-command 'delete-selection)
880 (nc (cond 880 (get this-command 'pending-delete)))
881 ((eq ds 'yank) 881 (nc (cond
882 'cua-paste) 882 ((not ds) nil)
883 ((eq ds 'kill) 883 ((eq ds 'yank)
884 (if cua--rectangle 884 'cua-paste)
885 'cua-copy-rectangle 885 ((eq ds 'kill)
886 'cua-copy-region)) 886 (if cua--rectangle
887 ((eq ds 'supersede) 887 'cua-copy-rectangle
888 (if cua--rectangle 888 'cua-copy-region))
889 'cua-delete-rectangle ;; replace? 889 ((eq ds 'supersede)
890 'cua-replace-region)) 890 (if cua--rectangle
891 (ds 891 'cua-delete-rectangle ;; replace?
892 (if cua--rectangle 892 'cua-replace-region))
893 'cua-delete-rectangle 893 (t
894 'cua-delete-region)) 894 (if cua--rectangle
895 (t nil)))) 895 'cua-delete-rectangle
896 (if nc 896 'cua-delete-region)))))
897 (setq this-original-command this-command 897 (if nc
898 this-command nc)))) 898 (setq this-original-command this-command
899 this-command nc)))))
899 900
900 ;; Detect extension of rectangles by mouse or other movement 901 ;; Detect extension of rectangles by mouse or other movement
901 (setq cua--buffer-and-point-before-command 902 (setq cua--buffer-and-point-before-command