emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master c249e17: * lisp/indent.el (indent-line-to): Fix ded


From: Noam Postavsky
Subject: [Emacs-diffs] master c249e17: * lisp/indent.el (indent-line-to): Fix dedenting of tabs.
Date: Tue, 10 Jul 2018 12:10:40 -0400 (EDT)

branch: master
commit c249e17324ddbb1ad34b510be3ad6ebd3248ba0c
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    * lisp/indent.el (indent-line-to): Fix dedenting of tabs.
---
 lisp/indent.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/indent.el b/lisp/indent.el
index db811cf..4506321 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]