]> git.eshelyaron.com Git - emacs.git/commitdiff
(indent-rigidly): Insert new indent, then delete old.
authorRichard M. Stallman <rms@gnu.org>
Sat, 27 Aug 1994 19:40:47 +0000 (19:40 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 27 Aug 1994 19:40:47 +0000 (19:40 +0000)
lisp/indent.el

index f869b175f75ead861e349ee53e098952a764f273..27270fb4110f9c5f2975a8fb3ad877207af6f3d2 100644 (file)
@@ -59,10 +59,14 @@ Called from a program, takes three arguments, START, END and ARG."
     (goto-char start)
     (or (bolp) (forward-line 1))
     (while (< (point) end)
-      (let ((indent (current-indentation)))
-       (delete-region (point) (progn (skip-chars-forward " \t") (point)))
-       (or (eolp)
-           (indent-to (max 0 (+ indent arg)) 0)))
+      (let ((indent (current-indentation))
+           eol-flag)
+       (save-excursion
+         (skip-chars-forward " \t")
+         (setq eol-flag (eolp)))
+       (or eol-flag
+           (indent-to (max 0 (+ indent arg)) 0))
+       (delete-region (point) (progn (skip-chars-forward " \t") (point))))
       (forward-line 1))
     (move-marker end nil)))