]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/indent.el (indent-line-to): Fix dedenting of tabs.
authorNoam Postavsky <npostavs@gmail.com>
Tue, 10 Jul 2018 16:07:01 +0000 (12:07 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Tue, 10 Jul 2018 16:07:01 +0000 (12:07 -0400)
lisp/indent.el

index db811cf35cc4cb2e19b384aa7cf04136872519b2..450632174fcc27e61bda53703d157c3379f1f785 100644 (file)
@@ -300,9 +300,11 @@ only if necessary.  It leaves point at end of indentation."
                              (progn (skip-chars-backward " ") (point))))
           (indent-to column))
          ((> cur-col column) ; too far right (after tab?)
-           (let ((cur-indent (point)))
-             (delete-region (progn (move-to-column column t) (point))
-                            cur-indent))))))
+           (delete-region (progn (move-to-column column t) (point))
+                          ;; The `move-to-column' call may replace
+                          ;; tabs with spaces, so we can't reuse the
+                          ;; previous `back-to-indentation' point.
+                          (progn (back-to-indentation) (point)))))))
 
 (defun current-left-margin ()
   "Return the left margin to use for this line.