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
commitc1194ae809da0a5c435bd10fcf3ff4248bd3c869 (patch)
tree6be94041f7d097d2524941d3474bf81c540f2d8b /lisp/indent.el
parent5e778cd16a92ecd30c28b51fedd6840b04832f02 (diff)
downloademacs-c1194ae809da0a5c435bd10fcf3ff4248bd3c869.tar.gz
emacs-c1194ae809da0a5c435bd10fcf3ff4248bd3c869.tar.bz2
emacs-c1194ae809da0a5c435bd10fcf3ff4248bd3c869.zip
(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)))