# HG changeset patch # User Richard M. Stallman # Date 873320979 0 # Node ID d8478556c7f0d57a7a9b6848480dbdda9d2361ce # Parent 920d0a7b59305f002dc4bc7b19aa8a87d0186a9c (operate-on-rectangle): If we overshoot when looking for endcol, back up. diff -r 920d0a7b5930 -r d8478556c7f0 lisp/rect.el --- a/lisp/rect.el Wed Sep 03 20:52:13 1997 +0000 +++ b/lisp/rect.el Wed Sep 03 21:09:39 1997 +0000 @@ -60,6 +60,10 @@ (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)