diff options
author | Noam Postavsky <npostavs@gmail.com> | 2018-06-30 09:14:22 -0400 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2018-07-09 20:08:13 -0400 |
commit | e4ad2d1a8fad8c8c786b61083b05cfaa1ea5669c (patch) | |
tree | d56221de41e6d1d1b43edd025c1bba379684a312 /lisp | |
parent | 737481cc624c62bdbd210b3eda8a6de0f23d4505 (diff) | |
download | emacs-e4ad2d1a8fad8c8c786b61083b05cfaa1ea5669c.tar.gz |
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.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-with-read-only-field): Don't expect to fail.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/indent.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/indent.el b/lisp/indent.el index 398585e1f90..db811cf35cc 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -300,8 +300,9 @@ 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?) - (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. |