changeset 46180:fe05a48a78e1

(cua--rectangle-operation): Don't call FCT if current column is outside rectangle. (cua--delete-rectangle): Do nothing if zero width or out of bounds.
author Kim F. Storm <storm@cua.dk>
date Thu, 04 Jul 2002 22:20:26 +0000
parents 6e82e521d3ab
children 92759818ae6d
files lisp/emulation/cua-rect.el
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emulation/cua-rect.el	Thu Jul 04 22:19:57 2002 +0000
+++ b/lisp/emulation/cua-rect.el	Thu Jul 04 22:20:26 2002 +0000
@@ -575,7 +575,7 @@
               (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 @@
 (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)