aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2002-02-26 16:05:48 +0000
committerRichard M. Stallman2002-02-26 16:05:48 +0000
commit7dfee0293db4f22fa771a8f68f7bdf45c4accec8 (patch)
tree28a921995a5df66f2548f04a812e11b8632730e4
parent8caa4ef5bd8ba4a0e3ebdeddedad1e182bdb27bb (diff)
downloademacs-7dfee0293db4f22fa771a8f68f7bdf45c4accec8.tar.gz
emacs-7dfee0293db4f22fa771a8f68f7bdf45c4accec8.zip
(clear-rectangle-line): Reindent to the same column
that move-to-column reached when it tried to go to endcol.
-rw-r--r--lisp/rect.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/rect.el b/lisp/rect.el
index 3c5ea78a36f..84094cdb6ea 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -367,8 +367,7 @@ rectangle which were empty."
367 (apply-on-rectangle 'clear-rectangle-line start end fill)) 367 (apply-on-rectangle 'clear-rectangle-line start end fill))
368 368
369(defun clear-rectangle-line (startcol endcol fill) 369(defun clear-rectangle-line (startcol endcol fill)
370 (let ((pt (point-at-eol)) 370 (let ((pt (point-at-eol)))
371 spaces)
372 (when (= (move-to-column startcol (or fill 'coerce)) startcol) 371 (when (= (move-to-column startcol (or fill 'coerce)) startcol)
373 (if (and (not fill) 372 (if (and (not fill)
374 (<= (save-excursion (goto-char pt) (current-column)) endcol)) 373 (<= (save-excursion (goto-char pt) (current-column)) endcol))
@@ -376,9 +375,9 @@ rectangle which were empty."
376 ;; else 375 ;; else
377 (setq pt (point)) 376 (setq pt (point))
378 (move-to-column endcol t) 377 (move-to-column endcol t)
379 (setq spaces (- (point) pt)) 378 (setq endcol (current-column))
380 (delete-region pt (point)) 379 (delete-region pt (point))
381 (indent-to (+ (current-column) spaces)))))) 380 (indent-to endcol)))))
382 381
383(provide 'rect) 382(provide 'rect)
384 383