From: Richard M. Stallman Date: Wed, 3 Sep 1997 21:09:39 +0000 (+0000) Subject: (operate-on-rectangle): If we overshoot when looking for endcol, back up. X-Git-Tag: emacs-20.1~216 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=daabd795082bb3fcee4d8606fc8fce4c8e963d1b;p=emacs.git (operate-on-rectangle): If we overshoot when looking for endcol, back up. --- diff --git a/lisp/rect.el b/lisp/rect.el index d8e742ce6a1..2904f94687a 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -60,6 +60,10 @@ Point is at the end of the segment of this line within the rectangle." (setq begextra (- (current-column) startcol)) (setq startpos (point)) (move-to-column endcol coerce-tabs) + ;; If we overshot, move back one character + ;; so that endextra will be positive. + (if (and (not coerce-tabs) (> (current-column) endcol)) + (backward-char 1)) (setq endextra (- endcol (current-column))) (if (< begextra 0) (setq endextra (+ endextra begextra)