From: Kim F. Storm Date: Thu, 4 Jul 2002 22:20:26 +0000 (+0000) Subject: (cua--rectangle-operation): Don't call X-Git-Tag: ttn-vms-21-2-B4~14307 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=42cc3428ed2707f7a3fadcaaa827f9c8010b4c8f;p=emacs.git (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. --- diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index f7dd08bdd0a..a0663d93d2a 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -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)