[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master e4ad2d1 5/5: Respect field boundaries in indent-lin
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] master e4ad2d1 5/5: Respect field boundaries in indent-line-to (Bug#32014) |
Date: |
Mon, 9 Jul 2018 20:45:19 -0400 (EDT) |
branch: master
commit e4ad2d1a8fad8c8c786b61083b05cfaa1ea5669c
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
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.
---
lisp/indent.el | 5 +++--
test/lisp/emacs-lisp/lisp-mode-tests.el | 1 -
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lisp/indent.el b/lisp/indent.el
index 398585e..db811cf 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.
diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el
b/test/lisp/emacs-lisp/lisp-mode-tests.el
index 2ac0e5c..8598d41 100644
--- a/test/lisp/emacs-lisp/lisp-mode-tests.el
+++ b/test/lisp/emacs-lisp/lisp-mode-tests.el
@@ -226,7 +226,6 @@ Expected initialization file: `%s'\"
(ert-deftest lisp-indent-with-read-only-field ()
"Test indentation on line with read-only field (Bug#32014)."
- :expected-result :failed
(with-temp-buffer
(insert (propertize "prompt> " 'field 'output 'read-only t
'rear-nonsticky t 'front-sticky '(read-only)))