summaryrefslogtreecommitdiff
path: root/lisp/indent.el
diff options
context:
space:
mode:
authorBoris Goldowsky <boris@gnu.org>1995-03-16 22:36:26 +0000
committerBoris Goldowsky <boris@gnu.org>1995-03-16 22:36:26 +0000
commit4d5350634e6aa991ff9b270135e9e32c89a54860 (patch)
tree884dacf77c51c4b4442cdbd6829afb9d3f8b6fe3 /lisp/indent.el
parent9a3689fb0b8e6c90421e0fb88900af871b937544 (diff)
downloademacs-4d5350634e6aa991ff9b270135e9e32c89a54860.tar.gz
(indent-line-to): move to end of indentation, even if it didn't change.
Diffstat (limited to 'lisp/indent.el')
-rw-r--r--lisp/indent.el14
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/indent.el b/lisp/indent.el
index d1777c8681a..59112846d79 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -77,15 +77,13 @@ Called from a program, takes three arguments, START, END and ARG."
"Indent current line to COLUMN.
This function removes or adds spaces and tabs at beginning of line
only if necessary. It leaves point at end of indentation."
- (beginning-of-line)
- (let ((bol (point))
- (cur-col (current-indentation)))
- (cond ((> cur-col column) ; too far right (after tab?)
+ (back-to-indentation)
+ (let ((cur-col (current-column)))
+ (cond ((< cur-col column)
+ (indent-to column))
+ ((> cur-col column) ; too far right (after tab?)
(delete-region (progn (move-to-column column t) (point))
- (progn (back-to-indentation) (point))))
- ((< cur-col column)
- (back-to-indentation)
- (indent-to column)))))
+ (progn (back-to-indentation) (point)))))))
(defun current-left-margin ()
"Return the left margin to use for this line.