From a31918efdbdbf4c6d3f26ae7a73aba910f164116 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 30 Jun 2018 09:14:22 -0400 Subject: [PATCH v2] Respect field boundaries in indent-line-to (Bug#32014) * lisp/indent.el (indent-line-to): Use the back-to-indentation point as the end-point of whitespace removal, rather than backward-to-indentation which doesn't respect field boundaries. --- lisp/indent.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/indent.el b/lisp/indent.el index eb5b21e8e8..14efe8bfdf 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -300,8 +300,9 @@ indent-line-to (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)) - (progn (backward-to-indentation 0) (point))))))) + (let ((cur-indent (point))) + (delete-region (progn (move-to-column column t) (point)) + cur-indent)))))) (defun current-left-margin () "Return the left margin to use for this line. -- 2.11.0