]> git.eshelyaron.com Git - emacs.git/commitdiff
(clear-rectangle-line): Reindent to the same column
authorRichard M. Stallman <rms@gnu.org>
Tue, 26 Feb 2002 16:05:48 +0000 (16:05 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 26 Feb 2002 16:05:48 +0000 (16:05 +0000)
that move-to-column reached when it tried to go to endcol.

lisp/rect.el

index 3c5ea78a36ff04d030804021c8537bffe4425648..84094cdb6ea5624dddb7b042fe506d7473aec057 100644 (file)
@@ -367,8 +367,7 @@ rectangle which were empty."
   (apply-on-rectangle 'clear-rectangle-line start end fill))
 
 (defun clear-rectangle-line (startcol endcol fill)
-  (let ((pt (point-at-eol))
-       spaces)
+  (let ((pt (point-at-eol)))
     (when (= (move-to-column startcol (or fill 'coerce)) startcol)
       (if (and (not fill)
               (<= (save-excursion (goto-char pt) (current-column)) endcol))
@@ -376,9 +375,9 @@ rectangle which were empty."
        ;; else
        (setq pt (point))
        (move-to-column endcol t)
-       (setq spaces (- (point) pt))
+       (setq endcol (current-column))
        (delete-region pt (point))
-       (indent-to (+ (current-column) spaces))))))
+       (indent-to endcol)))))
 
 (provide 'rect)