mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-19 10:22:27 +00:00
e7b6751c0a
The new lisp-indent-region introduced in 2017-04-22 "Add new `lisp-indent-region' that doesn't reparse the code." is broken because it doesn't save the calculated indent amounts for already seen sexp depths. Fix this by unifying the indent-sexp and lisp-indent-region code. Furthermore, only preserve position 2 of the running parse when the depth doesn't change. * lisp/emacs-lisp/lisp-mode.el (lisp-ppss): Use an OLDSTATE that corresponds with the start point when calling parse-partial-sexp. (lisp-indent-state): New struct. (lisp-indent-calc-next): New function, extracted from indent-sexp. (indent-sexp, lisp-indent-region): Use it. (lisp-indent-line): Take indentation, instead of parse state. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-mode-tests--correctly-indented-sexp): New constant. (lisp-indent-region, lisp-indent-region-defun-with-docstring): (lisp-indent-region-open-paren, lisp-indent-region-in-sexp): New tests. |
||
---|---|---|
.. | ||
eieio-tests | ||
package-resources | ||
testcover-resources | ||
benchmark-tests.el | ||
bytecomp-tests.el | ||
checkdoc-tests.el | ||
cl-extra-tests.el | ||
cl-generic-tests.el | ||
cl-lib-tests.el | ||
cl-print-tests.el | ||
cl-seq-tests.el | ||
ert-tests.el | ||
ert-x-tests.el | ||
generator-tests.el | ||
let-alist-tests.el | ||
lisp-mode-tests.el | ||
lisp-tests.el | ||
map-tests.el | ||
nadvice-tests.el | ||
package-tests.el | ||
pcase-tests.el | ||
pp-tests.el | ||
regexp-opt-tests.el | ||
ring-tests.el | ||
rx-tests.el | ||
seq-tests.el | ||
subr-x-tests.el | ||
tabulated-list-test.el | ||
testcover-tests.el | ||
thunk-tests.el | ||
timer-tests.el |