changeset 45062:3c062ba50b96

(cua--pre-command-handler): Only interpret delete-selection property if mark-active.
author Kim F. Storm <storm@cua.dk>
date Wed, 01 May 2002 14:22:06 +0000
parents 72aa07dcca52
children 2262495f2321
files lisp/emulation/cua-base.el
diffstat 1 files changed, 22 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emulation/cua-base.el	Wed May 01 14:21:37 2002 +0000
+++ b/lisp/emulation/cua-base.el	Wed May 01 14:22:06 2002 +0000
@@ -875,27 +875,28 @@
 	      (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