summaryrefslogtreecommitdiff
path: root/lisp/indent.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-08-27 19:40:47 +0000
committerRichard M. Stallman <rms@gnu.org>1994-08-27 19:40:47 +0000
commitd159cb33f12b065a8220734155ed443f642a406c (patch)
tree0ded031f5f4c18e9e9ec9fcaed36e16f837d9de2 /lisp/indent.el
parent62e57a8f5ba9636d300bd414d070cc88fd6897c2 (diff)
downloademacs-d159cb33f12b065a8220734155ed443f642a406c.tar.gz
(indent-rigidly): Insert new indent, then delete old.
Diffstat (limited to 'lisp/indent.el')
-rw-r--r--lisp/indent.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/indent.el b/lisp/indent.el
index f869b175f75..27270fb4110 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -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)))