summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/cl-print-tests.el
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2017-04-23 10:43:05 -0400
committerNoam Postavsky <npostavs@gmail.com>2017-05-09 20:50:19 -0400
commite7b6751c0a74f24c14cd207d57a4e1a95f409256 (patch)
tree14f60933c9d78aabf42ba79abd911f9ef3e3d373 /test/lisp/emacs-lisp/cl-print-tests.el
parent17e540aa428c5392f7a9b4c1f7495bac8a8fe5da (diff)
downloademacs-e7b6751c0a74f24c14cd207d57a4e1a95f409256.tar.gz
emacs-e7b6751c0a74f24c14cd207d57a4e1a95f409256.tar.bz2
emacs-e7b6751c0a74f24c14cd207d57a4e1a95f409256.zip
Fix lisp-indent-region and indent-sexp (Bug#26619)
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.
Diffstat (limited to 'test/lisp/emacs-lisp/cl-print-tests.el')
0 files changed, 0 insertions, 0 deletions