aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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."
77 "Indent current line to COLUMN. 77 "Indent current line to COLUMN.
78This function removes or adds spaces and tabs at beginning of line 78This function removes or adds spaces and tabs at beginning of line
79only if necessary. It leaves point at end of indentation." 79only if necessary. It leaves point at end of indentation."
80 (beginning-of-line) 80 (back-to-indentation)
81 (let ((bol (point)) 81 (let ((cur-col (current-column)))
82 (cur-col (current-indentation))) 82 (cond ((< cur-col column)
83 (cond ((> cur-col column) ; too far right (after tab?) 83 (indent-to column))
84 ((> cur-col column) ; too far right (after tab?)
84 (delete-region (progn (move-to-column column t) (point)) 85 (delete-region (progn (move-to-column column t) (point))
85 (progn (back-to-indentation) (point)))) 86 (progn (back-to-indentation) (point)))))))
86 ((< cur-col column)
87 (back-to-indentation)
88 (indent-to column)))))
89 87
90(defun current-left-margin () 88(defun current-left-margin ()
91 "Return the left margin to use for this line. 89 "Return the left margin to use for this line.