]> git.eshelyaron.com Git - emacs.git/commitdiff
(cua--pre-command-handler): Only interpret delete-selection property if mark-active.
authorKim F. Storm <storm@cua.dk>
Wed, 1 May 2002 14:22:06 +0000 (14:22 +0000)
committerKim F. Storm <storm@cua.dk>
Wed, 1 May 2002 14:22:06 +0000 (14:22 +0000)
lisp/emulation/cua-base.el

index 71b124e805ca75c95eb3c06183635bae86d44eca..b8188b7eb183bc95ecd7fb9cba2e97f630ea1d39 100644 (file)
@@ -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