]> git.eshelyaron.com Git - emacs.git/commitdiff
(cua--rectangle-operation): Don't call
authorKim F. Storm <storm@cua.dk>
Thu, 4 Jul 2002 22:20:26 +0000 (22:20 +0000)
committerKim F. Storm <storm@cua.dk>
Thu, 4 Jul 2002 22:20:26 +0000 (22:20 +0000)
FCT if current column is outside rectangle.
(cua--delete-rectangle): Do nothing if zero width or out of bounds.

lisp/emulation/cua-rect.el

index f7dd08bdd0a01a5f05a787f9de7c18f14af4c35c..a0663d93d2a95823281f04a235c0344f894dc179 100644 (file)
@@ -575,7 +575,7 @@ If command is repeated at same position, delete the rectangle."
               (forward-char 1))
           (set-marker m (point))
           (move-to-column l pad)
-          (if fct
+          (if (and fct (>= (current-column) l) (<= (current-column) r))
               (let ((v t) (p (point)))
                 (when sel
                   (if (car (cdr sel))
@@ -614,7 +614,8 @@ If command is repeated at same position, delete the rectangle."
 (defun cua--delete-rectangle ()
   (cua--rectangle-operation nil nil t 2
     '(lambda (s e l r)
-       (delete-region s (if (> e s) e (1+ e))))))
+       (if (and (> e s) (<= e (point-max)))
+          (delete-region s e)))))
 
 (defun cua--extract-rectangle ()
   (let (rect)