changeset 43555:c33c91ae60fc

(clear-rectangle-line): Reindent to the same column that move-to-column reached when it tried to go to endcol.
author Richard M. Stallman <rms@gnu.org>
date Tue, 26 Feb 2002 16:05:48 +0000
parents b785a21f5738
children 9e4a1be87f8c
files lisp/rect.el
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/rect.el	Tue Feb 26 16:05:35 2002 +0000
+++ b/lisp/rect.el	Tue Feb 26 16:05:48 2002 +0000
@@ -367,8 +367,7 @@
   (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 @@
 	;; 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)