summaryrefslogtreecommitdiff
path: root/lisp/indent.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-11-14 21:05:54 +0000
committerRichard M. Stallman <rms@gnu.org>1995-11-14 21:05:54 +0000
commita80a30b333db58ab32dc33e7a1ccfa148648a099 (patch)
tree3c195101fdc39dad0f7e1f5801c2cea5aa1f2cf5 /lisp/indent.el
parent3bb3cfe75d034ccc493c226871b12716698093b2 (diff)
downloademacs-a80a30b333db58ab32dc33e7a1ccfa148648a099.tar.gz
(indent-line-to): Delete spaces before inserting a tab.
Diffstat (limited to 'lisp/indent.el')
-rw-r--r--lisp/indent.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/indent.el b/lisp/indent.el
index 47ef23d4aa3..19786237d6d 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -82,6 +82,9 @@ only if necessary. It leaves point at end of indentation."
(back-to-indentation)
(let ((cur-col (current-column)))
(cond ((< cur-col column)
+ (if (> (- column (* (/ cur-col tab-width) tab-width)) tab-width)
+ (delete-region (point)
+ (progn (skip-chars-backward " ") (point))))
(indent-to column))
((> cur-col column) ; too far right (after tab?)
(delete-region (progn (move-to-column column t) (point))